SCAR Code:
program TutIslandRunnerByPvH;
//{.include SRL/SRL/Misc/Smart.Scar}
{.Include SRL\SRL.SCAR}
var
FullBucket, Pot, tinderbox, logs, RawFish, ClickedFish, Arrow, dough: integer;
const
SmartWorld = 1;//What world to load smart in
Signed = True; //False = unsigned, slower and for multiplayer
//True = signed, faster and for 1 player only
Procedure DeclarePlayers;
begin
HowManyPlayers:= 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer:= 0;
Players[0].Name := '7129037451'; //UserName
Players[0].Pass := 'patrick'; //Password
Players[0].Nick := 'ser'; //Nickname
Players[0].Active := True; //Active
Cleardebug;
Writeln('You are using '+IntToStr(HowManyPlayers)+' Players');
end;
procedure TalkWithPerson;
var
Failsafe:integer;
begin
marktime(FailSafe);
repeat
wait(3000+random(2000));
if not ClickContinue(True,True) then break;
if TimeFromMark(Failsafe) > 100000 then break;
until(false)
end;
Procedure LoadDTM(Which: String);
begin
Case lowercase(Which) Of
'fullbucket':
begin
FullBucket := DTMFromString('78DA63146160601066400135B573182481342' +
'310FF0702465E20438C010D302291401AA4869F801A9019EC04D4' +
'28000921026AE480843C0135207F2913500372AF227E350086680' +
'71B');
end;
'pot':
begin
Pot := DTMFromString('78DA63E4636060106140014B0A6D183480342' +
'310FF0702461E20838D010D302291409A1548F01050C30C248409' +
'A801D92343400D07909025A006E41679026AC48930471A484813A' +
'1868F801A909F4409A81121229CF981042B013582404281801A76' +
'20C18E5F0D00325607A0');
end;
'tinderbox':
begin
Tinderbox := DTMFromString('78DA8D935B0EC2201045876262DAC648B1544' +
'4EBB70B7125EE7F0F7AF9EBC3E4DE4938C3C7094C98C15DCC6CB0' +
'557CDE277B213BAC2FC2456CBC6DC22D889C04E70A34C49945E74' +
'09C021C8993815638A723CE13E8859AA3705722CE0414E28CC083' +
'3851700270274E7D9B1B716A1F32716A3F27E2F8FDACFE75CE423' +
'DAC5FBD303FCABF087C567FECF30841');
end;
'logs':
begin
Logs := DTMFromString('78DA8DD24B0A80300C04D054F00BFE05BF884' +
'B0FE16D3C8847D7E94EDDCC043AD93C4843EB6A33EBEC53D779D8' +
'8EEE706E94F326B15FB957A2F78890985130B330CB9B829815511' +
'1B3215A61D620EC3E12E3E74CC4948885984C30B1709F00D10BA6' +
'21C6BF67494C84C8059311930A7F23E7E601D1C00831');
end;
'rawfish':
begin
RawFish := DTMFromString('78DA631462606010604001CD09DE0C1A409A1' +
'188FF0301A3309021CD800618914820CD05248409A801C9F31250' +
'230E24D808A8910512AC04D42803090E026A5481040F117689105' +
'0234644F880FC2D815F0D0007980722');
end;
'clickedFish':
begin
ClickedFish := DTMFromString('78DA8D91470E80300C049D23BD17D111BC913' +
'38FE0BFB0BE5124369632CE61146713138A48218F3AF64D727483' +
'75A24C8C4D2DAF3237A2BBDF733E8E03A4C4F1809038011011270' +
'132E268A69C3815501267047CE22C16B9168B37EC8196380D3011' +
'47E7CCC4D1FB0EC4D1DC9D45AE98382B901047737B16FF15FC3B1' +
'73ACC0952');
end;
'arrow':
begin
Arrow := DTMFromString('78DA6364666660D8CB80027E7DE767D000D28' +
'C40FC1F08181931D54064612490FEC7C4C0B08B809ABF40353B09' +
'A86100DAB58308351B09A8612352CD0E22D46C21A086930873B88' +
'850C30E54B39B801A16A09A7DF8D50000E69211FB');
end;
'dough':
begin
Dough := DTMFromString('78DA8D904B0A80300C4413FCA154C556A45D8' +
'857F6307A3E9DEED4859381BE74F1489BE824225E5E398F5D12AA' +
'E25C883A5C4AF9441F44CD3D0AE244A022CE0AB40627126706127' +
'14683E30C6F35C0429C3C77204EDE716FE8D319FE531367030683' +
'E3FF9D1B79800837');
end;
end;
end;
{procedure SetUpSmart;
begin
Status('Setting up SMART!');
Disguise('Setting up SMART!');
smartSetupex(SmartWorld, False, Signed);
While Not (SmartReady) Do
Wait(100);
SetTargetDC(SmartGetDC);
If Not (LoggedIn) Then
While Not (SmartGetColor(386, 249) = 65535) Do
Wait(100);
end; }
function FindUndergroundColor: Integer;
var
GC, a, l, TestColor, Red, Green, Blue: integer;
var
P:array of Tpoint;
begin
GC := 4221554;
Flag;
FindColorsSpiralTolerance(MMCX, MMCY, P, GC, MMX1, MMY1, MMX2, MMY2, 140);
l:=GetArrayLength(P);
for a:= 0 to l-1 do
begin
if rs_OnMinimap(P[a].x,P[a].y) then
begin
TestColor := GetColor(P[a].x,P[a].y);
if SimilarColors(TestColor,GC,140) then
begin
ColorToRGB(TestColor, Red, Green, Blue);
if InRange(Red - Green, 5, 33) then if Red <= 120 then
if InRange(Green - Blue, 17, 58) then
if InRange(Red - Blue, 30, 75) then if Blue <= 45 then
if GetColor(P[a].x + 5, P[a].y + 5) = TestColor then
if GetColor(P[a].x + 3, P[a].y + 3) = TestColor then
if GetColor(P[a].x, P[a].y + 5) = TestColor then
if GetColor(P[a].x + 5, P[a].y) = TestColor then
if GetColor(P[a].x, P[a].y + 3) = TestColor then
if GetColor(P[a].x + 3, P[a].y) = TestColor then
if GetColor(P[a].x + 5, P[a].y + 3) = TestColor then
if GetColor(P[a].x + 3, P[a].y + 5) = TestColor then
begin
Result := TestColor;
WriteLn('UnderGroundColor = ' + IntToStr(TestColor));
Exit;
end;
end;
end;
end;
WriteLn('Could not find UnderGroundColor!');
Result := 0;
end;
function FindBrownRoadColor: Integer;
var
GC, a, l, TestColor, Red, Green, Blue: integer;
var
P:array of Tpoint;
begin
GC := 4221554;
Flag;
FindColorsSpiralTolerance(MMCX, MMCY, P, GC, MMX1, MMY1, MMX2, MMY2, 140);
l:=GetArrayLength(P);
for a:= 0 to l-1 do
begin
if rs_OnMinimap(P[a].x,P[a].y) then
begin
TestColor := GetColor(P[a].x,P[a].y);
if SimilarColors(TestColor,GC,140) then
begin
ColorToRGB(TestColor, Red, Green, Blue);
if InRange(Red - Green, 5, 33) then if Red <= 160 then
if InRange(Green - Blue, 17, 58) then
if InRange(Red - Blue, 30, 75) then if Blue <= 85 then
if GetColor(P[a].x + 1, P[a].y + 1) = TestColor then
if GetColor(P[a].x + 2, P[a].y + 2) = TestColor then
if GetColor(P[a].x, P[a].y + 3) = TestColor then
if GetColor(P[a].x, P[a].y + 2) = TestColor then
if GetColor(P[a].x+1, P[a].y + 2) = TestColor then
if GetColor(P[a].x+2, P[a].y) = TestColor then
if GetColor(P[a].x + 1, P[a].y) = TestColor then
if GetColor(P[a].x+2, P[a].y + 1) = TestColor then
begin
Result := TestColor;
WriteLn('BrownRoadColor = ' + IntToStr(TestColor));
Exit;
end;
end;
end;
end;
WriteLn('Could not find BrownRoadColor!');
Result := 0;
end;
function FishTheFish: boolean;
var
FishingTPA: T2DPointArray;
FishingPoint: TPointArray;
Tries, FishingTime, I, cts ,x ,y,sx,sy: integer;
begin
LoadDTM('RawFishDTM');
SymbolAccuracy := 0.7;
if FindSymbol(sx,sy,'Fish') then
begin
mouse(sx,sy-3,3,3,true);
fflag(0);
wait(700+random(1000));
end;
repeat
if(FindDTM(RawFish, x, y, MIX1, MIY1, MIX2, MIY2)) then break;
cts := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
FindColorsTolerance(FishingPoint, 12959676 , msx1, msy1, msx2, msy2, 10);
FishingTPA := TPAtoATPAEx(FishingPoint, 50, 50);
SortATPAFromFirstPoint(FishingTPA, Point(MSCX, MSCY));
For I:= 0 to High(FishingTPA) do
begin
if(FindDTM(RawFish, x, y, MIX1, MIY1, MIX2, MIY2)) then break;
MiddleTPAEx(FishingTPA[i], x, y);
MMouse(x, y, 3, 3);
Wait(150 + Random(70));
Tries:=Tries+1;
if isuptext('ishing')then
begin
Tries:=Tries-Tries;
GetMousePos(x,y);
mouse(x,y,0,0,true);
fflag(0);
marktime(FishingTime);
repeat
wait(700+random(1000));
if(FindDTM(RawFish, x, y, MIX1, MIY1, MIX2, MIY2)) then break;
until(timefrommark(FishingTime) > (20000+random(3000)));
end else
begin
mmouse(392, 268, 30, 30);
Status('Failed to find fishing spot');
end;
end;
if(FindDTM(RawFish, x, y, MIX1, MIY1, MIX2, MIY2)) then
begin
result := true;
break;
exit;
end;
until(result or (Tries > 10));
if not result then
begin
writeln('We couldn''t fish a fish.. logging out!');
logout;
Players[CurrentPlayer].Active := False;
freedtm(RawFish);
exit;
end;
freedtm(RawFish);
end;
function CreateFire: boolean;
var
FireTime, x ,y: integer;
begin
if not LoggedIn then exit;
LoadDTM('Tinderbox');
if(FindDTM(Tinderbox, x, y, MIX1, MIY1, MIX2, MIY2)) then
begin
Status('Creating a fire!');
wait(200+random(250));
mouse(x, y, 3, 3, true);
wait(300+random(1000));
freeDTM(Tinderbox);
end else
begin
writeln('We couldn''t find the tinderbox, logging out!');
logout;
Players[CurrentPlayer].Active := False;
freeDTM(Tinderbox);
exit;
end;
LoadDTM('Logs');
if(FindDTM(Logs, x, y, MIX1, MIY1, MIX2, MIY2)) then
begin
wait(400+random(550));
mouse(x, y, 3, 3, true);
wait(1000+random(1000));
end else
begin
writeln('We couldn''t find the logs, logging out!');
logout;
Players[CurrentPlayer].Active := False;
end;
marktime(FireTime);
repeat
wait(1000+random(1000));
if (timefrommark(FireTime) > (20000+random(5000))) and (FindDTM(Logs, x, y, MIX1, MIY1, MIX2, MIY2)) then
begin
mouse(192, 297, 30, 30, true);
fflag(0);
CreateFire;
end;
if not(FindDTM(Logs,x,y,MIX1, MIY1, MIX2, MIY2)) then
begin
wait(2000+random(1000));
Result := True;
end;
if not(FindDTM(Logs, x, y, MIX1, MIY1, MIX2, MIY2)) then break;
until((result) or(timefrommark(FireTime) > (75000+random(10000))));
if not LoggedIn then exit;
if not result then
begin
writeln('We couldn''t create a fire.. logging out!');
freedtm(Logs);
logout;
Players[CurrentPlayer].Active := False;
exit;
end;
freedtm(Logs);
end;
function CookTheFish: boolean;
var
FireTPA: T2DPointArray;
FirePoint: TPointArray;
Tries, FireTime, I, cts ,x ,y: integer;
begin
LoadDTM('RawFish');
LoadDTM('ClickedFish');
repeat
if not(FindDTM(RawFish, x, y, MIX1, MIY1, MIX2, MIY2)) then break;
if(FindDTM(RawFish, x, y, MIX1, MIY1, MIX2, MIY2)) then
begin
wait(300+random(500));
mouse(x,y,3,3,true);
end;
cts := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
FindColorsTolerance(FirePoint, 2604022 , msx1, msy1, msx2, msy2, 10);
FireTPA := TPAtoATPAEx(FirePoint, 50, 50);
SortATPAFromFirstPoint(FireTPA, Point(MSCX, MSCY));
For I:= 0 to High(FireTPA) do
begin
if not(FindDTM(ClickedFish, x, y, MIX1, MIY1, MIX2, MIY2)) then break;
MiddleTPAEx(FireTPA[i], x, y);
MMouse(x, y, 3, 3);
Wait(150 + Random(70));
Tries:=Tries+1;
if isuptext('ire')then
begin
Tries:=Tries-Tries;
GetMousePos(x,y);
mouse(x,y,0,0,true);
fflag(0);
marktime(FireTime);
repeat
wait(700+random(1000));
if not(FindDTM(RawFish, x, y, MIX1, MIY1, MIX2, MIY2)) then break;
until(timefrommark(FireTime) > (80000+random(20000)));
end else
begin
mmouse(392, 268, 30, 30);
Status('Failed to find the fire');
end;
end;
if not(FindDTM(RawFish, x, y, MIX1, MIY1, MIX2, MIY2)) then
begin
freedtm(RawFish);
freedtm(ClickedFish);
result := true;
break;
exit;
end;
until(result or (Tries > 10));
freedtm(RawFish);
freedtm(ClickedFish);
if not result then
begin
writeln('We couldn''t cook the fish.. logging out!');
logout;
Players[CurrentPlayer].Active := False;
exit;
end;
end;
function FindRuneScapeGuide: boolean;
var
GuideTPA: T2DPointArray;
GuidePoint: TPointArray;
Tries, I, cts ,x ,y: integer;
begin
if not LoggedIn then exit;
repeat
cts := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
FindColorsTolerance(GuidePoint, 923499 , msx1, msy1, msx2, msy2, 10);
GuideTPA := TPAtoATPAEx(GuidePoint, 50, 50);
SortATPAFromFirstPoint(GuideTPA, Point(MSCX, MSCY));
For I:= 0 to High(GuideTPA) do
begin
MiddleTPAEx(GuideTPA[i], x, y);
MMouse(x, y, 3, 3);
Wait(150 + Random(70));
Tries:=Tries+1;
if isuptext('uide')then
begin
Tries:=Tries-Tries;
GetMousePos(x,y);
Mouse(x,y,0,0,true);
ColorToleranceSpeed(cts);
fflag(0);
wait(500+random(1000));
TalkWithPerson;
Mouse(668, 476, 7, 7, true);
wait(400+random(800));
SetBar('brightness',4);
wait(600+random(1000));
repeat
cts := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
FindColorsTolerance(GuidePoint, 923499 , msx1, msy1, msx2, msy2, 10);
GuideTPA := TPAtoATPAEx(GuidePoint, 50, 50);
SortATPAFromFirstPoint(GuideTPA, Point(MSCX, MSCY));
For I:= 0 to High(GuideTPA) do
begin
MiddleTPAEx(GuideTPA[i], x, y);
MMouse(x, y, 3, 3);
Wait(150 + Random(70));
Tries:=Tries+1;
if isuptext('uide')then
begin
Tries:=Tries-Tries;
GetMousePos(x,y);
Mouse(x,y,0,0,true);
ColorToleranceSpeed(cts);
fflag(0);
wait(800+random(1000));
TalkWithPerson;
Result := True;
exit;
end else
begin
mmouse(392, 268, 30, 30);
Status('Failed to find the guide');
end;
end;
until(Tries > 10);
end else
begin
mmouse(392, 268, 30, 30);
Status('Failed to find the guide');
end;
end;
until(result or (Tries > 10));
if not result then
begin
writeln('We couldn''t solve the first guide.. logging out!');
logout;
Players[CurrentPlayer].Active := False;
exit;
end;
end;
function WalkToFirstDoor: boolean;
var
Door1TPA: T2DPointArray;
Door1Point: TPointArray;
Tries, I, cts ,x ,y: integer;
begin
if not LoggedIn then exit;
LoadDTM('Arrow');
if DTMRotated(Arrow, x, y, MMX1, MMY1, MMX2, MMY2) then
begin
Status('Walking to first door');
wait(200+random(250));
mouse(x-3, y, 3, 3, true);
FFlag(0);
wait(300+random(1000));
freeDTM(Arrow);
MakeCompass('E');
end else
begin
writeln('We couldn''t find the first door, logging out!');
logout;
Players[CurrentPlayer].Active := False;
freeDTM(Arrow);
exit;
end;
repeat
cts := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
FindColorsTolerance(Door1Point, 2055030 , msx1, msy1, msx2, msy2, 10);
Door1TPA := TPAtoATPAEx(Door1Point, 50, 50);
SortATPAFromFirstPoint(Door1TPA, Point(MSCX, MSCY));
For I:= 0 to High(Door1TPA) do
begin
MiddleTPAEx(Door1TPA[i], x, y);
MMouse(x, y, 3, 3);
Wait(150 + Random(70));
Tries:=Tries+1;
if isuptext('oor')then
begin
Tries:=Tries-Tries;
GetMousePos(x,y);
Mouse(x,y,0,0,true);
ColorToleranceSpeed(cts);
wait(1000+random(1000));
MakeCompass('N');
setangle(true);
wait(800+random(1000));
result := True;
exit;
end else
begin
mmouse(392, 268, 30, 30);
Status('Failed to find the door');
end;
end;
until(result or (Tries > 10));
if not result then
begin
writeln('We couldn''t get trough the first door.. logging out!');
logout;
Players[CurrentPlayer].Active := False;
exit;
end;
end;
function WalkToSurvival: boolean;
var
SurvivalTPA, TreeTPA: T2DPointArray;
SurvivalPoint, TreePoint: TPointArray;
ChoppingTime, Tries, I, cts ,x ,y, sx,sy: integer;
begin
if not LoggedIn then exit;
LoadDTM('Arrow');
if DTMRotated(Arrow, x, y, MMX1, MMY1, MMX2, MMY2) then
begin
Status('Walking to survival guide');
wait(200+random(250));
mouse(x, y-6, 3, 3, true);
FFlag(0);
wait(300+random(1000));
freeDTM(Arrow);
end else
begin
writeln('We couldn''t find the survival guide, logging out!');
logout;
Players[CurrentPlayer].Active := False;
freeDTM(Arrow);
exit;
end;
repeat
cts := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
FindColorsTolerance(SurvivalPoint, 5922461 , msx1, msy1, msx2, msy2, 10);
SurvivalTPA := TPAtoATPAEx(SurvivalPoint, 50, 50);
SortATPAFromFirstPoint(SurvivalTPA, Point(MSCX, MSCY));
For I:= 0 to High(SurvivalTPA) do
begin
MiddleTPAEx(SurvivalTPA[i], x, y);
MMouse(x, y, 3, 3);
Wait(150 + Random(70));
Tries:=Tries+1;
if isuptext('xpert')then
begin
Tries:=Tries-Tries;
GetMousePos(x,y);
Mouse(x,y,0,0,true);
ColorToleranceSpeed(cts);
fflag(0);
wait(300+random(1000));
TalkWithPerson;
wait(500+random(1000));
Mouse(632, 172, 7, 7, true);
wait(300+random(2000));
LoadDTM('Logs');
repeat
if(FindDTM(Logs, x, y, MIX1, MIY1, MIX2, MIY2)) then break;
cts := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
FindColorsTolerance(TREEPoint, 4549478 , msx1, msy1, msx2, msy2, 10);
TREETPA := TPAtoATPAEx(TREEPoint, 50, 50);
SortATPAFromFirstPoint(TREETPA, Point(MSCX, MSCY));
For I:= 0 to High(TREETPA) do
begin
if(FindDTM(Logs, x, y, MIX1, MIY1, MIX2, MIY2)) then break;
MiddleTPAEx(TREETPA[i], x, y);
MMouse(x, y, 3, 3);
Wait(150 + Random(70));
Tries:=Tries+1;
if isuptext('ree')then
begin
Tries:=Tries-Tries;
GetMousePos(x,y);
Mouse(x,y,0,0,true);
fflag(0);
marktime(ChoppingTime);
repeat
wait(700+random(1000));
if(FindDTM(Logs, x, y, MIX1, MIY1, MIX2, MIY2)) then break;
until(timefrommark(ChoppingTime) > (20000+random(3000)));
end else
begin
mmouse(392, 268, 30, 30);
Status('Failed to find the tree');
end;
end;
until(Tries > 10);
freedtm(Logs);
wait(300+random(1000));
TalkWithPerson;
CreateFire;
wait(800+random(1000));
mouse(570, 179,7,7,true);
wait(400+random(1000));
if FindSymbol(sx,sy,'Fish') then
begin
mouse(sx+2,sy-10,5,5,true);
fflag(0);
wait(700+random(1000));
end;
repeat
cts := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
FindColorsTolerance(SurvivalPoint, 5922461 , msx1, msy1, msx2, msy2, 10);
SurvivalTPA := TPAtoATPAEx(SurvivalPoint, 50, 50);
SortATPAFromFirstPoint(SurvivalTPA, Point(MSCX, MSCY));
For I:= 0 to High(SurvivalTPA) do
begin
MiddleTPAEx(SurvivalTPA[i], x, y);
MMouse(x, y, 3, 3);
Wait(150 + Random(70));
Tries:=Tries+1;
if isuptext('xpert')then
begin
Tries:=Tries-Tries;
GetMousePos(x,y);
Mouse(x,y,0,0,true);
ColorToleranceSpeed(cts);
fflag(0);
wait(300+random(1000));
TalkWithPerson;
wait(300+random(1000));
Gametab(4);
FishTheFish;
CookTheFish;
FishTheFish;
CookTheFish;
result := True;
exit;
end else
begin
mmouse(392, 268, 30, 30);
Status('Failed to find the survival expert');
end;
end;
until(result or (Tries > 10));
end else
begin
mmouse(392, 268, 30, 30);
Status('Failed to find the survival expert');
end;
end;
until(result or (Tries > 10));
if not result then
begin
writeln('We couldn''t get trough the survival guide.. logging out!');
logout;
Players[CurrentPlayer].Active := False;
exit;
end;
end;
function GoToFirstGate: boolean;
var
GateTPA: T2DPointArray;
GatePoint: TPointArray;
Tries, I, cts ,x ,y: integer;
begin
if not LoggedIn then exit;
LoadDTM('Arrow');
wait(1000+random(1000));
if DTMRotated(Arrow, x, y, MMX1, MMY1, MMX2, MMY2) then
begin
Status('Walking to gate');
wait(200+random(250));
mouse(x+7, y, 3, 3, true);
FFlag(0);
wait(300+random(1000));
freeDTM(Arrow);
end else
begin
writeln('We couldn''t find the gate, logging out!');
logout;
Players[CurrentPlayer].Active := False;
freeDTM(Arrow);
exit;
end;
MakeCompass('W');
wait(400+random(500));
repeat
cts := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
FindColorsTolerance(GatePoint, 267808 , msx1, msy1, msx2, msy2, 10);
GateTPA := TPAtoATPAEx(GatePoint, 50, 50);
SortATPAFromFirstPoint(GateTPA, Point(MSCX, MSCY));
For I:= 0 to High(GateTPA) do
begin
MiddleTPAEx(GateTPA[i], x, y);
MMouse(x, y, 3, 3);
Wait(150 + Random(70));
Tries:=Tries+1;
if isuptext('ate')then
begin
Tries:=Tries-Tries;
GetMousePos(x,y);
mouse(x,y,0,0,true);
fflag(0);
wait(700+random(1000));
result := true;
break;
exit;
end else
begin
mmouse(392, 268, 30, 30);
Status('Failed to find the gate');
end;
end;
until(result or (tries >10));
if not result then
begin
writeln('We couldn''t get trough the gate.. logging out!');
logout;
Players[CurrentPlayer].Active := False;
exit;
end;
end;
function CookingGuide: boolean;
var
DoorTPA, MasterTPA, RangeTPA, Door2TPA: T2DPointArray;
DoorPoint, MasterPoint, RangePoint, Door2Point: TPointArray;
Tries, I, cts ,x ,y: integer;
begin
if not LoggedIn then exit;
LoadDTM('Arrow');
wait(500+random(1000));
if DTMRotated(Arrow, x, y, MMX1, MMY1, MMX2, MMY2) then
begin
Status('Walking to cooking guide');
wait(200+random(250));
mouse(x, y-5, 3, 3, true);
FFlag(0);
wait(500+random(1000));
freeDTM(Arrow);
end else
begin
writeln('We couldn''t find the cooking guide, logging out!');
logout;
Players[CurrentPlayer].Active := False;
freeDTM(Arrow);
exit;
end;
repeat
cts := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
FindColorsTolerance(DoorPoint, 1789798 , msx1, msy1, msx2, msy2, 10);
DoorTPA := TPAtoATPAEx(DoorPoint, 50, 50);
SortATPAFromFirstPoint(DoorTPA, Point(MSCX, MSCY));
For I:= 0 to High(DoorTPA) do
begin
MiddleTPAEx(DoorTPA[i], x, y);
MMouse(x, y, 3, 3);
Wait(150 + Random(70));
Tries:=Tries+1;
if isuptext('oor')then
begin
Tries:=Tries-Tries;
GetMousePos(x,y);
mouse(x,y,0,0,true);
fflag(0);
wait(2500+random(2000));
repeat
cts := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
FindColorsTolerance(MasterPoint, 6986089, msx1, msy1, msx2, msy2, 10);
MasterTPA := TPAtoATPAEx(MasterPoint, 50, 50);
SortATPAFromFirstPoint(MasterTPA, Point(MSCX, MSCY));
For I:= 0 to High(MasterTPA) do
begin
MiddleTPAEx(MasterTPA[i], x, y);
MMouse(x, y, 3, 3);
Wait(150 + Random(70));
Tries:=Tries+1;
if isuptext('aster')then
begin
Tries:=Tries-Tries;
GetMousePos(x,y);
mouse(x,y,0,0,true);
fflag(0);
wait(700+random(1000));
TalkWithPerson;
MakeCompass('N');
LoadDTM('Pot');
if(FindDTM(Pot, x, y, MIX1, MIY1, MIX2, MIY2)) then
begin
wait(200+random(250));
mouse(x, y, 3, 3, true);
wait(300+random(1000));
freeDTM(Pot);
end else
begin
writeln('We couldn''t find the pot, logging out!');
logout;
Players[CurrentPlayer].Active := False;
freeDTM(Pot);
exit;
end;
LoadDTM('FullBucket');
if(FindDTM(FullBucket, x, y, MIX1, MIY1, MIX2, MIY2)) then
begin
wait(400+random(550));
mouse(x, y, 3, 3, true);
wait(1000+random(1000));
freeDTM(FullBucket);
LoadDTM('Arrow');
wait(1000+random(1000));
if DTMRotated(Arrow, x, y, MMX1, MMY1, MMX2, MMY2) then
begin
Status('Walking to range');
wait(200+random(250));
mouse(x, y-4, 3, 3, true);
FFlag(0);
wait(300+random(1000));
freeDTM(Arrow);
LoadDTM('Dough');
if(FindDTM(Dough, x, y, MIX1, MIY1, MIX2, MIY2)) then
begin
wait(400+random(550));
mouse(x, y, 3, 3, true);
wait(1000+random(1000));
freedtm(Dough);
repeat
cts := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
FindColorsTolerance(RangePoint, 2041462, msx1, msy1, msx2, msy2, 10);
RangeTPA := TPAtoATPAEx(RangePoint, 50, 50);
SortATPAFromFirstPoint(RangeTPA, Point(MSCX, MSCY));
For I:= 0 to High(RangeTPA) do
begin
MiddleTPAEx(RangeTPA[i], x, y);
MMouse(x, y, 3, 3);
Wait(150 + Random(70));
Tries:=Tries+1;
if isuptext('ange')then
begin
Tries:=Tries-Tries;
GetMousePos(x,y);
mouse(x,y,0,0,true);
fflag(0);
wait(700+random(1000));
wait(5000+random(3000));
mouse(740, 471,8,8,true);
wait(1000+random(2000));
LoadDTM('Arrow');
wait(500+random(1000));
if DTMRotated(Arrow, x, y, MMX1, MMY1, MMX2, MMY2) then
begin
Status('Walking to second door');
wait(200+random(250));
mouse(x+3, y, 3, 3, true);
FFlag(0);
wait(500+random(1000));
freeDTM(Arrow);
MakeCompass('W');
repeat
cts := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
FindColorsTolerance(Door2Point, 1789798 , msx1, msy1, msx2, msy2, 10);
Door2TPA := TPAtoATPAEx(Door2Point, 50, 50);
SortATPAFromFirstPoint(Door2TPA, Point(MSCX, MSCY));
For I:= 0 to High(Door2TPA) do
begin
MiddleTPAEx(Door2TPA[i], x, y);
MMouse(x, y, 3, 3);
Wait(150 + Random(70));
Tries:=Tries+1;
if isuptext('oor')then
begin
Tries:=Tries-Tries;
GetMousePos(x,y);
mouse(x,y,0,0,true);
fflag(0);
wait(1000+random(1000));
mouse(703, 481,7,7,true);
wait(1000+random(2000));
DoEmote(1 + Random(16));
wait(2000+random(1000));
Mouse(668, 476, 7, 7, true);
Wait(2500+Random(1500));
SetRun(True);
MakeCompass('N');
Result:=True;
break;
break;
break;
break;
break;
break;
break;
break;
exit;
end else
begin
mmouse(392, 268, 30, 30);
Status('Failed to find the door');
end;
end;
until(result or (tries >10));
end else
begin
writeln('We couldn''t find the second door, logging out!');
logout;
Players[CurrentPlayer].Active := False;
freeDTM(Arrow);
exit;
end;
end else
begin
mmouse(392, 268, 30, 30);
Status('Failed to find the range');
end;
end;
until(result or (tries >10));
end else
begin
writeln('We couldn''t find the dough, logging out!');
logout;
Players[CurrentPlayer].Active := False;
freeDTM(Dough);
end;
end else
begin
writeln('We couldn''t find the range, logging out!');
logout;
Players[CurrentPlayer].Active := False;
freeDTM(Arrow);
exit;
end;
end else
begin
writeln('We couldn''t find the bucket, logging out!');
logout;
Players[CurrentPlayer].Active := False;
freeDTM(FullBucket);
exit;
end;
end else
begin
mmouse(392, 268, 30, 30);
Status('Failed to find the chef');
end;
end;
until(result or (tries >10));
end else
begin
mmouse(392, 268, 30, 30);
Status('Failed to find the chef');
end;
end;
until(result or (tries >10));
if not result then
begin
writeln('We couldn''t get trough the master chef.. logging out!');
logout;
Players[CurrentPlayer].Active := False;
exit;
end;
end;
function QuestGuide: boolean;
var
QuestGuideTPA, Door3TPA, LadderTPA: T2DPointArray;
QuestGuidePoint, Door3Point, LadderPoint: TPointArray;
Tries, I, cts ,x ,y: integer;
begin
if(not(LoggedIn))then Exit;
radialWalk(FindBrownRoadColor,350,380,62,2,2);
fflag(0);
wait(600+random(500));
radialWalk(FindBrownRoadColor,356,390,62,2,2);
fflag(0);
wait(600+random(500));
LoadDTM('Arrow');
if not DTMRotated(Arrow, x, y, MMX1, MMY1, MMX2, MMY2) then
begin
Mouse(640, 55, 10, 10, True);
fflag(0);
wait(1000+random(2000));
end;
if DTMRotated(Arrow, x, y, MMX1, MMY1, MMX2, MMY2) then
begin
Status('Walking to quest guide');
wait(200+random(250));
mouse(x, y-3, 3, 3, true);
FFlag(0);
wait(300+random(1000));
repeat
cts := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
FindColorsTolerance(Door3Point, 2453134, msx1, msy1, msx2, msy2, 10);
Door3TPA := TPAtoATPAEx(Door3Point, 50, 50);
SortATPAFromFirstPoint(Door3TPA, Point(MSCX, MSCY));
For I:= 0 to High(Door3TPA) do
begin
MiddleTPAEx(Door3TPA[i], x, y);
MMouse(x, y, 3, 3);
Wait(150 + Random(70));
Tries:=Tries+1;
if isuptext('oor')then
begin
Tries:=Tries-Tries;
GetMousePos(x,y);
mouse(x,y,0,0,true);
fflag(0);
wait(2500+random(2000));
repeat
cts := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
FindColorsTolerance(QuestGuidePoint, 4353320 , msx1, msy1, msx2, msy2, 10);
QuestGuideTPA := TPAtoATPAEx(QuestGuidePoint, 50, 50);
SortATPAFromFirstPoint(QuestGuideTPA, Point(MSCX, MSCY));
For I:= 0 to High(QuestGuideTPA) do
begin
MiddleTPAEx(QuestGuideTPA[i], x, y);
MMouse(x, y, 3, 3);
Wait(150 + Random(70));
Tries:=Tries+1;
if isuptext('uest')then
begin
Tries:=Tries-Tries;
GetMousePos(x,y);
mouse(x,y,0,0,true);
fflag(0);
wait(700+random(1000));
TalkWithPerson;
wait(300+random(600));
mouse(604, 174,8,8,true);
wait(1000+random(1000));
repeat
cts := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
FindColorsTolerance(QuestGuidePoint, 4353320 , msx1, msy1, msx2, msy2, 10);
QuestGuideTPA := TPAtoATPAEx(QuestGuidePoint, 50, 50);
SortATPAFromFirstPoint(QuestGuideTPA, Point(MSCX, MSCY));
For I:= 0 to High(QuestGuideTPA) do
begin
MiddleTPAEx(QuestGuideTPA[i], x, y);
MMouse(x, y, 3, 3);
Wait(150 + Random(70));
Tries:=Tries+1;
if isuptext('uest')then
begin
Tries:=Tries-Tries;
GetMousePos(x,y);
mouse(x,y,0,0,true);
fflag(0);
wait(700+random(1000));
TalkWithPerson;
wait(700+random(600));
if DTMRotated(Arrow, x, y, MMX1, MMY1, MMX2, MMY2) then
begin
Status('Walking to ladder');
wait(200+random(250));
mouse(x, y-3, 3, 3, true);
FFlag(0);
wait(300+random(1000));
freedtm(Arrow);
MakeCompass('S');
repeat
cts := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
FindColorsTolerance(LadderPoint, 3884361, msx1, msy1, msx2, msy2, 10);
LadderTPA := TPAtoATPAEx(LadderPoint, 50, 50);
SortATPAFromFirstPoint(LadderTPA, Point(MSCX, MSCY));
For I:= 0 to High(LadderTPA) do
begin
MiddleTPAEx(LadderTPA[i], x, y);
MMouse(x, y, 3, 3);
Wait(150 + Random(70));
Tries:=Tries+1;
if isuptext('adder')then
begin
Tries:=Tries-Tries;
GetMousePos(x,y);
mouse(x,y,0,0,true);
fflag(0);
wait(2500+random(2000));
result := true;
break;
break;
break;
break;
break;
break;
break;
break;
exit;
end else
begin
mmouse(392, 268, 30, 30);
Status('Failed to find the ladder');
end;
end;
until(result or (Tries > 10));
end else
begin
writeln('We couldn''t find the ladder, logging out!');
logout;
Players[CurrentPlayer].Active := False;
freeDTM(Arrow);
exit;
end;
end else
begin
mmouse(392, 268, 30, 30);
Status('Failed to find the quest guide');
end;
end;
until(result or (Tries > 10));
end else
begin
mmouse(392, 268, 30, 30);
Status('Failed to find the quest guide');
end;
end;
until(result or (Tries > 10));
end else
begin
mmouse(392, 268, 30, 30);
Status('Failed to find the door');
end;
end;
until(result or (Tries > 10));
end else
begin
writeln('We couldn''t find the quest guide, logging out!');
logout;
Players[CurrentPlayer].Active := False;
freedtm(Arrow);
exit;
end;
end;
function MiningGuide: boolean;
var
MiningGuideTPA: T2DPointArray;
MiningGuidePoint: TPointArray;
Tries, I, cts ,x ,y: integer;
begin
if not LoggedIn then exit;
radialWalk(FindUndergroundColor,370,390,62,2,2);
fflag(0);
wait(1000+random(1000));
LoadDTM('Arrow');
if DTMRotated(Arrow, x, y, MMX1, MMY1, MMX2, MMY2) then
begin
Status('Walking to mining guide');
wait(200+random(250));
mouse(x-3, y+2, 3, 3, true);
FFlag(0);
wait(300+random(1000));
freeDTM(Arrow);
MakeCompass('E');
end else
begin
writeln('We couldn''t find the mining guide, logging out!');
logout;
Players[CurrentPlayer].Active := False;
freeDTM(Arrow);
exit;
end;
repeat
cts := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
FindColorsTolerance(MiningGuidePoint, 8535422, msx1, msy1, msx2, msy2, 10);
MiningGuideTPA := TPAtoATPAEx(MiningGuidePoint, 50, 50);
SortATPAFromFirstPoint(MiningGuideTPA, Point(MSCX, MSCY));
For I:= 0 to High(MiningGuideTPA) do
begin
MiddleTPAEx(MiningGuideTPA[i], x, y);
MMouse(x, y, 3, 3);
Wait(150 + Random(70));
Tries:=Tries+1;
if isuptext('nstructor')then
begin
Tries:=Tries-Tries;
GetMousePos(x,y);
mouse(x,y,0,0,true);
fflag(0);
wait(700+random(1000));
TalkWithPerson;
Result := True;
exit;
end else
begin
mmouse(392, 268, 30, 30);
Status('Failed to find the mining instructor');
end;
end;
until(result or (Tries > 10));
end;
begin
SetupSRL;
DeclarePlayers;
//SetUpSmart;
loginplayer;
Activateclient;
MakeCompass('N');
wait(400+random(500));
FindRuneScapeGuide;
WalkToFirstDoor;
WalkToSurvival;
GoToFirstGate;
CookingGuide;
QuestGuide;
MiningGuide;
end.