Feroc1ty
2011-03-20 00:08:06
How Long have You Played Runescape?
10 Year(s)
Are you affilated in anyway with Jagex LTD?
no
Were you Referred to SRL?
irl friend long time ago
What is your general programming knowledge?
a few
Are you a member of any other communities?
bangbros, bustyasians, hustler magazine
Tell us about yourself…
Please show us one (or multiple) of your scripts.
script
—— the general include ——
—- the walking include —-
10 Year(s)
Are you affilated in anyway with Jagex LTD?
no
Were you Referred to SRL?
irl friend long time ago
What is your general programming knowledge?
a few
Are you a member of any other communities?
bangbros, bustyasians, hustler magazine
Tell us about yourself…
From: Feroc1ty
a runescape scripter
Please show us one (or multiple) of your scripts.
script
program CharacterSelfStart;
// -------- include settings --------
const
// SMART client settings
CLIENT_MEMBERS = false;
CLIENT_SERVER = 75;
CLIENT_SIGNED = true;
CLIENT_DETAIL = false;
{$i Feroc1tyGeneral.simba}
{$i Feroc1tyWalking.simba}
{$i SRL/SRL/Misc/stats.simba}
// ----------------------------------
{procedure DeclarePlayers;
begin
HowManyPlayers := 1;
CurrentPlayer := 0;
NumberOfPlayers(HowManyPlayers);
with Players[0] do
begin
name := '';
nick := '';
pass := '';
pin := '';
active := true;
end;
end;}
// -------- script constants --------
const
SRLStats_UserID = '';
SRLStats_Password = '';
FEATHER_ID = 314;
SLING_ID = 19830;
// ----------------------------------
// -------- script variables --------
var
starting_location:TTile;
lumby_location:TTile;
pen_location:TTile;
starting_path:TPointArray;
sling_path:TPointArray;
last_attack_type:string;
pen_area:TBox;
house_area:TBox;
goblins_area:TBox;
gate:fObject;
door:fObject;
checkworld_timeout:longint;
updatestats_timeout:longint;
// ----------------------------------
// -------- script settings --------
const
TARGET_ATTACK = 20;
TARGET_STRENGTH = 40;
TARGET_DEFENSE = 20;
TARGET_RANGE = 40;
MAX_PEOPLE_IN_PEN = 3; // how many people (besides you) inside the pen needed to switch world
ENABLE_DEBUG = true;
// ---------------------------------
// ,
//---__-----__----)__------------__---_/_-
// (_ ` / ' / ) / / ) /
//_(__)__(___ __/______/______/___/__(_ __
// /
// /
procedure Initialize;
begin
// general
fInitialize(ENABLE_DEBUG);
// points/locations
starting_location := Tile(3204, 3245);
lumby_location := Tile(3222, 3217);
pen_location := Tile(3188, 3276);
// areas/boxes
pen_area := IntToBox(3185,3276,3191,3279);
house_area := IntToBox(3184,3270,3192,3275);
goblins_area := IntToBox(3242,3219,3264,3252);
// paths
SetArrayLength(starting_path,7);
starting_path := [Point(3215, 3246), Point(3218, 3255), Point(3216, 3267),
Point(3214, 3278), Point(3203, 3278), Point(3195, 3278),
Point(3189, 3281)];
SetArrayLength(sling_path,10);
sling_path := [Point(3197, 3279), Point(3209, 3279), Point(3217, 3270),
Point(3218, 3259), Point(3219, 3249), Point(3224, 3238),
Point(3230, 3229), Point(3237, 3224), Point(3246, 3224),
Point(3257, 3224)];
// fObjects
gate := CreateFOBJ('gate',45206,1,70,Tile(3188,3279),IntToBox(3188,3279,3189,3280));
door := CreateFOBJ('door',45476,1,70,Tile(3189,3276),IntToBox(3189,3275,3189,3276));
//SRL Stats
SetupSRLStats(67,SRLStats_UserID,SRLStats_Password);
end;
procedure AntiBan;
begin
case Random(600) of
0: IdleTime(2000, 1000, 0.2);
1: HoverSkill(Players[CurrentPlayer].Skill, False);
2: RandomRClick;
3: PickUpMouse;
4: LevelUp;
5: BoredHuman;
6: ExamineInv;
7: R_DropAllItemsBy(2138);
end;
end;
function BrandNewCharacter():boolean;
begin
result := IsNearbyPoint(starting_location, 5);
end;
procedure WalkToPen;
begin
fWalkPath(starting_path, false);
end;
function NearbyPen:boolean;
begin
result := IsNearbyPoint(pen_location, 15);
end;
function IsCharacterInPen:boolean;
begin
result := PointInBox(GetMyPos, pen_area);
end;
function IsCharacterInHouse:boolean;
begin
result := PointInBox(GetMyPos, house_area);
end;
function IsCharacterAtGoblins:boolean;
begin
result := PointInBox(GetMyPos, goblins_area);
end;
function IsCharacterAtLumby:boolean;
begin
result := IsNearbyPoint(lumby_location, 15);
end;
function MoveInsidePen:boolean;
begin
result := true;
if IsCharacterInPen then exit;
if IsCharacterInHouse then
begin
while not InteractWithFOBJ('open',door) do
begin
R_MakeCompass('r');
end;
end else
begin
while not InteractWithFOBJ('open',gate) do
begin
R_MakeCompass('r');
end;
end;
WalkToTile(Tile(3188,3277),1,0);
R_MakeCompass('n');
result := IsCharacterInPen;
end;
function MoveToLoc(location:string):boolean;
begin
case location of
'pen':begin
fWalkPath(sling_path,true);
result := MoveInsidePen;
end;
'goblins':fWalkPath(sling_path,false);
end;
end;
function InGrimsDen:boolean;
begin
result := ValidNPC('Grim Reaper');
end;
procedure TalkToGrim;
var portal,grimtile:TTile;
begin
SetAngle(true);
R_MakeCompass('N');
portal := GetMyPos;
portal.x := portal.x + 3;
grimtile := GetMyPos;
grimtile.x := grimtile.x - 4;
InteractWithTile('talk',Point(-15,-15),grimtile);
repeat
Wait(250+Random(1250));
until not R_ClickToContinue;
Wait(250+Random(1250));
InteractWithTile('enter',Point(0,0), portal);
Wait(4000+random(2000));
end;
procedure GetSling;
var t:integer;
begin
while IsCharacterInPen do InteractWithFOBJ('open',gate);
R_DropAllItemsBy(2138);
fWalkPath(sling_path,false);
repeat
if InGrimsDen then TalkToGrim;
if IsCharacterAtLumby then MoveToLoc('goblins');
FightNPC('goblin');
wait(1500+random(750));
PickUpItemNear(SLING_ID,'sling',6,t);
if R_CountItem(SLING_ID) > 0 then break;
until false
fWalkPath(sling_path,true);
end;
procedure InitializeCharacter;
begin
repeat
if AllPlayersInactive then break;
fDebug('InitializeCharacter','Beggining to initialize '+Players[CurrentPlayer].nick+'.');
if not R_LoggedIn then LogInPlayer;
wait(4000+random(4000));
SetAngle(true);
R_MakeCompass('n');
R_FindRandoms;
if BrandNewCharacter then WalkToPen;
if InGrimsDen then TalkToGrim;
if IsCharacterAtLumby then MoveToLoc('pen');
if IsCharacterAtGoblins then GetSling;
if not NearbyPen then
begin
writeln('Player['+tostr(CurrentPlayer)+'] is not near the pen, please relocate him.');
Players[CurrentPlayer].status := 'relocate';
NextPlayer(false);
continue;
end;
if not MoveInsidePen then
begin
WriteLn('Attempted to move inside the pen but failed, switching players.');
Players[CurrentPlayer].status := 'failed';
NextPlayer(true);
continue;
end;
last_attack_type := '';
Players[CurrentPlayer].status := 'initialized';
fDebug('InitializeCharacter','Character was fully initialized!');
until Players[CurrentPlayer].status = 'initialized';
end;
function WhatToTrain:string;
var temp:string;
char:TMe;
begin
char := GetMe;
if char.Levels[SKILL_RANGE] < TARGET_RANGE then temp := 'range';
if char.Levels[SKILL_DEFENCE] < TARGET_DEFENSE then temp := 'defense';
if char.Levels[SKILL_ATTACK] < TARGET_ATTACK then temp := 'attack';
if char.Levels[SKILL_STRENGTH] < TARGET_STRENGTH then temp := 'strength';
if (char.Levels[SKILL_ATTACK] < 10) and (char.Levels[SKILL_ATTACK] < TARGET_ATTACK) then temp := 'attack';
if (char.Levels[SKILL_STRENGTH] < 5) and (char.Levels[SKILL_STRENGTH] < TARGET_STRENGTH) then temp := 'strength';
result := temp;
end;
procedure ChangeAttack;
var sling:TInvItem;
begin
if not (Players[CurrentPlayer].Skill = last_attack_type) then
begin
last_attack_type := Players[CurrentPlayer].Skill;
if last_attack_type <> 'range' then
begin
if HasItemEquipped(EQUIPMENT_WEAPON) then
TakeOff(5);
case last_attack_type of
'attack' : SetFightMode(1);
'strength': SetFightMode(2);
'defense' : SetFightMode(4);
end;
end else
begin
if R_ItemExists('sling',sling) then
R_ClickItem(sling.slot, true, '')
else
GetSling;
end;
end;
end;
function TooCrowded:boolean;
var people:TPlayerArray;
i,y:integer;
begin
people := GetAllPlayers;
y := 0;
for i := 0 to high(people) do
begin
if PointInBox(people[i].tile,pen_area) then
begin
y := y + 1;
end;
end;
y := y - 1;
fDebug('TooCrowded','Found '+tostr(y)+' people inside the pen.');
if y >= MAX_PEOPLE_IN_PEN then result := true;
end;
function CheckWorld:boolean;
begin
if GetSystemTime > checkworld_timeout + 4*60*1000 then
begin
checkworld_timeout := GetSystemTime;
if TooCrowded then
begin
while not R_LobbyScreen do
begin
if R_LoggedIn then
ExitToLobby
else
LoginPlayerToLob;
end;
result := true;
OpenWorldScreen;
while not SelectWorld(RandomWorld(CLIENT_MEMBERS, false)) do Wait(3000);
LoginPlayer;
repeat
Wait(1000);
until R_LoggedIn;
end;
end;
end;
function FightChicken:boolean;
var mobs:TNPCArray;
index:integer;
exp:longint;
begin
index := 0;
exp := R_GetSkillExperience(Players[CurrentPlayer].Skill);
mobs := SortNPCs(GetNPCs('chicken'));
for index := 0 to high(mobs) do
begin
if (mobs[index].fighting or mobs[index].moving or not NpcInBox(mobs[index],pen_area)) then
continue;
result := InteractWithNPC('attack',mobs[index]);
if result then FinishFight(200);
exp := R_GetSkillExperience(Players[CurrentPlayer].Skill) - exp;
Stats_IncVariable('Total EXP Gained',exp);
break;
end;
end;
procedure PickupFeathers;
var ground:TGroundItemArray;
feather:TInvItem;
index:integer;
begin
ground := GetItemsNear(4);
R_ItemExists(FEATHER_ID,feather);
for index := 0 to high(ground) do
begin
if (ground[index].ID = FEATHER_ID) and PointInBox(ground[index].tile,pen_area) then
begin
ClickBox(PtToBox(TileToMS(ground[index].tile,30),8),false);
R_WaitOption('eather',300);
wait(100+random(75));
r_Flag;
R_ItemExists(FEATHER_ID,feather);
break;
end;
end;
wait(random(50));
end;
procedure CheckHouseForChickens;
var chickens:TNPCArray;
i:integer;
begin
if CountNPCsInBox('chicken',house_area) > 1 then
begin
InteractWithFOBJ('open',door);
chickens := GetNpcs('chicken');
for i := 0 to high(chickens) do
begin
if NpcInBox(chickens[i],house_area) then InteractWithNPC('attack',chickens[i]);
end;
MoveInsidePen;
end;
end;
procedure UpdateStats;
begin
if GetSystemTime > updatestats_timeout + 5*60*1000 then
begin
updatestats_timeout := GetSystemTime;
Stats_Commit;
end;
end;
procedure MainLoop;
begin
InitializeCharacter;
while true do
begin
TakeABreak;
if not R_LoggedIn then
begin
WriteLn('Character not logged in for unknown reason, switching player.');
NextPlayer(false);
Break;
end;
R_FindRandoms;
FindNormalRandoms;
if not MoveInsidePen then
begin
WriteLn('Character failed to move inside the pen, switching player.');
NextPlayer(true);
Break;
end;
CheckWorld;
R_MakeCompass('n');
Players[CurrentPlayer].Skill := WhatToTrain;
ChangeAttack;
if not FightChicken then PickupFeathers;
CheckHouseForChickens;
UpdateStats;
Antiban;
end;
end;
begin
Initialize;
while not R_LoginScreen do Wait(3000);
while not (AllPlayersInactive) do
begin
MainLoop;
end;
writeln('The script has succesfully finished running, ran for ['+TimeFromStart+'].');
end.—— the general include ——
{$i SRL/SRL/Misc/SMART.scar }
{$i SRL/SRL.scar }
{$i reflection/reflection.simba }
procedure DeclarePlayers;forward;
var
scriptStart,breakTime:longint;
displayDebug:boolean;
type fObject = record
name:string;
area:TBox;
tile:TTile;
id,typ,height:integer;
end;
function TimeFromStart:string;
var h,m,s:integer;
begin
ConvertTime(GetTimeRunning,h,m,s);
result := (Padz(IntToStr(h), 2) + ':' + Padz(IntToStr(m), 2) + ':' + Padz(IntToStr(s), 2));
end;
function TimeOfDay: string;
var
H, M, S, Ms: Word;
begin
DecodeTime(Now, H, M, S, Ms);
Result := (Padz(IntToStr(H), 2) + ':' + Padz(IntToStr(M), 2) + ':' + Padz(IntToStr(S), 2));
end;
procedure fDebug(loc,msg:string);
begin
if displayDebug then writeln(TimeOfDay + ' [ ' + loc + ' ] ' + msg);
end;
function TakeABreak:boolean;
var time:integer;
begin
if GetSystemTime > breakTime then
begin
time := ((15+random(30))*60*1000);
fDebug('TakeABreak','Taking a break for '+tostr(round(time/60/1000))+' minutes.');
if Random(1) = 0 then Logout;
wait(time);
time := ((60+random(120))*60*1000);
fDebug('TakeABreak','Returning from a break, will break again in '+tostr(round(time/60/1000))+' minutes.');
breakTime := GetSystemTime + time;
end;
end;
function PtToBox(tile:TPoint;size:integer):TBox;
begin
Result.X1 := Round(tile.x - size/2);
Result.X2 := Round(tile.x + size/2);
Result.Y1 := Round(tile.y - size/2);
Result.Y2 := Round(tile.y + size/2);
end;
function MouseInBox(box:TBox):boolean;
var pt:TPoint;
begin
GetMousePos(pt.x,pt.y);
result := PointInBox(pt, box);
end;
procedure ClickBox(box:TBox;left:boolean);
var x,y:integer;
begin
x := (box.x2 - box.x1)/2;
y := (box.y2 - box.y1)/2;
if not MouseInBox(box) then
MMouse(box.x1 + x + Random(RandomRange(-x,x)), box.y1 + y + Random(RandomRange(-y,y)), 0, 0);
ClickMouse2(left);
end;
procedure MoveBox(box:TBox);
var x,y:integer;
begin
x := (box.x2 - box.x1)/2;
y := (box.y2 - box.y1)/2;
if not MouseInBox(box) then
MMouse(box.x1 + x + Random(RandomRange(-x,x)), box.y1 + y + Random(RandomRange(-y,y)), 0, 0);
end;
function NpcInBox(npc:TNPC;box:TBox):boolean;
begin
result := PointInBox(npc.tile,box);
end;
function CountNPCsInBox(name:string;box:TBox):integer;
var mobs:TNPCArray;
i:integer;
begin
mobs := GetNpcs(name);
for i := 0 to high(mobs) do
begin
if NpcInBox(mobs[i],box) then result := result + 1;
end;
end;
function IsNearbyPoint(point:TPoint;tiles:integer):boolean;
begin
result := DistanceFrom(point) <= tiles;
end;
function PickupItemNear(id:integer;name:string;area:integer;var count:integer):boolean;
var ground:TGroundItemArray;
item:TInvItem;
index,num:integer;
begin
ground := GetItemsNear(area);
R_ItemExists(id,item);
num := item.StackSize;
for index := 0 to high(ground) do
begin
if (ground[index].ID = id) then
begin
ClickBox(PtToBox(TileToMS(ground[index].tile,30),8),false);
result := R_WaitOption(name,300);
wait(100+random(75));
r_Flag;
R_ItemExists(id,item);
count := count + item.stacksize - num;
break;
end;
end;
wait(random(50));
end;
function InteractWithTile(action:string;offset:TPoint;tile:TTile):boolean;
var pt:TPoint;
begin
result := false;
fDebug('InteractWithOBJ','Attempting to '+action+'.');
if not TileOnMS(tile,30) then WalkToTile(tile,1,0);
pt := TileToMS(tile,0);
pt.x := pt.x + offset.x;
pt.y := pt.y + offset.y;
MoveBox(PtToBox(pt,8));
Wait(100+random(125));
if R_IsUpText(action) then
begin
ClickMouse2(true);
result := true;
end else
begin
ClickMouse2(false);
result := R_ChooseOption(action);
end;
wait(500+random(150));
r_Flag;
end;
function InteractWithNPC(action:string;npc:TNPC):boolean;
begin
fDebug('InteractWithNPC','Attempting to '+action+' (to) a '+npc.name+'.');
if not TileOnMS(npc.tile,30) then
begin
WalkToTile(npc.tile,1,1);
R_Flag;
end;
MoveBox(PtToBox(TileToMS(npc.tile,30),10));
Wait(100+random(125));
if R_IsUpText(action+' '+npc.name) then
begin
ClickMouse2(true);
result := true;
end else
begin
ClickMouse2(false);
if R_ChooseOption(action+' '+npc.name) then result := true;
end;
end;
function CreateFOBJ(name:string;id,typ,height:integer;tile:TTile;area:TBox):fObject;
begin
result.name := name;
result.id := id;
result.typ := typ;
result.height := height;
result.tile := tile;
result.area := area;
end;
function InteractWithFOBJ(action:string;obj:fObject):boolean;
var t,t2,r:TPoint;
begin
result := true;
if GetObjectAt(obj.tile, obj.typ) = NULL_RSOBJECT then exit;
result := false;
t := TileToMS(Tile(obj.area.x1,obj.area.y1),obj.height);
t2 := TileToMS(tile(obj.area.x2,obj.area.y2),obj.height);
r.x := (t.x+t2.x)/2;
r.y := (t.y+t2.y)/2;
MoveBox(PtToBox(r,10));
Wait(100+random(125));
if R_IsUpText(action+' '+obj.name) then
begin
ClickMouse2(true);
result := true;
end else
begin
ClickMouse2(false);
if R_ChooseOption(action+' '+obj.name) then result := true;
end;
Wait(400+random(200));
R_Flag;
end;
function InteractWithOBJ(action:string;obj:TRSObject):boolean;
begin
result := false;
// this function isn't even started!
fDebug('InteractWithOBJ','This function is not yet created!');
end;
procedure FinishFight(delay:integer);
var i:integer;
mob:TNPC;
begin
r_Flag;
wait(delay);
for i := 0 to 30 do
begin
if CharacterAnimating then i := 0;
wait(50);
if AreWeInteracting(mob) = false then break;
end;
end;
function FightNPC(name:string):boolean;
var mobs:TNPCArray;
index:integer;
begin
index := 0;
mobs := SortNPCs(GetNPCs(name));
for index := 0 to high(mobs) do
begin
if mobs[index].fighting or mobs[index].moving then
continue;
result := InteractWithNPC('attack',mobs[index]);
if result then FinishFight(200);
fDebug('FightNPC','Finished fighting.');
break;
end;
end;
function IntToBinary(value:LongInt; digits:integer):string;
begin
result := StringOfChar ('0', digits) ;
while value > 0 do begin
if (value and 1) = 1 then
result [digits] := '1';
dec (digits) ;
value := value shr 1;
end;
end;
function IntToBool(value:integer):boolean;
begin
result := value <> 0;
end;
function BinaryToInt(Value: String): LongInt;
var i: Integer;
begin
Result:=0;
while Copy(Value,1,1)='0' do
Value:=Copy(Value,2,Length(Value)-1) ;
for i:=Length(Value) downto 1 do
if Copy(Value,i,1)='1' then
Result:=Result+(1 shl (Length(Value)-i)) ;
end;
// Credits to BobboHobbo for below procedure
procedure PrintOnSmart(TP: TStringArray; Placement: TPoint; Colour, Shadow: integer);
var
mx, my, Pic, I, B, H, TPH, Numb: Integer;
TTP: TPointArray;
Canvas: TCanvas;
begin
GetClientDimensions(mx,my);
Pic := BitmapFromString(mx,my,'');
TPH := High(TP);
for I := 0 to TPH do
begin
TTP := LoadTextTPA(TP[i], SmallChars, H);
for B := 0 to High(TTP) do
begin
Numb := ((I + 1) * 13);
FastSetPixel(Pic, TTP[b].x + 1, TTP[b].y + Numb + 1, Shadow);
FastSetPixel(Pic, TTP[b].x, TTP[b].y + Numb, Colour);
end;
end;
Canvas := TCANVAS.Create;
Canvas.Handle := SmartGetDebugDC;
DrawBitmap(Pic, Canvas, Placement.x, Placement.y);
FreeBitmap(Pic);
end;
procedure fInitialize(debug:boolean);
begin
scriptStart := GetSystemTime;
displayDebug := debug;
Smart_Members := CLIENT_MEMBERS;
Smart_Server := CLIENT_SERVER;
Smart_Signed := CLIENT_SIGNED;
Smart_SuperDetail := CLIENT_DETAIL;
fDebug('Initialization','Setting up SRL!');
fDebug('Initialization','Activating SMART Client!');
SetupSRL;
SetupReflection;
ActivateClient;
DeclarePlayers;
SmartSetDebug(true);
PrintOnSmart(['Feroc1ty'],Point(700, 0), 16743964, 5813189);
fDebug('Initialization','Initialization fully complete, took ' + IntToStr(GetSystemTime - scriptStart) + ' milliseconds!');
breaktime := (GetSystemTime + ((60+random(120))*60*1000));
fDebug('Initialization','Will take the next break in '+tostr((breaktime-GetSystemTime)/60/1000)+' minutes.');
end;—- the walking include —-
{ Feroc1ty's walking include...
Functions of the include:
fWalkPath(tpa:TTileArray);
}
procedure MoveToBox(box:TBox);
var tpt:TPoint;
ttl:TTile;
begin
repeat
ttl := Tile(RandomRange(box.x1, box.x2),RandomRange(box.y1, box.y2));
sleep(500+random(300));
until TileOnMM(ttl);
tpt := TileToMM(ttl);
Mouse(tpt.x, tpt.y, 3, 3, true);
R_FindRandoms;
FindNormalRandoms;
end;
procedure AssimilatePoint(var point:TPoint;target:TPoint;range:integer);
begin
repeat
if point.x > target.x then
begin
if (point.x - range) > target.x then
begin
point.x := point.x - range;
end else
begin
point.x := target.x;
end;
end else
begin
if point.x = target.x then break;
if (point.x + range) < target.x then
begin
point.x := point.x + range;
end else
begin
point.x := target.x;
end;
end;
until (true = true);
repeat
if point.y > target.y then
begin
if (point.y - range) > target.y then
begin
point.y := point.y - range;
end else
begin
point.y := target.y;
end;
end else
begin
if point.y = target.y then break;
if (point.y + range) < target.y then
begin
point.y := point.y + range;
end else
begin
point.y := target.y;
end;
end;
until (true=true);
end;
procedure fWalkPath(tpa:TPointArray;reverse:boolean);
var i,target:integer;
t:TPoint;
begin
fDebug('Feroc1ty Walk','Begining to walk a path in reverse('+tostr(reverse)+')');
if not reverse then
begin
for i := high(tpa) downto 0 do
begin
if TileOnMM(PointToTile(tpa[i])) then
break;
end;
if i = -1 then
begin
if DistanceTile(GetMyPos,tpa[0]) > DistanceTile(GetMyPos,tpa[high(tpa)]) then
target := high(tpa)
else
target := 0;
repeat
t := GetMyPos;
AssimilatePoint(t, tpa[target], 10);
WalkToTile(t, 4, 2);
until TileOnMM(PointToTile(tpa[target]));
i := target;
end;
for i := i to high(tpa) do
begin
MoveToBox(PtToBox(tpa[i],4));
end;
end else
begin
for i := 0 to high(tpa) do
begin
if TileOnMM(PointToTile(tpa[i])) then
break;
end;
if i = -1 then
begin
if DistanceTile(GetMyPos,tpa[0]) > DistanceTile(GetMyPos,tpa[high(tpa)]) then
target := high(tpa)
else
target := 0;
repeat
t := GetMyPos;
AssimilatePoint(t, tpa[target], 10);
WalkToTile(t, 4, 2);
until TileOnMM(PointToTile(tpa[target]));
i := target;
end;
for i := i downto 0 do
begin
MoveToBox(PtToBox(tpa[i],4));
end;
end;
R_FFlag(0);
end;