ZephyrsFury
2009-02-09 05:47:08
… for his latest script: Saturn's Tutorial Island Runner!
http://www.villavu.com/forum/showthread.php?t=33972
Also posted below for easy reference.
2.5k lines of nice coding with good use of SRL. It also runs extremely well, one of the most efficient colour based scripts I've seen/used. He definately deserves more than a normal scripter's cup.
http://www.villavu.com/forum/showthread.php?t=33972
Also posted below for easy reference.
2.5k lines of nice coding with good use of SRL. It also runs extremely well, one of the most efficient colour based scripts I've seen/used. He definately deserves more than a normal scripter's cup.
program TutIsland;
{.include SRL/SRL/misc/smart.scar}
{.include SRL/SRL.scar}
{.include doorprofiles.scar}
const
StatsID = '';
StatsPass = '';
Retry = True; //Retry if player failed?
FullDebug = True;
procedure DeclarePlayers;
begin
HowManyPlayers := 3;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := '';
Players[0].Pass := '';
Players[0].Active := True;
Players[1].Name := '';
Players[1].Pass := '';
Players[1].Active := True;
Players[2].Name := '';
Players[2].Pass := '';
Players[2].Active := True;
end;
var
Shrimp, Arrows: integer;
m: array[0..5] of integer;
w: array[0..0] of integer;
t: integer;
//-----------------------------------------------------------------//
//-- » Low-level script routines « --//
//-----------------------------------------------------------------//
procedure Bitmaps;
begin
Shrimp := BitmapFromString(5, 6, 'beNpjYGRgQEEntq6' +
'+urDl2uI2IJpbFNGXHjAhM3BydnBxsKO/pU5bok9LvFdjrGeWr02w' +
'jV5ZqBNQPNffNsHNLMzOAMUoAMXOGRE=');
end;
procedure Masks(a: TIntegerArray);
var
i: integer;
begin
for i := 0 to 5 do
if InIntArray(a, i) then
case i of
0: m[i] := BitmapFromString(28, 18, 'beNpjYKAz+P//PxVV/gcDIk2jrtXDQ+V/JIBLBH+Qoql'+
{ck h, npcchars} 'ENger7fiNJWgUkbJkm0lkOiHeyxS6E6ur0OKLeDOJTzCjYFgBANg2p1k=');
1: m[i] := BitmapFromString(15, 16, 'beNpjYKAp+A8Gg0oxQY14FPxHAvhNxmrIIFeM1YNDDAA'+
{lic, upchars} 'AS4KPcQ==');
2: m[i] := BitmapFromString(20, 16, 'beNpjYBhm4D8YDFq9/5EAHkFcIvjZaHqx'+
{etr, upchars} 'uo0YvbgcjMtM4kVIUonfajy+GEEAAPNTs00=');
3: m[i] := BitmapFromString(22, 16, 'beNpjYBix4D8YDDYTkEXQZP+jAkxB/Cbg'+
{ust, upchars} 'ci3ZbiDPBCLVUG4CftdiiiNLMYwCCAAAmPfCPg==');
4: m[i] := BitmapFromString(23, 18, 'beNpjYBgFgx/8hwFMETRxPOrRGJhcYtTD'+
{ana, npcchars} 'DSfGEPzqiTcEUz2y8wh6AZd65FDCDFvi1Y+CwQgAHPmSbg==');
5: m[i] := BitmapFromString(23, 16, 'beNpjYBgS4D8YjFhD/iMBTEOwiuNSjJVN'+
{ake, upchars} 'pGI09ZiG4PIj8WxirCPGQDxewBWwJLmQ8jQwPAEArlTyDg==');
end;
end;
procedure DTMs;
begin
w[0] := DTMFromString('78DA637CCCC8C0A0C98006189148207D0BC89' +
'227A0E61D916A8C89B08B801A0030E20555');
Arrows := DTMFromString('78DA639CCEC4C0C0C1C8800C22CDB919FE036' +
'990E87F20609C0B54F38B010D302291407A1E500D37237E355D40' +
'354204D44C05AAF98DDF2E0041970ABD');
end;
procedure Free;
begin
try
FreeBitmap(Shrimp);
FreeDTM(w[0]);
FreeDTM(Arrows);
except Exit; end;
end;
procedure FreeMasks;
var
i: integer;
begin
try
for i := 0 to 5 do
FreeBitmap(m[i]);
except end;
end;
function GetTime(msec: integer): string;
var
h, m, s: integer;
begin
h := msec div (1000*60*60);
m := (msec mod (1000*60*60)) div (1000*60);
s := ((msec mod (1000*60*60)) mod (1000*60)) div 1000;
Result := '['+Padz(inttostr(h), 2)+':'+Padz(inttostr(m), 2)+':'+Padz(inttostr(s), 2)+']';
end;
procedure Debug(Proc: string);
begin
if FullDebug then
Writeln(GetTime(GetTimeRunning)+' - '+Proc);
end;
procedure ScriptTerminate;
begin
Free;
end;
function toStrArray(strArray: string) : Array of String;
var
i, spacePos: Integer;
begin
repeat
SetArrayLength(Result, i + 1);
spacePos := Pos(' ', strArray);
if (not (spacePos = 0)) then
Result[i] := (Copy(strArray, 1, spacePos - 1))
else
begin
Result[i] := (Copy(strArray, 1, Length(strArray)));
Break;
end;
Delete(strArray, 1, spacePos);
i := i + 1;
until (False)
end;
function TrimString(TString: string): TStringArray;
var
i, P, L: integer;
S, S2: string;
arS: TStringArray;
begin
S := Trim(TString);
S := Lowercase(S);
S := Replace(S, '''', ' ');
S := Replace(S, '-', ' ');
arS := toStrArray(S);
L := Length(arS) - 1;
for i := 0 to L do
begin
arS[i] := Trim(arS[i]);
if Pos('.', arS[i]) <> 0 then
Delete(arS[i], P, Length(arS[i])-P+1);
arS[i] := Replace(arS[i], '&', '');
if (Length(arS[i]) = 1) then arS[i] := '';
if (not(arS[i] = 'of')) and
(not(arS[i] = 'to')) then
arS[i] := Trim(Copy(arS[i], 2, 3));
if arS[i] <> '' then
S2 := S2+' '+arS[i]; //rebuilding the TSA to remove blank indexes
end;
S2 := Trim(S2);
Result := toStrArray(S2);
end;
function CombStrArr(arr1, arr2: TStringArray): TStringArray;
var
L, L2, i: integer;
begin
L := Length(arr1);
L2 := Length(arr2);
SetLength(Result, L+L2);
for i := 0 to L-1 do
Result[i] := arr1[i];
for i := 0 to L2-1 do
Result[i+L] := arr2[i];
end;
function InRangeE(value, min, max: extended): Boolean;
begin
Result := (Min <= value) and (Max >= value);
end;
procedure RandMouse(Idle: Boolean);
var
ms: integer;
begin
if not LoggedIn then Exit;
ms := MouseSpeed;
MouseSpeed := 10+Random(21);
MMouse(MSX1, MSY1, Random(MIX2), Random(MIY2));
if Idle then IdleTime(500, 2000, 0.05);
MouseSpeed := ms;
end;
//-----------------------------------------------------------------//
//-- » Chatbox routines « --//
//-----------------------------------------------------------------//
function GetHeaderText: string;
var
x, y, i, j: integer;
tS: string;
begin
if not LoggedIn then Exit;
if FindColor(x, y, 16711680, MCX1, MCY1, MCX2, MCY2) then
for i := 5 downto 3 do
for j := 0 to 1 do
begin
tS := Trim(GetTextAtEx(x-i, y-j, 0, NPCChars, False, False, 0, 1, 16711680, 57, False, tr_AllChars));
if (Length(GetLetters(tS)) > Length(GetLetters(Result))) then
Result := tS;
end;
end;
function GetNPCText: string;
var
x, y, i, j, p: integer;
tS: string;
begin
if not LoggedIn then Exit;
if FindColor(x, y, 0, MCX1, MCY1, MCX2, MCY2) then
for i := 0 to 2 do
for j := 0 to 1 do
begin
tS := Trim(GetTextAtEx(x-5+i, y-j, 0, NPCChars, False, False, 0, 1, 0, 10, False, tr_AllChars));
if Length(tS) > Length(Result) then
Result := tS;
end;
p := pos(' ', Result);
if p <> 0 then
Delete(Result, p, Length(Result)-p+1);
end;
function ClickToContinue2: Boolean;
var
x, y: integer;
begin
if not LoggedIn then Exit;
Result := FindText(x, y, 'lic', UpChars, MCX1, MCY1, MCX2, MCY2);
if Result then
Mouse(x, y, 50, 3, True);
end;
procedure Talk;
var
x, y, a, c: integer;
begin
if not LoggedIn then Exit;
Debug('Talk');
FFlag(0);
c := GetColor(304, 429);
if not((FindColor(x, y, 16711680, MCX1, 401, MCX2, MCY2+20) or
FindColor(x, y, 16777215, MCX1, 401, MCX2, MCY2+20)) or
((c = 8388608) or (c = 16777215))) then Exit;
Masks([0, 1]);
while FindBitmapMaskTolerance(m[0], x, y, 9, 348, 523, 482, 80, 40) or
FindBitmapMaskTolerance(m[1], x, y, MCX1, MCY1, MCX2, MCY2, 30, 30) do
begin
a := GetSystemTime;
c := CountColor(0, MCX1, MCY1, MCX2, MCY2);
Mouse(x+Random(100), y+Random(13), 0, 0, True);
while c = CountColor(0, MCX1, MCY1, MCX2, MCY2) do
if GetSystemTime - a > 5000 then Break;
end;
try FreeMasks; except end;
end;
function PleaseWait: Boolean;
var
a: integer;
begin
if not LoggedIn then Exit;
Debug('PleaseWait');
FFlag(0);
a := GetSystemTime;
while Pos('lea', GetHeaderText) = 0 do
if GetSystemTime - a > 2000 then Exit;
while Pos('lea', GetHeaderText) <> 0 do
begin
if Random(30) = 0 then RandMouse(False);
if GetSystemTime - a > 25000 then Exit;
end;
Result := True;
end;
function StartEx: integer;
begin
Result := -1;
case GetHeaderText of
'Getting started': Result := 1;
'Game Options': Result := 3;
'Interacting with scenery': Result := 4;
'Moving around': Result := 5;
'Viewing the items that you were given': Result := 6;
'Cut down a tree': Result := 7;
'Making a fire': Result := 8;
'Your skill stats': Result := 10;
'Catch some shrimp': Result := 11;
'Cooking your shrimp': Result := 12;
'Burning your shrimp': Result := 13;
'Well done, you''ve just cooked your first RuneScape meal.': Result := 14;
'Find your next instructor': case GetNPCText of
'Follow': Result := 15;
'Talk': Result := 16;
end;
'Making dough': Result := 17;
'Cooking dough': Result := 18;
'Cooking douoh': Result := 19;
'The Music Player': Result := 20;
'Emotes': case GetNPCText of
'Now,': Result := 21;
'For': Result := 22;
end;
'Running': Result := 23;
'Run to the next guide': Result := 24;
'Quest Journal': Result := 27;
'Mining and Smithing': Result := 29;
'Prospecting': Result := 30;
'It''s tin.': Result := 31;
'It''s copper.': Result := 32;
'Mining': case GetNPCText of
'It''s': Result := 33;
'Now': Result := 34;
end;
'Smelting': Result := 35;
'You''ve made a bronze bar!': Result := 36;
'Smithing a dagger': case GetNPCText of
'To': Result := 37;
'Now': Result := 38;
end;
'You''ve finished in this area.': Result := 39;
'Combat': Result := 40;
'Wielding weapons': Result := 41;
'This is your worn equipment.': Result := 42;
'You''re now holding your dagger.': Result := 43;
'Unequipping items': Result := 44;
'Combat styles': Result := 45;
'These are your combat styles.': Result := 46;
'Attacking': Result := 47;
//Sit back and watch.
'Well done, you''ve made your first kill!': Result := 48;
'Rat ranging': Result := 49;
'Moving on': Result := 50;
'Banking': Result := 51;
'This is your bank box.': Result := 52;
'Financial advice': Result := 53;
'Prayer': Result := 55;
'Your Prayer List': Result := 56;
'This is your Friends List.': Result := 59;
'This is your Ignore List.': Result := 60;
'Open up your final tab.': Result := 62;
'Cast Wind Strike at a chicken.', 'Cast Wind Strike on a chicken.': Result := 63;
'You have almost completed the tutorial!': if FindNPCChatText('tell', Nothing) then
Result := 64
else
Result := 65;
'': case GetNPCText of
'Getting': Result := 1;
'Game': Result := 2;
'You': Result := 9;
'Quest': if FindNPCChatText('flash', Nothing) then
Result := 26
else
Result := 25;
'Moving': Result := 28;
'Continue': Result := 54;
'Your': if FindNPCChatText('final', Nothing) then
Result := 61
else
Result := 57;
'Friends': Result := 58;
end;
end;
end;
function Start: integer;
var
c: integer;
begin
if not LoggedIn then Exit;
Debug('Start');
Result := StartEx;
while Result = -1 do
begin
c := c + 1;
if c > 2 then Exit;
if c > 1 then Talk;
Result := StartEx;
end;
Players[CurrentPlayer].Loc := inttostr(Result);
end;
function TillText(Text: TIntegerArray; Chars, TimeOut: integer): Boolean;
var
Hi, i, a, x, y: integer;
Tol: array[0..1] of integer;
begin
if not LoggedIn then Exit;
Debug('TillText');
Hi := High(Text);
Tol := [30, 30];
if Chars = NPCChars then Tol := [50, 10];
a := GetSystemTime;
while (GetSystemTime - a < TimeOut) and (not(Result)) do
for i := 0 to Hi do
begin
Result := FindBitmapMaskTolerance(Text[i], x, y, MCX1, MCY1, MCX2, MCY2, Tol[0], Tol[1]);
if Result then Break;
end;
end;
//-----------------------------------------------------------------//
//-- » Arrow finding routines « --//
//-----------------------------------------------------------------//
function FindRedArrow(var x, y: integer): Boolean;
var
P: TPointArray;
aP: T2DPointArray;
a, i, Hi: integer;
tPt: TPoint;
begin
if not LoggedIn then Exit;
a := GetSystemTime;
while (Length(P) = 0) and (GetSystemTime - a < 750)do
FindColorsTolerance(P, 862362, MMX1, MMY1, MMX2, MMY2, 5);
if Length(P) < 1 then Exit;
aP := TPAtoATPA(P, 15);
Hi := High(aP);
for i := 0 to Hi do
begin
tPt := MiddleTPA(aP[i]);
Result := not InCircle(tPt.x, tPt.y, MMCX, MMCY, 50);
if not Result then Continue;
x := tPt.x;
y := tPt.y;
Break;
end;
end;
function FindMMArrow(var x, y: integer): Boolean;
var
DTM, a: integer;
begin
if not LoggedIn then Exit;
DTM := DTMFromString('78DA63CC626260F0664001BF7E28331801694' +
'620FE0F048CC940351E0C6880118904D28544A801D9E58F5F0D00' +
'CB9D0929');
a := GetSystemTime;
while (GetSystemTime - a < 500) and (not(Result)) do
Result := FindDTM(DTM, x, y, MMX1, MMY1, MMX2, MMY2);
FreeDTM(DTM);
end;
function FindMSArrow(var x, y: integer): Boolean;
var
DTM, a: integer;
begin
if not LoggedIn then Exit;
DTM := DTMFromString('78DA63DCCAC0C030890105C47AA9826946289' +
'F713590E844559315A289AA663F116A3612A166276135000FA50AB2');
a := GetSystemTime;
while (GetSystemTime - a < 500) and (not(Result)) do
Result := FindDTM(DTM, x, y, MSX1, MSY1, MSX2, MSY2);
FreeDTM(DTM);
end;
function Walk: Boolean;
var
x, y, c: integer;
b: Boolean;
begin
Debug('Walk');
if not LoggedIn then Exit;
Result := FindMSArrow(x, y);
if Result then Exit;
while not Result do
begin
if (c > 2) and (not(b)) then Break;
if c > 3 then Break;
c := c + 1;
if FindRedArrow(x, y) then
begin
Mouse(x, y, 3, 3, True);//MMClick(x, y, 5, 2);
FFlag(15);
b := True;
end;
if FindMMArrow(x, y) then
begin
Mouse(x, y, 3, 3, True);//MMClick(x, y, 5, 2);
FFlag(4);
b := True;
end;
Result := FindMSArrow(x, y);
end;
Flag;
if Result then
Wait(1000+Random(500));
end;
//-----------------------------------------------------------------//
//-- » Object finding routines « --//
//-----------------------------------------------------------------//
//no uptext check?
function FindObjArrow(var x, y: integer; Color, Tol: integer; UpText, Option: string): Boolean;
var
fx, fy, a, i, Hi, c: integer;
P: TPointArray;
aP: T2DPointArray;
begin
if not LoggedIn then Exit;
Debug('FindObjArrow');
Result := False;
while not Result do
begin
Inc(c);
if c > 3 then Exit;
if not FindMSArrow(fx, fy) then Exit;
FindColorsTolerance(P, Color, fx-15, fy-15, fx+15, fy+30, Tol);
if Length(P) < 1 then Exit;
aP := SplitTPA(P, 5);
Hi := High(aP);
for i := 0 to Hi do
begin
MiddleTPAEx(P, fx, fy);
MMouse(fx, fy, 3, 3);
Wait(100+Random(50));
Result := IsUpTextMultiCustom(CombStrArr(TrimString(UpText), TrimString(Option)));
if Result then
begin
GetMousePos(x, y);
if Option <> '' then
begin
Mouse(x, y, 0, 0, False);
Wait(50+Random(50));
if Pos('to', Option) <> 0 then
begin
Result := ChooseOption('alk-to');
if Result then
begin
Result := False;
FFlag(0);
a := GetSystemTime;
while (not(Result)) and (GetSystemTime - a < 3000) do
Result := AreTalking;
end;
if not Result then Break;
end else
Result := ChooseOptionMulti(TrimString(Option));
FFlag(0);
end;
if Result then Exit;
end;
end;
Wait(1000+Random(500));
end;
end;
function FindObjArrowWait(Color, Tol: integer; UpText, Option: string): Boolean;
var
x, y: integer;
begin
if not LoggedIn then Exit;
Result := FindObjArrow(x, y, Color, Tol, Uptext, Option);
if Result then
begin
PleaseWait;
Talk;
end;
end;
function FindObject(x1, y1, x2, y2: integer; var x, y: integer; Color, Tol, Dist: integer; UpText, Option: string; Sort: Variant): Boolean;
var
P: TPointArray;
i, s, Hi: integer;
aP: T2DPointArray;
mP: TPoint;
begin
if not LoggedIn then Exit;
Debug('FindObject');
mP := MiddleTPA([Point(x1, y1), Point(x2, y2)]);
FindColorsSpiralTolerance(mP.x, mP.y, P, Color, x1, y1, x2, y2, Tol);
if Length(P) < 1 then Exit;
aP := TPAtoATPA(P, Dist);
case VarType(Sort) of
3: begin
SortATPAFrom(aP, Point(MSCX, MSCY));
if Sort > 0 then s := Sort;
end;
11: if Sort then SortATPASize(aP, True) else
SortATPASize(aP, False);
256: case Lowercase(Sort) of
'bottomright': SortATPAFrom(aP, Point(MSX2, MSY2));
'topleft': SortATPAFrom(aP, Point(MSX1, MSY1));
'middle': SortATPAFrom(aP, Point(MSCX, MSCY));
end;
end;
Hi := High(aP);
for i := s to Hi do
begin
mP := MiddleTPA(aP[i]);
MMouse(mP.x, mP.y, 3, 3);
Wait(200+Random(100));
if IsUpTextMultiCustom(TrimString(UpText)) then
begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, False);
if Pos('to', Option) <> 0 then
Result := ChooseOption('alk-to')
else
Result := ChooseOptionMulti(TrimString(Option));
FFlag(0);
if Result then Exit;
end;
end;
end;
function FindObjWait(x1, y1, x2, y2, Color, Tol, Dist: integer; UpText, Option: string; Sort: Variant): Boolean;
var
x, y: integer;
begin
if not LoggedIn then Exit;
Debug('FindObjWait');
Result := FindObject(x1, y1, x2, y2, x, y, Color, Tol, Dist, Uptext, Option, Sort);
if Result then
PleaseWait;
end;
function FindObjCount(x1, y1, x2, y2, Color, Tol, Dist: integer; UpText, Option: string; Sort: Variant): Boolean;
var
i, c, a: integer;
begin
if not LoggedIn then Exit;
Debug('FindObjCount');
i := InvCount;
while not Result do
begin
if c > 2 then Exit;
c := c + 1;
if FindObjWait(x1, y1, x2, y2, Color, Tol, Dist, UpText, Option, Sort) then
begin
a := GetSystemTime;
while (GetSystemTime-a < 5000) and (not(Result)) do
Result := i <> InvCount;
end;
end;
end;
//-----------------------------------------------------------------//
//-- » High-level script routines « --//
//-----------------------------------------------------------------//
function Tab(tabnumber: Integer): Boolean;
var
c: Integer;
Coords: TPoint;
begin
if ((Tabnumber < 1) or (TabNumber > 15)) then
begin
srl_Warn('GameTab', IntToStr(tabnumber) + ' is no valid GameTab', warn_AllVersions);
Result := False;
Exit;
end;
if (tabnumber = 14) then
Coords := Point(752, 12)
else if (tabnumber = 15) then
Coords := Point(538, 485)
else if (tabnumber <= 7) then
Coords := Point(540 + ((tabnumber -1) * 33), 185)
else
Coords := Point(540 + ((tabnumber mod 7) * 33), 485);
while not(GetCurrentTab = tabnumber) and (c < 4) do
Begin
Mouse(Coords.x, Coords.y, 8, 8, true);
Inc(c);
end;
Result := (GetCurrentTab = tabnumber);
end;
procedure Next(i: integer);
begin
if not LoggedIn then Exit;
Debug('Next');
Writeln(Players[CurrentPlayer].Name+' failed at location #'+inttostr(i));
Players[CurrentPlayer].Loc := 'Location '+inttostr(i);
Players[CurrentPlayer].Integers[0] := GetSystemTime - t;
Logout;
end;
procedure Verify(i: integer);
var
a: integer;
begin
Debug('Verify');
FFlag(0);
a := GetSystemTime;
while i <> Start do
begin
Wait(100);
if GetSystemTime - a > 5000 then
begin
Next(i);
Exit;
end;
end;
Writeln('At location '+inttostr(i));
end;
function FindNPC(Which: integer): Boolean;
var
Col, Tol, c, x, y, ms: integer;
Name: string;
begin
if not LoggedIn then Exit;
Debug('FindNPC');
case Which of
1: begin Col := 3162500; Tol := 10; Name := 'RuneScape guide'; end;
2: begin Col := 11439734; Tol := 10; Name := 'Survival expert'; end;
3: begin Col := 7580302; Tol := 20; Name := 'Master chef'; end;
4: begin Col := 1664066; Tol := 10; Name := 'Quest guide'; end;
5: begin Col := 7181762; Tol := 30; Name := 'Mining instructor'; end;
6: begin Col := 1055354; Tol := 50; Name := 'Combat instructor'; end;
7: begin Col := 2763036; Tol := 10; Name := 'Banker'; end;
8: begin Col := 2368034; Tol := 10; Name := 'Financial advisor'; end;
9: begin Col := 8496075; Tol := 35; Name := 'Brother Brace'; end;
10: begin Col := 11170070; Tol := 50; Name := 'Magic Instructor'; end;
end;
ms := MouseSpeed;
MouseSpeed := 15+Random(15);
if not FindMSArrow(x, y) then
Walk;
Result := False;
c := 0;
while (not(Result)) and (c < 10) do
begin
Inc(c);
ClickToContinue2;
if c mod 4 = 0 then
begin
Result := FindObject(MSX1, MSY1, MSX2, MSY2, x, y, Col, Tol, 50, Name, 'Talk-to', 0);
Continue;
end;
if c mod 3 = 0 then
Walk;
if c mod 2 = 0 then
begin
if FindMSArrow(x, y) then
begin
Mouse(x, y+8+Random(10), 3, 0, False);
Result := ChooseOption('alk-to');
end;
Continue;
end;
Result := FindObjArrow(x, y, Col, Tol, Name, 'Talk-to');
end;
if Result then Talk;
MouseSpeed := ms;
end;
function InCave: Boolean;
var
P: TPointArray;
begin
if not LoggedIn then Exit;
Debug('InCave');
FindColorsTolerance(P, 65536, MMX1, MMY1, MMX2, MMY2, 0);
Result := Length(P) > 5000;
end;
function Gate: Boolean;
var
x, y: integer;
begin
if not LoggedIn then Exit;
Debug('Gate');
Walk;
Result := FindObjArrow(x, y, 2107439, 10, 'Gate Door Ladder', 'Open Climb-down');
if not Result then
Result := FindObjArrow(x, y, 4478308, 10, 'Gate Door Ladder', 'Open Climb-down');
if Result then Wait(1000+Random(300));
end;
function Count(BCount, Col, Tol: integer): integer;
var
i, x, y, CTS: integer;
T: array of TInvenItem;
begin
if not LoggedIn then Exit;
Debug('Count');
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(1);
T := GetInventoryArray;
for i := 0 to 27 do
if T[i].Count = BCount then
begin
if Col <> 0 then
if not FindColorTolerance(x, y, Col, T[i].ItemBox.x1, T[i].ItemBox.y1, T[i].ItemBox.x2, T[i].ItemBox.y2, Tol) then
Continue;
Inc(Result);
end;
ColorToleranceSpeed(CTS);
end;
//-----------------------------------------------------------------//
//-- » RSGuide routines « --//
//-----------------------------------------------------------------//
procedure Baldie;
begin
if (not(LoggedIn)) or (not(FindTextTPA(39218, 0, 163, 80, 362, 101, 'of', StatChars, Nothing))) then
Exit;
Debug('Baldie');
Wait(500+Random(300));
MouseBox(344, 292, 438, 310, 1);
Wait(500+Random(300));
MouseBox(344, 292, 438, 310, 1);
Wait(500+Random(300));
MouseBox(344, 292, 438, 310, 1);
Wait(500+Random(300));
MouseBox(344, 292, 438, 310, 1);
Wait(500+Random(300));
MouseBox(124, 184, 215, 201, 1);
Wait(500+Random(300));
end;
function RSGuide(S: integer): Boolean;
var
i: integer;
begin
if not LoggedIn then Exit;
Debug('RSGuide');
for i := S to 4 do
begin
Verify(i);
if not LoggedIn then Exit;
case i of
1: begin
Baldie;
FindNPC(1);
end;
2: Tab(11);
3: FindNPC(1);
4: Result := Gate;
else Exit;
end;
end;
end;
//-----------------------------------------------------------------//
//-- » Survival Expert routines « --//
//-----------------------------------------------------------------//
function Chop: Boolean;
begin
if not LoggedIn then Exit;
Debug('Chop');
ColorToleranceSpeed(2);
SetColorspeed2Modifiers(0.02, 0.5); // 5607557 , 20 *cts 1
Result := FindObjCount(MSX1, MSY1, MSX2, MSY2, 2774862, 20, 75, 'Tree', 'Chop down', 0);
SetColorspeed2Modifiers(0.2, 0.2);
ColorToleranceSpeed(1);
ClickToContinue2;
end;
function FindFire(var x, y: integer): Boolean;
var
P: TPointArray;
Fire, Tol, j, fx, fy: integer;
B: TBox;
a: extended;
begin
if not LoggedIn then Exit;
Debug('FindFire');
FindColorsSpiralTolerance(MSCX, MSCY, P, 3385314, MSX1, MSY1, MSX2, MSY2, 40);
RemovePointsInBox(P, PointToBox(Point(31, 4), Point(129, 24)));
if Length(P) < 10 then Exit;
Fire := BitmapFromString(1, 11, '3B3000F4C63FF8C83FF4C73EE6' +
'BC39E6BC39BC922CE6BE45BC9E38BC9E3B352A00');
Tol := 40;
B := GetTPABounds(P);
try
for j := 1 to 3 do
begin
FindDeformedBitmapToleranceIn(Fire, fx, fy, B.x1-10, B.y1-10, B.x2+10, B.y2+10, Tol, 2, True, a);
if a >= 1-j*0.2 then
begin
x := fx;
y := fy+4;
Result := True;
Exit;
end;
DecEx(Tol, 5);
end;
except
Writeln('wtf');
finally
FreeBitmap(Fire);
end;
end;
procedure LightFire;
var
Tbox, Log, x, y, fx, fy, cx, cy, i: integer;
begin
if not LoggedIn then Exit;
Debug('LightFire');
Tbox := DTMFromString('78DA63CC66626078CC80023C1D3819FE03694' +
'620FE0F048CA54035D719D000231209A4CB806ADE1250930454F3' +
'86809A14A09A3BF8D50000F5EC0C31');
Log := DTMFromString('78DA639CC6C4C0F0840105D4255933FC07D28' +
'C40FC1F0818E703D5DC6440038C4824905E0A54F392809A3EA09A' +
'F704D4F400D5DCC5AF0600A6FE0D95');
try
if not FindDTM(Tbox, x, y, MIX1, MIY1, MIX2, MIY2) then
Exit;
if not FindDTM(Log, fx, fy, MIX1, MIY1, MIX2, MIY2) then
begin
Chop;
if not FindDTM(Log, fx, fy, MIX1, MIY1, MIX2, MIY2) then
Exit;
end;
finally
FreeDTM(Tbox);
FreeDTM(Log);
end;
i := CoordsToItem(fx, fy);
repeat
Mouse(x, y, 5, 5, True);
Mouse(fx, fy, 5, 5, True);
Wait(300+Random(200));
if FindText(cx, cy, 'can', UpChars, MCX1, MCY1, MCX2, MCY2) then
begin
Mouse(cx, cy, 50, 3, True);
Wait(Random(150));
Mouse(MMCX-10, MMCY-10, 20, 20, True);
FFlag(1);
end;
until (not(ExistsItem(i)) and (Pos('Use Logs', rs_GetUpText) = 0));
PleaseWait;
ClickToContinue2;
end;
function HaveShrimp(var x, y: integer): Boolean;
var
fx, fy: integer;
begin
if not LoggedIn then Exit;
Debug('HaveShrimp');
Bitmaps;
Tab(4);
Result := FindBitmapToleranceIn(Shrimp, fx, fy, MIX1, MIY1, MIX2, MIY2, 20);
if Result then
begin
x := fx;
y := fy;
end;
Free;
end;
function Fish: Boolean;
var
x, y, c, cnt, i, col, Hi: integer;
H, S, L, hh, ss, ll: extended;
Cols, used: TIntegerArray;
P: TPointArray;
begin
if not LoggedIn then Exit;
Debug('Fish');
Result := HaveShrimp(x, y);
if Result then Exit;
if not FindSymbol(x, y, 'fish') then Exit;
if Distance(x, y, MMCX, MMCY) > 15 then
begin
Mouse(x, y-5, 2, 2, True);
FFlag(0);
end;
ColorToleranceSpeed(2);
SetColorspeed2Modifiers(0.15, 0.21);
try
while not Result do
begin
if c > 2 then Exit;
used := [];
hh := 0; ss := 0; ll := 0; cnt := 0;
Inc(c);
FindColorsSpiralTolerance(MSCX, MSCY, P, 11576993, MSX1, MSY1, MSX2, MSY2, 30);
Hi := High(P);
if Hi < 0 then Exit;
Cols := GetColors(P);
for i := 0 to Hi do
begin
if InIntArray(used, Cols[i]) then Continue;
ColortoHSL(Cols[i], H, S, L);
if InRangeE(L, 56, 68) then
begin
hh := hh + H;
ss := ss + S;
ll := ll + L;
Inc(cnt);
used := CombineIntArray(used, [Cols[i]]);
end;
end;
if cnt < 1 then
col := 11576993 //11379354
else
col := HSLtoColor(hh/cnt, ss/cnt, ll/cnt);
if not FindObjArrowWait(col, 15, 'Fishing spot', 'Net') then
FindObjCount(MSX1, MSY1, MSX2, MSY2, col, 15, 40, 'Fishing spot', 'Net', 0);
Wait(500+Random(300));
Result := HaveShrimp(x, y);
end;
finally
SetColorspeed2Modifiers(0.2, 0.2);
ColorToleranceSpeed(1);
end;
ClickToContinue2;
end;
function Cook: Boolean;
var
fx, fy, x, y, i, a: integer;
begin
if not LoggedIn then Exit;
Debug('Cook');
if not HaveShrimp(fx, fy) then
begin
Fish;
if not HaveShrimp(fx, fy) then Exit;
end;
i := CoordsToItem(fx, fy);
while not Result do
begin
if not FindFire(x, y) then
begin
LightFire;
if not FindFire(x, y) then Exit;
end;
Mouse(fx, fy, 5, 5, True);
Mouse(x, y, 3, 3, False);
if ChooseOption('Fire') then
begin
FFlag(0);
a := GetSystemTime;
while HaveShrimp(fx, fy) and (GetSystemTime - a < 5000) do
Wait(100+Random(100));
end;
Result := not HaveShrimp(fx, fy);
end;
Talk;
end;
function SurvivalExpert(S: integer): Boolean;
var
i: integer;
begin
if not LoggedIn then Exit;
Debug('SurvivalExpert');
for i := S to 14 do
begin
if i = 13 then
if Start = 14 then
Inc(i);
Verify(i);
if not LoggedIn then Exit;
case i of
5: FindNPC(2);
6: Tab(4);
7: Chop;
8: LightFire;
9: Tab(2);
10: FindNPC(2);
11: Fish;
12: Cook;
13: Cook;
14: Result := Gate;
else Exit;
end;
end;
end;
//-----------------------------------------------------------------//
//-- » Master Chef routines « --//
//-----------------------------------------------------------------//
function MakeDough: Boolean;
var
FlourPot, Water, x, y, fx, fy, i, a: integer;
begin
if not LoggedIn then Exit;
Debug('MakeDough');
FlourPot := DTMFromString('78DA63CC616260E06664400633332C18FE036' +
'990E87F20602C04AAF9C78006189148205D0E5423C8885F4D2650' +
'8D380135F140355C4498F317BF7B00C05D0B13');
Water := BitmapFromString(6, 6, 'beNrLs62smkkQ2er' +
'zW2jzGanxAJG2IhcQ5YVIo6G6dMvGTOuWHJv2PNuuAvveYoeKJPPq' +
'FAuEOAAStSgC');
Tab(4);
Result := FindDTM(FlourPot, x, y, MIX1, MIY1, MIX2, MIY2) and
FindBitmapToleranceIn(Water, fx, fy, MIX1, MIY1, MIX2, MIY2, 20);
if Result then
begin
i := InvCount;
Mouse(x, y, 5, 5, True);
Mouse(fx, fy, 5, 5, True);
a := GetSystemTime;
Result := False;
while (not(Result)) and (GetSystemTime - a < 2000) do
Result := i <> InvCount;
end;
FreeDTM(FlourPot);
FreeBitmap(Water);
end;
function Stove: Boolean;
var
x, y, Dough, fx, fy, a: integer;
begin
if not LoggedIn then Exit;
Debug('Stove');
Walk;
Dough := DTMFromString('78DA6374666260D8CDC8800C162D6A64F80FA' +
'441A2FF818011A46623AA1A882C8C04D28140357B09A87104AA39' +
'4E408D1950CD76FC6A000E450BD3');
if FindDTM(Dough, fx, fy, MIX1, MIY1, MIX2, MIY2) then
begin
Mouse(fx, fy, 5, 5, True);
if FindObjArrow(x, y, 1385640, 20, 'Range', 'Range') then
begin
FFlag(0);
a := GetSystemTime;
Result := True;
while Pos('Well', GetNPCText) = 0 do
if GetSystemTime - a > 5000 then
begin
Result := False;
Exit;
end;
end else
Mouse(fx, fy, 5, 5, True);
end;
end;
function MasterChef(S: integer): Boolean;
var
i: integer;
begin
if not LoggedIn then Exit;
Debug('MasterChef');
for i := S to 20 do
begin
Verify(i);
if not LoggedIn then Exit;
case i of
15: Gate;
16: FindNPC(3);
17: MakeDough;
18: Stove;
19: Tab(13);
20: Result := Gate;
else Exit;
end;
end;
end;
//-----------------------------------------------------------------//
//-- » Quest Guide routines « --//
//-----------------------------------------------------------------//
procedure ToggleRun;
var
P: TPointArray;
begin
Debug('ToggleRun');
FindColorsTolerance(P, 5753055, 715, 105, 731, 110, 30);
if Length(P) > 10 then
begin
Mouse(715, 95, 10, 10, True);
Wait(1000+Random(500));
end;
Mouse(715, 95, 10, 10, True);
Wait(2000+Random(1000));
end;
function QuestGuide(S: integer): Boolean;
var
i, a: integer;
begin
if not LoggedIn then Exit;
Debug('QuestGuide');
for i := S to 28 do
begin
Verify(i);
if not LoggedIn then Exit;
case i of
21: Tab(12);
22: begin
DoEmote(Random(20)+1);
Wait(4000+Random(3000));
end;
23: ToggleRun;
24: Gate;
25: FindNPC(4);
26: Tab(3);
27: FindNPC(4);
28: begin
Walk;
MakeCompass('S');
if not Gate then
begin
Next(i);
Exit;
end;
a := GetSystemTime;
while not InCave do
if GetSystemTime - a > 25000 then
begin
Next(i);
Exit;
end;
MakeCompass('N');
Result := InCave;
end;
end;
end;
end;
//-----------------------------------------------------------------//
//-- » Mining Instructor routines « --//
//-----------------------------------------------------------------//
function CountOre(OreType: string): integer;
var
Col: integer;
begin
if not LoggedIn then Exit;
Debug('CountOre');
case Lowercase(OreType) of
'tin': Col := 8553356;
'copper': Col := 3372494;
end;
Result := Count(171, Col, 20);
end;
function CountBars: integer;
begin
if not LoggedIn then Exit;
Debug('CountBars');
Result := Count(62, 0, 0);
end;
function SmithingScreen: Boolean;
begin
if not LoggedIn then Exit;
Result := FindTextTPA(2071039, 0, 250, 30, 290, 50, 'mith', UpChars, Nothing);
end;
function Tin(Todo: string): Boolean;
var
c, x, y, i, a: integer;
begin
if not LoggedIn then Exit;
Debug('Tin');
if not FindMMArrow(x, y) then
Exit;
Mouse(x, y, 3, 3, True);
FFlag(0);
Wait(300+Random(200));
ColorToleranceSpeed(2);
SetColorspeed2Modifiers(0.07, 0.12);
while not Result do
begin
Inc(c);
ClickToContinue;
if c > 3 then Break;
if c > 2 then Walk;
if not FindObjArrow(x, y, 8027016, 18, 'Rocks', Todo) then // 10132390 //20
if not FindObject(MSX1, MSY1, MSX2, MSY2, x, y, 8027016, 18, 25, 'Rocks', Todo, 0) then
Continue;
i := InvCount;
a := GetSystemTime;
while not ClickContinue(False, False) do
begin
Wait(100);
if GetSystemTime - a > 10000 then Break;
end;
if Lowercase(Todo) = 'prospect' then
Result := FindText(x, y, 'conta', NPCChars, MCX1, MCY1, MCX2, MCY2)
else
Result := i <> InvCount;
end;
SetColorspeed2Modifiers(0.2, 0.2);
ColorToleranceSpeed(1);
ClickToContinue2;
end;
function Copper(Todo: string): Boolean;
var
c, x, y, i, a: integer;
begin
if not LoggedIn then Exit;
Debug('Copper');
if not FindMMArrow(x, y) then
Exit;
Mouse(x, y, 3, 3, True);
FFlag(0);
Wait(300+Random(200));
ColorToleranceSpeed(2);
SetColorspeed2Modifiers(0.02, 0.84);
while not Result do
begin
Inc(c);
ClickToContinue;
if c > 3 then Break;
if c > 2 then Walk;
if not FindObjArrow(x, y, 2198998, 18, 'Rocks', Todo) then // 10132390 //20
if not FindObject(MSX1, MSY1, MSX2, MSY2, x, y, 2198998, 18, 25, 'Rocks', Todo, 0) then
Continue;
i := InvCount;
a := GetSystemTime;
while not ClickContinue(False, False) do
begin
Wait(100);
if GetSystemTime - a > 10000 then Break;
end;
if Lowercase(Todo) = 'prospect' then
Result := FindText(x, y, 'conta', NPCChars, MCX1, MCY1, MCX2, MCY2)
else
Result := i <> InvCount;
end;
SetColorspeed2Modifiers(0.2, 0.2);
ColorToleranceSpeed(1);
ClickToContinue2;
end;
function Smelt: Boolean;
var
x, y, Ore, i, ms: integer;
begin
if not LoggedIn then Exit;
Debug('Smelt');
if CountOre('Both') < 2 then Exit;
Walk;
Ore := DTMFromString('78DA633CC4C4C0C0C9C8800CEE375A31FC07D' +
'220D1FF40C0B80FA8E637031A60442281F405A01A1646FC6A7603' +
'D5881150B315A88609BF1A0019270B92');
i := InvCount;
ColorToleranceSpeed(0);
//Masks([2, 3]);
ms := MouseSpeed;
MouseSpeed := ms + Random(10);
while not Result do
begin
if FindDTM(Ore, x, y, MIX1, MIY1, MIX2, MIY2) then
begin
Mouse(x, y, 5, 5, True); //2631723 //30 //50
if not FindObjCount(MSX1, MMCY, MSX2, MSY2, 3421241, 20, 100, 'Furnace', 'Furnace', True) then
//if not TillText([m[2], m[3]], UpChars, 6500) then
if FindText(x, y, 'lso', UpChars, MCX1, MCY1, MCX2, MCY2) then
Break;
end else Break;
Result := InvCount = (i - 2);
end;
ColorToleranceSpeed(1);
FreeDTM(Ore);
MouseSpeed := ms;
Talk;
end;
function FindAnvil: Boolean;
var
x, y, Bar, a: integer;
begin
if not LoggedIn then Exit;
Debug('FindAnvil');
Result := SmithingScreen;
if Result then Exit;
Walk;
try
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.31, 0.10);
Bar := DTMFromString('78DA63CC636260E064644006B11E3A0CFF813' +
'448F43F1030E603D5FC6740038C4824902E07AAE166C4AF2605A8' +
'4690809A34A01A16FC6A00F0AC092F');
if not FindDTM(Bar, x, y, MIX1, MIY1, MIX2, MIY2) then Exit;
Mouse(x, y, 5, 5, True);
if not FindObjArrow(x, y, 4342599, 12, 'Anvil', 'Anvil') then
begin
Mouse(x, y, 5, 5, True);
Exit;
end;
a := GetSystemTime;
while (not(Result)) and (GetSystemTime-a < 2000) do
Result := SmithingScreen;
finally
FreeDTM(Bar);
SetColorSpeed2Modifiers(0.2, 0.2);
ColorToleranceSpeed(1);
end;
end;
function Smith: Boolean;
var
Hammer, x, y: integer;
begin
if not LoggedIn then Exit;
Debug('Smith');
try
Hammer := DTMFromString('78DA6374646260E0606440061136DC0CFF813' +
'448F43F10307A02D5FC6640038C482490F605AA6166C4AFC606A8' +
'4694801A2BA01A3EFC6A00768E082D');
if not FindDTM(Hammer, x, y, MIX1, MIY1, MIX2, MIY2) then Exit;
if CountBars = 0 then Exit;
if not FindAnvil then Exit;
if not FindTextTPAEx(16777215, 0, 10, 58, 95, 100, x, y, 'agge', StatChars, Nothing) then
Mouse(45, 80, 5, 5, False)
else
Mouse(x-20, y+5, 5, 5, False);
if not ChooseOption('ake') then Exit;
Masks([5]);
TillText([m[5]], UpChars, 7500);
Result := CountBars = 0;
finally
FreeDTM(Hammer);
try FreeMasks; except end;
end;
ClickToContinue2;
end;
function MiningInstructor(S: integer): Boolean;
var
i, x, y: integer;
begin
if not LoggedIn then Exit;
Debug('MiningInstructor');
for i := S to 39 do
begin
Verify(i);
if not LoggedIn then Exit;
case i of
29: begin
if not FindSymbol(x, y, 'anvil') then
begin
MFF(590+Random(10), 124+Random(4), 0, 2);
FFlag(10);
end;
FindNPC(5);
end;
30: Tin('Prospect');
31: Copper('Prospect');
32: FindNPC(5);
33: Tin('Mine');
34: Copper('Mine');
35: Smelt;
36: FindNPC(5);
37: FindAnvil;
38: Smith;
39: begin
Walk;
Result := FindObjArrow(x, y, 3885385, 20, 'Gate', 'Open');
Wait(1000+Random(300));
end;
end;
end;
end;
//-----------------------------------------------------------------//
//-- » Combat Instructor routines « --//
//-----------------------------------------------------------------//
function ArrowCount: Integer;
begin
Tab(5);
Result := GetAmount(668, 249);
end;
function CloseWindows: Boolean;
var
x, y: integer;
begin
if not LoggedIn then Exit;
Debug('CloseWindows');
DTMs;
Result := FindDTM(w[0], x, y, MSX2-100, MSY1, MSX2, MSY1+100);
if Result then
Mouse(x, y, 4, 4, True);
Free;
end;
function WindowOpen: Boolean;
var
x, y: integer;
begin
if not LoggedIn then Exit;
Debug('WindowOpen');
DTMs;
Result := FindDTM(w[0], x, y, MSX2-100, MSY1, MSX2, MSY1+100);
Free;
end;
function Dagger(Equip: Boolean): Boolean;
var
Dagg, x, y: integer;
Text: string;
begin
if not LoggedIn then Exit;
Debug('Dagger');
case Equip of
True: Text := 'ear';
False: begin Tab(5); Text := 'emove'; end;
end;
Dagg := DTMFromString('78DA63CC67626060616440063ED6CA0CFF813' +
'448F43F10309602D5FC6040038C482490CE05AAE163C4AF2605A8' +
'4690809A74A01A36FC6A00D2A808FF');
if FindDTM(Dagg, x, y, MIX1, MIY1, MIX2, MIY2) then
begin
Mouse(x, y, 3, 3, False);
Result := ChooseOption(Text);
if not Result then
begin
Delete(Text, 1, 1);
Result := ChooseOption(Text);
end;
end;
FreeDTM(Dagg);
end;
function Equips(First: Boolean): Boolean;
var
Bow, Sword, Shield, x, y, fx, fy: integer;
begin
if not LoggedIn then Exit;
Debug('Equips');
if First then
begin
Sword := DTMFromString('78DA63CC63626060636440061EE68A0CFF813' +
'448F43F10309602D5FC6440038C482490CE01AA1162C4AF2615A8' +
'868F809A14A01A71FC6A00CFFB0906');
Shield := DTMFromString('78DA639CC1C4C0C0C6C8800C42ECE418FE036' +
'990E87F20609C0554F39B010D302291407A11500D17237E351380' +
'6A8408A8E903AA61C4AF0600308F09D8');
Tab(4);
Result := FindDTM(Sword, x, y, MIX1, MIY1, MIX2, MIY2) and
FindDTM(Shield, fx, fy, MIX1, MIY1, MIX2, MIY2);
if Result then
begin
Mouse(x, y, 3, 3, True);
Mouse(fx, fy, 5, 5, True);
end;
FreeDTM(Sword);
FreeDTM(Shield);
end else
begin
DTMs;
Bow := DTMFromString('78DA63B460626070664001F93E7C0CFF81342' +
'310FF0702467BA01A330634C08844026913A01A0F026A0C806A1C' +
'09A85107AAF1C1AF06005F2A082D');
Tab(4);
if FindDTM(Arrows, x, y, MIX1, MIY1, MIX2, MIY2) then
if FindDTM(Bow, fx, fy, MIX1, MIY1, MIX2, MIY2) then
begin
Mouse(x, y, 4, 4, True);
Wait(150+Random(100));
Mouse(fx, fy, 3, 3, True);
Result := True;
end;
Free;
FreeDTM(Bow);
end;
end;
function GateByMM: Boolean;
var
d: array of DoorProfile;
P: TPointArray;
aP: T2DPointArray;
i, Hi, x, y, c: integer;
begin
if not LoggedIn then Exit;
Debug('GateByMM');
d := GetDoors;
SortDoorsFrom(d, Point(MMX2, MMY1));
Mouse(d[0].midpoint.x, d[0].midpoint.y, 0, 0, True);
FFlag(0);
Wait(1000+Random(500));
if not FindColorsTolerance(P, 3885385, MSCX-80, MSCY-40, MSCX+80, MSCY+40, 20) then
Exit;
aP := SplitTPA(P, 8);
Hi := High(aP);
while not Result do
begin
Inc(c);
if c > 2 then Exit;
for i := 0 to Hi do
begin
MiddleTPAEx(P, x, y);
MMouse(x+2+(6*(c-1)), y, 0, 2);
Wait(200+Random(100));
if IsUpTextMultiCustom(['ate', 'pen']) then
begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, False);
Wait(100+Random(50));
Result := ChooseOption('pen');
if Result then Break;
end;
end;
end;
FFlag(0);
end;
function Rat: Boolean;
var
x, y, i, Hi: integer;
P: TPointArray;
aP: T2DPointArray;
begin
if not LoggedIn then Exit;
Debug('Rat'); // 8950419 25
FindColorsSpiralTolerance(MSCX, MSCY, P, 9213847, MSX1, MSY1, MSX2, MSY2, 5);
if Length(P) < 1 then Exit;
aP := TPAtoATPA(P, 40);
Hi := High(aP);
for i := 0 to Hi do
begin
MiddleTPAEx(aP[i], x, y);
MMouse(x, y, 3, 3);
Wait(200+Random(100));
if IsUpText('iant') then
begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, False);
if ChooseOption('ttack') then
if not FindText(x, y, 'else', UpChars, MCX1, MCY1, MCX2, MCY2) then
begin
Result := True;
Exit;
end else
ClickToContinue2;
end;
end;
end;
function ReStock: Boolean;
var
c, x, y: integer;
P: TPointarray;
begin
if not LoggedIn then Exit;
if not InCave then Exit;
Debug('ReStock');;
if not FindColorsTolerance(P, 195836, MMX1, MMY1, MMX2, MMY2, 0) then
Exit;
RAaSTPA(P, 4);
SortTPAFrom(P, Point(MMCX, MMY2));
Mouse(P[0].x, P[0].y, 3, 3, True);
FFlag(0);
while (c < 5) and (not(Result)) do
begin
c := c + 1;
Result := FindObject(MSX1, MSY1, MSX2, MSY2, x, y, 1055354, 50, 50, 'Combat instructor', 'Talk-to', True);
end;
if not Result then
if FindMSArrow(x, y) then
begin
Mouse(x, y+8+Random(10), 3, 0, False);
Result := ChooseOption('alk-to');
end;
if Result then
begin
Talk;
Tab(4);
DTMs;
if FindDTM(Arrows, x, y, MIX1, MIY1, MIX2, MIY2) then
Mouse(x, y, 4, 4, True);
Free;
end;
end;
procedure Fight(Melee: Boolean);
var
a, i, c: integer;
b: Boolean;
label
Go;
begin
if not LoggedIn then Exit;
Debug('Fight');
if Melee then
begin
while Pos('Sit', GetHeaderText) = 0 do
begin
Inc(c);
if c > 5 then Exit;
if Rat then
Wait(1000+Random(500));
end;
a := GetSystemTime;
while Pos('Sit', GetHeaderText) <> 0 do
begin
if Random(30) = 0 then RandMouse(False);
if GetSystemTime - a > 120000 then Exit;
end;
end else
begin
Go:
b := False;
Mouse(MMCX+5, MMCY-15, 5, 5, True);
FFlag(0);
SetFightMode(3);
i := ArrowCount;
while ArrowCount = i do
begin
Inc(c);
if c > 5 then Exit;
if Rat then
Wait(1000+Random(500));
end;
a := GetSystemTime;
while Pos('Moving', GetHeaderText) = 0 do
begin
if Random(30) = 0 then RandMouse(True);
if GetSystemTime - a > 120000 then Exit;
if ArrowCount = 0 then
begin
ReStock;
b := True;
Break;
end;
end;
if b then
goto Go;
end;
end;
function GoUp: Boolean;
var
d: array of DoorProfile;
x, y, i, Hi, tmp: integer;
P: TPointArray;
aP: T2DPointArray;
begin
if not LoggedIn then Exit;
Debug('GoUp');
FindColorTolerance(x, y, FindLadderColor, MMX1, MMY1, MMX2, MMY2, 1);
if Distance(x, y, MMCX, MMCY) > 12 then
begin
d := GetDoors;
if Length(d) < 1 then Exit;
SortDoorsFrom(d, Point(MMX2, MMY1));
Mouse(d[0].midpoint.x+5, d[0].midpoint.y-5, 3, 3, True);
FFlag(5);
end;
if not FindColorTolerance(x, y, FindLadderColor, MMX1, MMY1, MMX2, MMY2, 1) then
Exit;
Mouse(x, y+5+Random(5), 3, 3, True);
FFlag(0);
Wait(1000+Random(300));
tmp := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorspeed2Modifiers(0.14, 0.12);
FindColorsSpiralTolerance(MSCX, MSCY, P, 5069665, MSX1, MSY1, MSX2, MSY2, 6);
SetColorspeed2Modifiers(0.2, 0.2);
ColorToleranceSpeed(tmp);
if Length(P) < 1 then Exit;
aP := SplitTPA(P, 10);
Hi := High(aP);
for i := 0 to Hi do
begin
MiddleTPAEx(aP[i], x, y);
MMouse(x, y, 2, 2);
Wait(200+Random(100));
if IsUpTextMultiCustom(['limb-up', 'mb-up', 'adder']) then
begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, False);
Result := ChooseOptionMulti(['limb-up', 'mb-up', 'adder']);
end;
end;
end;
function CombatInstructor(S: integer): Boolean;
var
i, a, tmp, x, y: integer;
begin
if not LoggedIn then Exit;
Debug('CombatInstructor');
for i := S to 50 do
begin
Verify(i);
if not LoggedIn then Exit;
case i of
40: FindNPC(6);
41: Tab(5);
42: begin
if not WindowOpen then
begin
Tab(5);
MouseBox(589, 414, 626, 450, 1);
a := GetSystemTime;
while not WindowOpen do
begin
Wait(100);
if GetSystemTime - a > 10000 then Break;
end;
end;
if WindowOpen then
Dagger(True);
end;
43: begin
if WindowOpen then
CloseWindows;
FindNPC(6);
end;
44: begin
Dagger(False);
Equips(True);
end;
45: Tab(1);
46: begin
Walk;
FindObjArrow(x, y, 3885385, 20, 'Gate', 'Open');
Wait(1000+Random(300));
end;
47: Fight(True);
48: if GateByMM then
FindNPC(6);
49: begin
Equips(False);
Fight(False);
end;
50: begin
if not GoUp then
begin
tmp := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorspeed2Modifiers(0.14, 0.12);
if not FindObjArrowWait(5069665, 20, 'Ladder', 'Climb-up') then
Exit;
SetColorspeed2Modifiers(0.2, 0.2);
ColorToleranceSpeed(tmp);
end;
a := GetSystemTime;
while InCave and (GetSystemTime - a < 25000) do
Wait(100);
Result := not InCave;
end;
end;
end;
end;
//-----------------------------------------------------------------//
//-- » Finance routines « --//
//-----------------------------------------------------------------//
function Banker(S: integer): Boolean;
var
i, a: integer;
begin
if not LoggedIn then Exit;
Debug('Banker');
for i := S to 52 do
begin
Verify(i);
if not LoggedIn then Exit;
case i of
51: if FindNPC(7) then
if FindNPCChatText('Yes', ClickLeft) then
begin
a := GetSystemTime;
while Pos('is', GetHeaderText) = 0 do
if GetSystemTime - a > 10000 then Break;
end;
52: begin
CloseBank;
Result := Gate;
end;
end;
end;
end;
function FinancialAdvisor(S: integer): Boolean;
var
i, x, y: integer;
begin
if not LoggedIn then Exit;
Debug('FinancialAdvisor');
for i := S to 54 do
begin
Verify(i);
if not LoggedIn then Exit;
case i of
53: FindNPC(8);
54: begin
Result := FindObjArrow(x, y, 4478308, 10, 'Gate Door Ladder', 'Open Climb-down');
if Result then
begin
FFlag(0);
Wait(500+Random(300));
end;
end;
end;
end;
end;
//-----------------------------------------------------------------//
//-- » Brother Brace routines « --//
//-----------------------------------------------------------------//
function InChurch: Boolean;
var
i, c: integer;
H, S, L: Extended;
Cols: TIntegerArray;
begin
Cols := [GetColor(MMCX-2, MMCY), GetColor(MMCX-2, MMCY-2),
GetColor(MMCX, MMCY-2), GetColor(MMCX+2, MMCY-2),
GetColor(MMCX+2, MMCY), GetColor(MMCX+2, MMCY+2),
GetColor(MMCX, MMCY+2), GetColor(MMCX-2, MMCY+2)];
for i := 0 to 7 do
begin
ColorToHSL(Cols[i], H, S, L);
if FullDebug then
writeln(floattostr(h)+', '+floattostr(s)+', '+floattostr(l));
if (H < 10) or (H > 90) then
if InRangeE(S, 3.2, 4.2) then
Inc(c);
end;
Result := c > 1;
end;
function EnterChurch: Boolean;
var
d: array of DoorProfile;
c, x, y: integer;
begin
if not LoggedIn then Exit;
Debug('EnterChurch');
if FindWaterColor <> 0 then
repeat
c := c + 1;
if c > 2 then Exit;
Mouse(MMCX, MMCY+30, 10, 20, True);
FFlag(3);
d := GetDoorsIn(MMX1, MMCY, MMX2, MMY2);
until Length(d) > 0;
FFlag(0);
Wait(500+Random(300));
d := GetDoors;
SortDoorsFrom(d, Point(MMCX, MMCY));
Mouse(d[0].Midpoint.x-5, d[0].Midpoint.y, 2, 2, True);
FFlag(0);
Wait(500+Random(300));
Result := InChurch;
if not Result then
begin
if not FindObject(MSX1, MSY1, MSX2, MSY2, x, y, 2107439, 5, 25, 'Church door', 'Open', 'Middle') then
if not FindObject(MSX1, MSY1, MSX2, MSY2, x, y, 4478308, 5, 25, 'Church door', 'Open', 'Middle') then
Exit;
Result := True;
end;
end;
function BrotherBrace(S: integer): Boolean;
var
i: integer;
begin
if not LoggedIn then Exit;
Debug('BrotherBrace');
for i := S to 60 do
begin
Verify(i);
if not LoggedIn then Exit;
case i of
55: if EnterChurch then
FindNPC(9);
56: Tab(6);
57: FindNPC(9);
58: Tab(8);
59: Tab(9);
60: Result := FindNPC(9);
end;
end;
end;
//-----------------------------------------------------------------//
//-- » Magic Instructor routines « --//
//-----------------------------------------------------------------//
function GoToMage: Boolean;
var
c, x, y: integer;
begin
if not LoggedIn then Exit;
Debug('GoToMage');
repeat
c := c + 1;
if c > 3 then Exit;
Mouse(MMCX+30, MMCY+30, 20, 10, True);
FFlag(15);
until FindMMArrow(x, y) or FindRedArrow(x, y);
Result := True;
end;
function PwnChickens: Boolean;
var
x, y: integer;
begin
if not LoggedIn then Exit;
Debug('PwnChickens');
Mouse(MMCX-5, MMCY-15, 5, 5, True);
FFlag(0);
Wait(500+Random(300));
repeat
Tab(7);
MouseBox(584, 217, 607, 240, 1);
if not FindObject(MSX1, MSY1, MSX2, MSCY+40, x, y, 4698308, 34, 10, 'Chicken', 'Cast Wind Strike', 0) then
if not FindObject(MSX1, MSY1, MSX2, MSCY+40, x, y, 3299957, 10, 10, 'Chicken', 'Cast Wind Strike', 0) then
Exit;
Wait(500+Random(300));
until Pos('almost', GetHeaderText) <> 0;
Result := True;
end;
function InLumby: Boolean;
var
x, y: integer;
begin
if not FindSymbol(x, y, 'water') then
if not FindSymbol(x, y, 'fish') then
if not FindSymbol(x, y, 'dungeon') then
if not FindSymbol(x, y, 'quest') then
Exit;
Result := True;
end;
function MagicInstructor(S: integer): Boolean;
var
i, a: integer;
begin
if not LoggedIn then Exit;
Debug('MagicInstructor');
for i := S to 65 do
begin
Verify(i);
if not LoggedIn then Exit;
case i of
61: begin
Gate;
if GoToMage then
FindNPC(10);
end;
62: begin
Tab(7);
Wait(300+Random(200));
Talk;
ClickToContinue;
end;
63: PwnChickens;
64: if FindNPC(10) then
begin
FindNPCChatText('Yes', ClickLeft);
Talk;
end;
65: begin
Tab(7);
MouseBox(560, 217, 583, 240, 1);
a := GetSystemTime;
while Pos('elc', GetNPCText) = 0 do
begin
if Random(30) = 0 then RandMouse(False);
if GetSystemTime - a > 45000 then Break;
end;
Talk;
Result := InLumby;
end;
end;
end;
end;
//-----------------------------------------------------------------//
//-- » Misc « --//
//-----------------------------------------------------------------//
procedure Setup;
var
i: integer;
begin
SmartSetupEx(107, False, True, False);
SetTargetDC(SmartGetDC);
SetupSRL;
ClearDebug;
ClearReport;
ChangeReportWidth(280);
ScriptID := '990';
SRLID := StatsID;
SRLPassword := StatsPass;
DeclarePlayers;
for i := 0 to High(Players) do
if not Players[i].Active then
Players[i].Loc := 'Set to false.'
else
Players[i].Loc := 'Not attempted yet.';
IncEx(MouseSpeed, 3);
end;
function DateTime: string;
var
y, m, d, h, mins, s, ms: Word;
pm: Boolean;
begin
case DayOfWeek(Date) of
1: Result := 'Sunday';
2: Result := 'Monday';
3: Result := 'Tuesday';
4: Result := 'Wednesday';
5: Result := 'Thursday';
6: Result := 'Friday';
7: Result := 'Saturday';
end;
Result := Result+', ';
DecodeDate(Date, y, m, d);
case m of
1: Result := Result+'January';
2: Result := Result+'February';
3: Result := Result+'March';
4: Result := Result+'April';
5: Result := Result+'May';
6: Result := Result+'June';
7: Result := Result+'July';
8: Result := Result+'August';
9: Result := Result+'September';
10: Result := Result+'October';
11: Result := Result+'November';
12: Result := Result+'December';
end;
Result := Result+' '+inttostr(d);
if (d < 10) or (d > 20) then
begin
if EndsWith('1', inttostr(d)) then
Result := Result+'st'
else if EndsWith('2', inttostr(d)) then
Result := Result+'nd'
else
Result := Result+'th';
end else
Result := Result+'th';
Result := Result+', '+inttostr(y)+', ';
DecodeTime(Time, h, mins, s, ms);
if h > 12 then
begin
DecEx(h, 12);
pm := True;
end else
if h = 12 then
pm := True
else if h = 0 then
h := 12;
Result := Result+Padz(inttostr(h),2)+':'+Padz(inttostr(mins), 2)+':'+
Padz(inttostr(s), 2)+' ';
if pm then
Result := Result+'PM'
else
Result := Result+'AM';
end;
function FormatTime(i: integer): string;
var
RHours, Minutes, Seconds, RMinutes, RSeconds: LongInt;
s: string;
begin
Seconds := i div 1000;
Minutes := Seconds div 60;
RHours := Minutes div 60;
s := IntToStr(Seconds) + ' Seconds';
if Minutes <> 0 then
begin
RSeconds := Seconds mod (Minutes * 60);
s := IntToStr(Minutes) + ' Minutes and ' + IntToStr(RSeconds) +
' Seconds';
end;
if RHours <> 0 then
begin
RMinutes := Minutes mod (RHours * 60);
RSeconds := Seconds mod (Minutes * 60);
s := IntToStr(RHours) + ' Hours, ' + IntToStr(RMinutes) +
' Minutes and ' + IntToStr(RSeconds) + ' Seconds';
end;
Result := s;
end;
{b[0] completed
b[1] loggedin
b[2] lumby by default}
procedure Report;
var
i, Completed, Total, Ran, Decrease: integer;
begin
if not FullDebug then
begin
ClearDebug;
ClearReport;
end;
Writeln('[---------------------------------------------------------------]');
Writeln('[ » Saturn''s Tutorial Island Runner! « ]');
Writeln('[---------------------------------------------------------------]');
Writeln('[ '+Padr(DateTime, 52)+']');
Writeln('[---------------------------------------------------------------]');
Writeln('[ Total Time Running: '+Padr(TimeRunning, 39)+']');
for i := 0 to High(Players) do
begin
if Players[i].Booleans[0] then
begin
Inc(Completed);
Total := Total + Players[i].Integers[0];
end;
if Players[i].Booleans[1] then
Inc(Ran);
if Players[i].Booleans[2] then
Inc(Decrease);
end;
try Total := Total/(Completed-Decrease); except Total := 0 end;
Writeln('[ Total Accounts Ran: '+Padr(inttostr(Ran), 39)+']');
Writeln('[ Total Accounts Completed: '+Padr(inttostr(Completed), 33)+']');
Writeln('[ Average Completion Time: '+Padr(FormatTime(Total), 34)+']');
Writeln('[---------------------------------------------------------------]');
for i := 0 to High(Players) do
Writeln('[ '+Padr(Players[i].Name, 12)+': '+Padr(Players[i].Loc, 46)+']');
Writeln('[---------------------------------------------------------------]');
end;
procedure Login;
var
Mark, Attempts: Integer;
Actions: TVariantArray;
RetryLogin: Boolean;
label
ProcStart;
begin
//ActivateClient;
Wait(100);
TypeByte(vk_Escape);
if not Players[CurrentPlayer].Active then Exit;
if not Players[CurrentPlayer].Booleans[1] then
begin
Inc(ReportVars[0]);
Players[CurrentPlayer].Booleans[1] := True;
end;
if LoggedIn then Exit;
if (not(RSReady)) then
begin
MarkTime(Mark);
while (not(RSReady)) do
begin
Wait(100);
if (TimeFromMark(Mark) > 180000) then
begin
WriteLn('It has been 3 minutes and Runescape is not yet ready... Terminating.');
TerminateScript;
end;
end;
WriteLn('Welcome to Runescape.');
end;
LoginScreenMusic(True);
if (not(GraphicsSet)) then
begin
SetAutoingDefaults;
GraphicsSet := True;
end;
ProcStart:
if (not(LoggedIn)) then
begin
Wait(900 + random(60));
//Click 'Log In' on main menu
while (GetColor(343, 175) <> 7750) do //while (GetColor(343, 174) <> 7750) do
begin
MouseBox(360, 180, 400, 185, 1);
Wait(100 + Random(100));
end;
//Type Username
Mouse(315, 272, 10, 5, True);
while (CountColor(7750, 311, 269, 452, 284) > 13) do
begin
KeyDown(vk_Back);
Wait(10 + Random(10));
KeyUp(vk_Back);
Wait(50 + Random(50));
end;
for Mark := 0 to 3 do
begin
KeyDown(vk_Back);
Wait(10 + Random(10));
KeyUp(vk_Back);
Wait(50 + Random(50));
end;
Wait(100 + Random(200));
WriteLn(Capitalize(Players[CurrentPlayer].Name));
TypeSend(Players[CurrentPlayer].Name);
Wait(100+random(50));
//Type Password
Mouse(315, 334, 10, 5, True);
while (CountColor(7750, 311, 337, 452, 352) > 13) do
begin
KeyDown(vk_Back);
Wait(10 + Random(10));
KeyUp(vk_Back);
Wait(50 + Random(50));
end;
for Mark := 0 to 3 do
begin
KeyDown(vk_Back);
Wait(10 + Random(10));
KeyUp(vk_Back);
Wait(50 + Random(50));
end;
Wait(100 + Random(200));
TypeSend(Players[CurrentPlayer].Pass);
Wait(500 + Random(300));
if (not(FindTextTPA(12509695, 0, 288, 205, 475, 247, 'login', StatChars, Nothing))) then //If 'enter' from typesend didn't log us in
begin
MouseBox(355, 359, 403, 372, 1); //Click 'login' login screen
Wait(250 + random(100));
end;
MarkTime(Mark);
repeat
SetLength(Actions, 0);
if (TimeFromMark(Mark) > 60000) then
Actions := ['One minute has passed...', 0, 2, 'NextPlayer', 'Login Failed']
else
case (CountColor(12509695, 288, 205, 475, 247)) of //Number of text colour points
// Actions := ['WriteLn Text', TimeToWait, NumberOfRetries, 'FinalAction', 'PlayerStatus'];
760: Actions := ['Too many incorrect logins.', 5 * 60000, 2, 'NextPlayer', ''];
536: Actions := ['Login limit exceeded. Please wait 1 minute and try again.', 60000, 2, 'NextPlayer', ''];
711: Actions := ['Your account has been disabled', 0, 0, 'NextPlayer', 'Acc Disabled'];
598: Actions := ['Invalid Username / Password', 0, 2, 'NextPlayer', 'Wrong User/Pass'];
787: Actions := ['Not a Members Account', 0, 0, 'NextPlayer', 'Non-member'];
408: Actions := ['World is full.', 5000, 20, 'Terminate', ''];
623: Actions := ['Your account is already logged in', 5000, 0, 'RandomNextPlayer', ''];
555: Actions := ['The Server is being updated.', 60000, 4, 'Terminate', 'Server Updating'];
218: Actions := ['Error Connecting.', 20000, 9, 'Terminate', 'Error Connecting'];
335: Actions := ['Unable to connect Login Server offline.',(20000) + Random(6000), 4, 'Terminate', 'Login Server Offline'];
512: Actions := ['RuneScape has been updated. Script Terminated.', 0, 0, 'Terminate', 'RS Updated'];
489: Actions := ['Connection timed out.', 0, 4, 'Terminate', 'Connection Timed Out'];
737: Actions := ['You are standing in a members-only area.', 0, 0, 'NextPlayer', 'In Mems-Only Area'];
//10: Actions := ['Error loading your profile.', 5000, 10, 'NextPlayer', 'Profile Loading Failed']; // Error loading your profile. Will attempt to re-login 5 more times.)
//11: Actions := ['Login server rejected session.', 1000, 10, 'NextPlayer', 'Login Serv. Rejected']; // Login server rejected session.
end;
if (Length(Actions) > 0) then
begin
WriteLn(Actions[0]);
Wait(Actions[1] + Random(100));
if (Actions[2] <> 0) then
if (Attempts < Actions[2]) or (Actions[2] = -1) then
begin
RetryLogin := True;
Break;
end;
//if (Actions[4] <> '') then
//Players[CurrentPlayer].Loc := Actions[4];
case Actions[3] of
'NextPlayer': Exit;
'RandomNextPlayer': Exit;
'Terminate': TerminateScript;
end;
Exit;
end;
if (GetColor(212, 327) = 238301) then //At Click To Play screen
begin
Players[CurrentPlayer].Booleans[0] := True;
Players[CurrentPlayer].Booleans[2] := True;
Players[CurrentPlayer].Loc := 'Completed in 0 seconds.';
Inc(ReportVars[1]);
Wait(1000 + Random(3000));
MouseBox(227, 337, 555, 364, 1);
MarkTime(Mark);
while (TimeFromMark(Mark) < 30000) and (not(LoggedIn)) do
Wait(1000 + Random(1000));
Logout;
Exit;
end;
until LoggedIn or FindTextTPA(39218, 0, 163, 80, 362, 101, 'of', StatChars, Nothing);
if (RetryLogin) then
begin
RetryLogin := False;
Inc(Attempts);
goto ProcStart;
end;
end;
if (LoggedIn) then
begin
PlayerStartTime := (GetSystemTime div 1000); // PlayerStartTime
AddToSRLLog('Current player: ' + Capitalize(Players[CurrentPlayer].Name));
end;
end;
var
s, a, i: integer;
p: Boolean;
procedure MainLoop;
begin
Setup;
repeat
Login;
AddToReport(' '+Players[CurrentPlayer].Name);
AddToReport('- - - - - - - - - - - - - - - - - - -');
if LoggedIn then
AddToReport(GetTime(GetTimeRunning)+' Logged in.');
p := True;
t := GetSystemTime;
for i := 0 to 9 do
begin
if not LoggedIn then Break;
if i > 0 then
SetRun(True);
if p then
s := Start;
p := True;
a := GetSystemTime;
case i of
0: case s of
1..4: begin
p := RSGuide(s);
MakeCompass('N');
SetAngle(True);
end;
else begin
MakeCompass('N');
SetAngle(True);
p := False;
end;
end;
1: case s of
5..14: p := SurvivalExpert(s);
else p := False;
end;
2: case s of
15..20: p := MasterChef(s);
else p := False;
end;
3: case s of
21..28: p := QuestGuide(s);
else p := False;
end;
4: case s of
29..39: p := MiningInstructor(s);
else p := False;
end;
5: case s of
40..50: p := CombatInstructor(s);
else p := False;
end;
6: case s of
51..52: p := Banker(s);
else p := False;
end;
7: case s of
53..54: p := FinancialAdvisor(s);
else p := False;
end;
8: case s of
55..60: p := BrotherBrace(s);
else p := False;
end;
9: case s of
61..65: p := MagicInstructor(s);
else p := False;
end;
end;
if p then
case i of
0: AddToReport(GetTime(GetTimeRunning)+' RS Guide completed in '+FormatTime(GetSystemTime-a));
1: AddToReport(GetTime(GetTimeRunning)+' Survival Expert completed in '+FormatTime(GetSystemTime-a));
2: AddToReport(GetTime(GetTimeRunning)+' Master Chef completed in '+FormatTime(GetSystemTime-a));
3: AddToReport(GetTime(GetTimeRunning)+' Quest Guide completed in '+FormatTime(GetSystemTime-a));
4: AddToReport(GetTime(GetTimeRunning)+' Mining Instructor completed in '+FormatTime(GetSystemTime-a));
5: AddToReport(GetTime(GetTimeRunning)+' Combat Instructor completed in '+FormatTime(GetSystemTime-a));
6: AddToReport(GetTime(GetTimeRunning)+' Banker completed in '+FormatTime(GetSystemTime-a));
7: AddToReport(GetTime(GetTimeRunning)+' Financial Advisor completed in '+FormatTime(GetSystemTime-a));
8: AddToReport(GetTime(GetTimeRunning)+' Brother Brace completed in '+FormatTime(GetSystemTime-a));
9: begin
Players[CurrentPlayer].Integers[0] := Players[CurrentPlayer].Integers[0] + GetSystemTime - t;
AddToReport(GetTime(GetTimeRunning)+' Magic Instructor completed in '+FormatTime(GetSystemTime-a));
AddToReport('- - - - - - - - - - - - - - - - - - -');
AddToReport(GetTime(GetTimeRunning)+' Tutorial Island completed in '+FormatTime(Players[CurrentPlayer].Integers[0]));
Players[CurrentPlayer].Booleans[0] := True;
if not Players[CurrentPlayer].Booleans[2] then
Players[CurrentPlayer].Loc := 'Completed in '+FormatTime(Players[CurrentPlayer].Integers[0]);
Inc(ReportVars[1]);
end;
end;
end;
AddToReport('- - - - - - - - - - - - - - - - - - -');
SendSRLReport;
if LoggedIn then Logout;
if Retry then
begin
if Players[CurrentPlayer].Booleans[0] then
Players[CurrentPlayer].Active := False;
end else
Players[CurrentPlayer].Active := False;
CurrentPlayer := (CurrentPlayer+1) mod Length(Players);
Report;
a := 0; t := 0;
until AllPlayersInactive;
end;
begin
MainLoop;
end.