Code:
{=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=|
| Nielsie95's Tutorial Island Runner |
|=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=|
| |
| Will run the Tutorial Island for you |
| |
| Has all Skills and Character maker =] |
| |
|=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=|
| |
| Start Logged-In at the clothes picker. |
| |
|=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=|
| |
| VERSION 0.33 |
| |
| Updates done to Fighting, Mining and Speed. +Added |
| GetDoorColor from Boreas. |
| |
| V 0.31 = Faster/Less Waiting Version - Same as 0.3 |
| |
| VERSION 0.30 |
| |
| Updates done to Chopping, FM, Failsafes, Mining, |
| Fighting and Maging parts. Also added Time writing |
| in Report. +Added ClothesMaker from Smartz |
| |
| VERSION 0.20 |
| |
| First version of the Tutorial Runner. |
| |
|=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=}
program TutRunner;
{.Include SRL\SRL.SCAR}
{.include SRL\SRL\Skill\Fighting.scar}
const SmartzCharMaker = True; //Want to use Smartz Random Clothes procedure?, False for my own procedure
var MMArrow, TopMMArrow, MSArrow, TopMSArrow, PlzWait: integer;
TotalTime: LongInt;
procedure LoadBmps;
begin
MMArrow := BitmapFromString(15, 14, 'z78DAEDD24B0E80200C84E' +
'12B3142425CB6E2DCFF485EC0C2E0236EECE25F7E49A129750672' +
'6707DCD97C89FACB8FC98D563DEAA7727851DC688551E56B1C384' +
'ABB5B80CE3597D9CA6F0E1A2B4CE9A57FC40BE6C0BF6D9EF8BA79' +
'00C3A2078F');
TopMMArrow := BitmapFromString(6, 5, 'z78DA737372B3343671C3' +
'4F3ABA991B3A52421A80802184C42B8B0C0C71C90200FB5828A4');
MSArrow := BitmapFromString(21, 23, 'z78DAEDD3310AC0200C85E' +
'12B456D1147A3E6FE472A38554A4B6A0D8112877FF47B0802700F' +
'35AA1838058163BAE90A7AA5929053D37FA6E7889C9ACEBAB350D' +
'E9B56FB04A7E59E9EA16FD88A742F2E0C1B905248127D740537B0' +
'DD7143A6E8FD974EB9E3BF5072E7DE61A9FB62C39DEB825B37C77' +
'15C8E7800DECE700D');
TopMSArrow := BitmapFromString(8, 5, 'z78DA737374333732721B' +
'04A40108184248A25522034362540200128F35BE');
PlzWait := BitmapFromString(63, 2, 'z78DA33303030707373' +
'727474B27044212D1D4D2D0C0D3064A12260596412531CA708865' +
'D386DC12B82451C6217316C8A5D4EA60BF186214E1B8976272E73' +
'70B90DBFCB89F22972D862A41F9CE2148433A62CA9210F0080F3B' +
'0CA');
end;
procedure NielsMakeChar;
var tx, ty, c, i: integer;
begin
case Random(2) of
0 : Wait(1);
1 : Mouse(450, 290, 1, 1, True);
end
Wait(1000);
for i := 0 to 6 do
begin
MMouse(45 +Random(15), 88 +(i*35), 1, 1);
GetMousePos(tx, ty);
for c := 0 to Random(8) do
begin
Mouse(tx, ty, 1, 1, True);
Wait(500);
end
end;
for i := 0 to 4 do
begin
MMouse(343 +Random(15), 88 +(i*35), 1, 1);
GetMousePos(tx, ty);
for c := 0 to Random(4) do
begin
Mouse(tx, ty, 1, 1, True);
Wait(500);
end
end;
Wait(1000);
Mouse(260, 285, 2, 2, True);
Wait(3000);
end;
procedure SmartzCharacter; //SmartzKid
var
b,i,x,y,n,k:integer;
arrow:TPointArray;
finished:boolean;
begin
for b := 0 to 1 do //get the 'Design' arrow coords
begin
for i := 0 to 6 do
begin
n:=getarraylength(arrow);
setarraylength(arrow,n+1);
arrow[n].y:=85 + ( i * 35 );
arrow[n].x:=45 + ( b * 115 );
end;
end;
for b := 0 to 1 do //get the 'Colour' arrow coords
begin
for i := 0 to 4 do
begin
n:=getarraylength(arrow);
setarraylength(arrow,n+1);
arrow[n].y:=97 + ( i * 35 );
arrow[n].x:=353 + ( b * 115 );
end;
end;
if(random(2)=0)then //change gender to female
Mouse(458,295,20,10,true);
repeat
n:=random(24); // choose a random arrow (not necessary, only left for ease of testing)
repeat //~
n:=random(24);//~This code should try to click the 'Design' arrows first,
until(n<i) //~ instead of randomly clicking arrows
x:=arrow[n].x; //~Assign our x and y variables, just to shorten things below
y:=arrow[n].y; //~
MMouse(x,y,8,8);
if(IsUpTextMulti('ang','reco','olou'))then
begin
GetMousePos(b,n);
HoldMouse(b,n,true); //~
wait(15+random(50)); //~ Realistic click
ReleaseMouse(b,n,true);//~
i:=i+1+random(3);
k:=k+n;
end;
wait(250+random(500)); //a little time for our 'person' to 'decide' on their next move
if(i>40) and (k>200)then //quit after ~40 changes, the k>200 is to help gurantee recoloration of the person
finished:=true;
until(finished)
Mouse(260, 285, 2, 2, True);
Wait(3000);
end;
function FindMMArrow(var x, y: integer):Boolean;
var c, tx, ty: integer;
begin
repeat
Wait(50);
c := c +1
until ((c > 50) or (FindBitmapToleranceIn(TopMMArrow, tx, ty, MMX1, MMY1, MMX2, MMY2, 10)));
if c > 50 then
begin
c := 0;
repeat
Wait(50);
c := c +1
until ((c > 50) or (FindBitmapToleranceIn(MMArrow, tx, ty, MMX1, MMY1, MMX2, MMY2, 10)));
if c > 50 then
begin
WriteLn('Could not find the MMArrow');
Result := False;
Exit;
end
end
Result := True;
x := tx +4;
y := ty +6;
end;
function FindMSArrow(var x, y: integer):Boolean;
var c, tx, ty: integer;
begin
repeat
Wait(50);
c := c +1
until ((c > 50) or (FindBitmapToleranceIn(TopMSArrow, tx, ty, MSX1, MSY1, MSX2, MSY2, 10)));
if c > 50 then
begin
c := 0;
repeat
Wait(50);
c := c +1
until ((c > 50) or (FindBitmapToleranceIn(MSArrow, tx, ty, MSX1, MSY1, MSX2, MSY2, 10)));
if c > 50 then
begin
WriteLn('Could not find the MSArrow');
Result := False;
Exit;
end
end
Result := True;
x := tx +4;
y := ty +6;
end;
function FindFastMSArrow(var x, y: integer):Boolean;
var c, tx, ty: integer;
begin
repeat
Wait(50);
c := c +1
until ((c > 2) or (FindBitmapToleranceIn(TopMSArrow, tx, ty, MSX1, MSY1, MSX2, MSY2, 10)));
if c > 2 then
begin
c := 0;
repeat
Wait(50);
c := c +1
until ((c > 2) or (FindBitmapToleranceIn(MSArrow, tx, ty, MSX1, MSY1, MSX2, MSY2, 10)));
if c > 2 then
begin
Result := False;
Exit;
end
end
Result := True;
x := tx +4;
y := ty +6;
end;
function WalkToMMArrow: Boolean;
var tx, ty: integer;
begin
if FindMMArrow(tx, ty) then
begin
MouseFindFlag(tx, ty, 1, 1);
Flag;
Result := True;
end;
end;
function FindNpcByArrow(var x, y: integer; Name: String; RightClick: Boolean): Boolean;
var c, tx, ty: integer;
begin
repeat
if FindMSArrow(tx, ty) then
begin
MMouse(tx, ty +15, 4, 4);
Wait(50);
if IsUpTextMulti('Talk-to', 'to '+Name, Name) then
begin
if RightClick then
begin
GetMousePos(tx, ty);
Mouse(tx, ty, 0, 0, False);
end
x := tx;
y := ty;
Result := True;
Exit;
end
end else WalkToMMArrow;
c := c +1;
until(c > 50)
Result := False;
WriteLn('Could not find '+Name);
end;
function InTalk: Boolean;
begin
if FindColorTolerance(x, y, 128, 220, 360, 365, 370, 5) then
Result := True;
end;
function TalkToNpcByArrow(name: String): Boolean;
var c, tx, ty: integer;
begin
if not FindFastMSArrow(x, y) then WalkToMMArrow;
repeat
if FindNpcByArrow(tx, ty, Name, True) then
begin
ChooseOption(x, y, 'Talk-to');
Flag;
Wait(1200);
if InTalk then
begin
WriteLn('We are talking to '+Name);
Result := True;
Exit;
end
end
c := c +1
until c > 10
end;
function PleaseWait: Boolean;
begin
if FindBitmapToleranceIn(PlzWait, x, y, MCX1, MCY1, MCX2, MCY2, 20) then Result := True;
end;
procedure HandleTalk;
var c, i: integer;
begin
repeat
c := c +1;
repeat
Wait(500);
i := 0;
if PleaseWait then
repeat
Wait(500);
i := i +1
until ((not (PleaseWait)) or (i > 7))
until not ClickToContinue;
Wait(1000);
if not ClickToContinue then Break;
until c > 10;
end;
function OpenDoor(Dir: String): Boolean;
var tx, ty, i: integer;
begin
MakeCompass(Dir);
LowestAngle;
for i := 10 to 30 do
if FindMSArrow(tx, ty) then
begin
MMouse(tx, ty +(i*2), 1, 1);
Wait(50);
if IsUpTextMulti('Open', 'Door', 'Open Door') then
begin
Mouse(tx, ty +(i*2), 0, 0, True);
Flag;
Break;
end
end
Wait(2000);
Result := True;
end;
function OpenDoorAt(DoorNumber: Integer): Boolean;
var i, MovingAround, Emotes, TalkWithQuest, FinancialAdvise, Prayer, FinalInstruc: integer;
begin
Case DoorNumber of
1 : begin
MovingAround := BitmapFromString(100, 2, 'z78DAA553410EC020' +
'08FBD2B664891E21D1FF3F690BF300C1228B1E1A53B12214AE749' +
'793058F77F5CE8A3148C485468CEC357EBC461413AB1905971BC2' +
'A1A094F319A26C3338D17475432FFA6AFCADA439656AF5CADFCAB' +
'C8294277725C660D87783C07B0B1725F4A126E811E4C3EE2FFA02' +
'FE8BF67046C054C6DECBCCEC3EBFA5E69DA3FCE6F907C84F182C');
repeat
OpenDoor('E');
i := i +1;
until ((FindBitMapToleranceIn(MovingAround, x, y, MCX1, MCY1 -20, MCX2, MCY2, 20)) or (i > 10));
if i > 10 then
begin
WriteLn('We got stuck on our first Door, Terminating..');
TerminateScript;
end
WriteLn('We are through our first door!');
MakeCompass('N');
HighestAngle;
FreeBitMap(MovingAround);
Result := True;
Exit;
end
2 : begin
repeat
OpenDoor('E');
i := i +1;
until ((not(FindColor(x, y, 0, 350, 590, 575, 600))) or (i > 10));
if i > 10 then
begin
WriteLn('We got stuck on our second Door, Terminating..');
TerminateScript;
end
WriteLn('We are through our second door!');
MakeCompass('N');
HighestAngle;
FreeBitMap(MovingAround);
Result := True;
Exit;
end
3 : begin
Emotes := BitmapFromString(41, 3, 'z78DA73B27434B5307422823' +
'400023737274747270B476412539C289510937188434590D46071' +
'092E17E275332EBD2824A97E21512501B7619840C077186EC66F2' +
'FB25E2CA181194AC4B8197F5C10E30B4C5F63F802BF4A5CBA00F7' +
'17AC44');
repeat
OpenDoor('E');
i := i +1;
until ((FindBitMapToleranceIn(Emotes, x, y, MCX1, MCY1 -20, MCX2, MCY2, 20)) or (i > 10));
if i > 10 then
begin
WriteLn('We got stuck on our 3rd Door, Terminating..');
TerminateScript;
end
WriteLn('We are through the third door!');
MakeCompass('N');
HighestAngle;
FreeBitMap(Emotes);
Result := True;
Exit;
end
4 : begin
TalkWithQuest := BitmapFromString(175, 1, 'z78DA737' +
'27474B270742282340003FCB258D4583A9A5A1842C5C16CE245C8' +
'2349B0CBC8D2D2DC943CF7A09880D71C325D4E74F81370390E353' +
'40F5B12CD21419CE8D4E8E4E4E86A6904154762E3D7EB445E8EC0' +
'61174E7B31C521224824F1E2B85412AF1E53040057F5ED2B');
repeat
OpenDoor('N');
i := i +1;
until ((FindBitMapToleranceIn(TalkWithQuest, x, y, MCX1, MCY1 -20, MCX2, MCY2, 20)) or (i > 10));
if i > 10 then
begin
WriteLn('We got stuck on our 4th Door, Terminating..');
TerminateScript;
end
WriteLn('We are through doornumber 4!');
MakeCompass('N');
HighestAngle;
FreeBitMap(TalkWithQuest);
Result := True;
Exit;
end
5 : begin
FinancialAdvise := BitmapFromString(77, 2, 'z78DA73B27434B' +
'530340002373727301B99C4258EA90645A5A3A39385239424CB7C' +
'A838B2393848FC2A51DC46BC5E4C5F208BE30F01B25C488C7A925' +
'592189BC8B2C4AB24591C332431D309DEF483C516BCBEC6199B78' +
'43985AB1497CDC618A0000027CD7B7');
repeat
OpenDoor('W');
i := i +1;
until ((FindBitMapToleranceIn(FinancialAdvise, x, y, MCX1, MCY1 -20, MCX2, MCY2, 20)) or (i > 10));
if i > 10 then
begin
WriteLn('We got stuck on our 5th Door, Terminating..');
TerminateScript;
end
WriteLn('We are through doornumber 5!');
MakeCompass('N');
HighestAngle;
FreeBitMap(FinancialAdvise);
Result := True;
Exit;
end
6 : begin
Prayer := BitmapFromString(31, 3, 'z78DA3330303070737372747' +
'4B27024863400AB37C0AB0B972C01714B47530B4308892982D30D' +
'C8B2182A31CDC76232922E5CB2C4F8C8808890C47439516185A49' +
'2800B8911273A1E316D07007A4D827E');
repeat
OpenDoor('W');
i := i +1;
until ((FindBitMapToleranceIn(Prayer, x, y, MCX1, MCY1 -20, MCX2, MCY2, 20)) or (i > 10));
if i > 10 then
begin
WriteLn('We got stuck on our 6th Door, Terminating..');
TerminateScript;
end
WriteLn('We are through door 6!');
MakeCompass('N');
HighestAngle;
FreeBitMap(Prayer);
Result := True;
Exit;
end
7 : begin
FinalInstruc := BitmapFromString(88, 3, 'z78DAB594C10AC0' +
'2008407FC90D06755458FFFF4983DCC1708AE5BA483CCA4A5F010' +
'0B4468854902A5EE5E008CC050971CED3A3263EFF889C5F8C87DD' +
'2DBE748BF8F9F59CF8CC454E78D7F3257D2CA3C5A757C97D13959' +
'CADD2840FCA0AD0F65ADCBD45E424992EFFE683D1E52D3E489EF1' +
'4157D87ACBAE8156CE888D19F776ACCDFC03912EEFF3E101FAAB7' +
'5BF');
repeat
OpenDoor('N');
i := i +1;
until ((FindBitMapToleranceIn(FinalInstruc, x, y, MCX1, MCY1 -20, MCX2, MCY2, 20)) or (i > 10));
if i > 10 then
begin
WriteLn('We got stuck on our last(!) Door, Terminating..');
TerminateScript;
end
WriteLn('We are through the last door (7)!');
MakeCompass('N');
HighestAngle;
FreeBitMap(FinalInstruc);
Result := True;
Exit;
end
end;
Result := False;
end;
function OpenGate(Dir: String; Gate3: Boolean): Boolean;
var i, tx, ty: integer;
begin
MakeCompass(Dir);
LowestAngle;
if FindMSArrow(tx, ty) then
begin
for i := 0 to 30 do
begin
if Gate3 then MMouse(tx, ty +(30 +(i*2)), 1, 1) else MMouse(tx, ty +(5 +(i*2)), 1, 1);
Wait(200);
if IsUpTextMulti('Open', 'Gate', 'Open Gate') then
begin
GetMousePos(tx, ty);
Mouse(tx, ty, 0, 0, True);
Flag;
break;
end
end
Result := True;
Wait(2000);
end
end;
function OpenGateAt(GateNumber: Integer): Boolean;
var i, FYN, Combat, Attacking: integer;
begin
Case GateNumber of
1 : begin
FYN := BitmapFromString(65, 2, 'z78DA33303030707' +
'333C04B3A393A3A5938628A383939BA5A1A11A3171749895E62CC' +
'74B27434B5304426718923CBE277032E59527561B10B1C9EC4905' +
'8D4239909F51186EDB85C853F24C98B05F2EC25208E2B36897739' +
'462C238B0300A16FB710');
repeat
OpenGate('W', False);
i := i +1;
until ((FindBitMapToleranceIn(FYN, x, y, MCX1, MCY1 -20, MCX2, MCY2, 20)) or (i > 10));
if i > 10 then
begin
WriteLn('We got stuck on our first Gate, Terminating..');
TerminateScript;
end
WriteLn('We are through our first Gate!');
MakeCompass('N');
HighestAngle;
FreeBitMap(FYN);
Result := True;
Exit;
end
2 : begin
Combat := BitmapFromString(35, 2, 'z78DA33303030707373B2743' +
'4B53084928E8E4E168E061071301B99245EDC00D9648838984D94' +
'38D12228E2547239011F21B99964710C3763090D0CBD0084D7620' +
'0');
repeat
OpenGate('E', True);
i := i +1;
until ((FindBitMapToleranceIn(Combat, x, y, MCX1, MCY1 -20, MCX2, MCY2, 20)) or (i > 10));
if i > 10 then
begin
WriteLn('We got stuck on our second Gate, Terminating..');
TerminateScript;
end
WriteLn('We are through our second Gate!');
MakeCompass('N');
HighestAngle;
FreeBitMap(Combat);
Result := True;
Exit;
end
3 : begin
Attacking := BitmapFromString(58, 3, 'z78DA73727474B2703400' +
'023737FCA41358A593A5A3A985215404CCC6248992859886643BB' +
'2082E712C2A316DC42B8ECB6D448913ED42645D384303877B480E' +
'5B0C57617109112EC76F0E16110CDB49085B22DC80DFE5F843099' +
'7BD64A65BCC14454CBAC5EB36271CF90E57CC921A8F94842D0041' +
'83F1E4');
repeat
OpenGate('E', True);
i := i +1;
until ((FindBitMapToleranceIn(Attacking, x, y, MCX1, MCY1 -20, MCX2, MCY2, 20)) or (i > 10));
if i > 10 then
begin
WriteLn('We got stuck on our third Gate, Terminating..');
TerminateScript;
end
WriteLn('We are through our third Gate!');
MakeCompass('N');
HighestAngle;
FreeBitMap(Attacking);
Result := True;
Exit;
end
end;
Result := False;
end;
procedure Chop(HowMuch: Integer);
var tx, ty, slot, c, i: Integer; ChopTime: LongInt;
begin
MarkTime(ChopTime);
repeat
HandleTalk;
c := 0;
Slot := 0;
Slot := InventoryCount;
if (TimeFromMark(ChopTime) > 180000) then
begin
WriteLn('Chopping took longer then 3 mins, Terminating..');
TerminateScript;
end
if FindObjEx(tx, ty, 'Tree', MSX1 +20, MSY1 +20, MSX2 -50, MSY2 -20, 3170384, 15, 7, 7, 100, True) then
begin
Mouse(tx, ty, 1, 1, True);
Flag;
repeat
Wait(1000);
c := c +1;
until ((InventoryCount > Slot) or (c > 15))
if c <= 15 then
begin
WriteLn('We chopped a Tree');
i := i +1;
if (i >= HowMuch) then Exit;
end
end;
until(i >= HowMuch)
end;
procedure MakeFire (HowMuch: Integer);
var tx, ty, TinderBox, Log, i, c, slot: Integer; FireMaking: LongInt;
begin
TinderBox := BitmapFromString(9, 1, '9F94949F94949F94949D92' +
'929A8F8F6242096242096242098B8281');
Log := BitmapFromString(11, 1, '000001BE9B6DBC996CBA976B74' +
'562A8A6C4187683F87683F87683F87683F87683F');
MarkTime(FireMaking);
if FindSymbol(tx, ty, 'Fish') then MouseFindFlag(tx +10, ty +5, 1, 1);
Flag;
GameTab(4);
repeat
ClickToContinue;
Slot := 0;
Slot := InvCount;
if ((FindBitmapToleranceIn(TinderBox, x, y, MIX1, MIY1, MIX2, MIY2, 20)) and (FindBitmapToleranceIn(Log, x, y, MIX1, MIY1, MIX2, MIY2, 20))) then
begin
HandleTalk;
if FindBitmapToleranceIn(TinderBox, tx, ty, MIX1, MIY1, MIX2, MIY2, 20) then Mouse(tx, ty, 1, 1, True);
Wait(500);
if ClickToContinue then ClickToContinue;
if FindBitmapToleranceIn(Log, tx, ty, MIX1, MIY1, MIX2, MIY2, 20) then Mouse(tx, ty, 1, 1, True);
Wait(1000);
if PleaseWait then
begin
repeat
Wait(1000);
c := c +1;
until ((not (PleaseWait)) or (c > 10))
if InvCount < Slot then
begin
WriteLn('We made a fire');
i := i +1;
if (i >= HowMuch) then Exit;
end
end
if (TimeFromMark(FireMaking) > 180000) then
begin
WriteLn('Makeing Fire took longer then 3 mins, Terminating..');
TerminateScript;
end
end else break;
until(i >= HowMuch);
FreeBitmap(TinderBox);
FreeBitmap(Log);
end;
function ThereIsFire(var WhereX, WhereY: integer): boolean;
var acc,ref : Extended; XT, YT,times,tol,fire : Integer;
begin
Fire := BitmapFromString(1, 11, '3B3000F4C63FF8C83FF4C73EE6' +
'BC39E6BC39BC922CE6BE45BC9E38BC9E3B352A00');
ref:=0.8; tol:=1;
for times:=1 to 4 do
begin
FindDeformedBitmapToleranceIn(Fire, XT, YT, MSCX-(25*times),MSCY-(25*times),MSCX+(25*times),MSCY+(25*times), tol, 2, True, acc);
if (acc >= ref) then
begin
WhereX:=XT;
WhereY:=YT;
Result := True;
WriteLn('Found Fire');
FreeBitmap(Fire);
Exit;
end;
ref := ref - 0.1;
tol:=tol+10;
wait(1);
end;
Result:=False;
WriteLn('Couldnt Find Fire');
FreeBitmap(Fire);
end;
procedure Fish(HowMuch: Integer);
var FishSpotDTM, c, i, slot, tx, ty: Integer; Fishing: LongInt;
begin
FishSpotDTM := DTMFromstring('78DA63FCC4C0C070910105CC38F086410E483' +
'342F98C1F31D5E4B52C4255F399083520BB2E10A1E6127E3500EE' +
'831204');
WalkToMMArrow;
GameTab(4);
MarkTime(Fishing);
repeat
ClickToContinue;
if (FindMsDTM (tx, ty, FishSpotDTM)) then
begin
MMouse (tx, ty, 5, 5);
if IsUpText('et Fishing') then Mouse (tx, ty, 5, 5, True ) else
begin
if FindMSArrow(tx, ty) then
begin
MMouse(tx, ty -5, 1, 1);
Wait(50);
if IsUpTextMulti('Net Fishing spot', 'ishing spot', 'Net fish') then Mouse(tx, ty, 0, 0, True);
end
end
end;
Flag;
Slot := 0;
Slot := InvCount;
c := 0;
repeat
Wait(1000);
c := c +1;
until ((InvCount > Slot) or (c > 15))
if c <= 15 then
begin
i := i +1;
WriteLn('We catched a fish');
end
if (TimeFromMark(Fishing) > 180000) then
begin
WriteLn('Fishing took longer then 3 mins, Terminating..');
TerminateScript;
end
until(i >= HowMuch);
FreeDtm(FishSpotDtm);
end;
procedure CookShrimp(HowMuch: Integer);
var tx, ty, fx, fy, Shrimp, CookedShrimp, BurntShrimp, i: Integer; CookShrimpTime: LongInt;
begin
Shrimp := BitmapFromString(17, 3, 'z78DA7D4F410A043108FB925' +
'5A3F658EDF4FF4F9A427B1B761542089A28D1AE467FB19E9C8941' +
'914198AA0227B0AC5023CD2E56D05EE13E87750A64EB239EB32BC' +
'4BB613A950FFF85DFDC9378785FAEA8913E8D13018BE2584E29FB' +
'0A3F3327E5A2EA90BCF851BEFE57E198C1A5DBB95575389A356E3' +
'CD403F7A317CB363F8F');
CookedShrimp := BitmapFromString(23, 3, 'z78DA9D8F5D0AC0200' +
'C83AFD49F68F5D139BDFF91E65606822F620B1F25849006A0E815' +
'226EC816DDBF723F61CDF9142519EB3CCC9C92E91D761633E1382' +
'B371B71B6A89D5A0AB04141A0367BCEB8365F3BF88F7E578D8973' +
'EAA82CD680BF837B1ECE3C55C6');
BurntShrimp := BitmapFromString(24, 4, 'z78DA9D905B0A03210C' +
'45B794D755FBE958BBFF25D5312904A603A55E38487CE4289EA8A' +
'8453130E81CFC1F61D6F540B1A78933EA0D82982B09F974D5D586' +
'0D9DFA583125A5BC1F076CC5DD6A21BCBCC2856565D3CFC64E3F9' +
'518B7259F6CE5264E37BFB3B5696D6513648775631DFA31EF8A95' +
'AAA2225D9AB4FC96CC6BC76CF58B49D0FB6E86C9EEE8DD83454E2' +
'1E6C9F3CB0DD9E4F23F773F76F5F1D537531C74EC');
MarkTime(CookShrimpTime);
if FindSymbol(tx, ty, 'Fish') then MouseFindFlag(tx +15, ty +7, 1, 1);
Flag;
Wait(3000);
repeat
if (TimeFromMark(CookShrimpTime) > 360000) then
begin
WriteLn('Cooking Shrimps took longer then 6 mins, Terminating..');
TerminateScript;
end
ClickToContinue;
if ((ThereIsFire(fx, fy)) and (FindBitmapToleranceIn(Shrimp, tx, ty, MIX1, MIY1, MIX2, MIY2, 20))) then
begin
HandleTalk;
Mouse(tx, ty, 1, 1, True);
ClickToContinue;
ClickToContinue;
Mouse(fx, fy, 1, 1, False);
Wait(500);
ChooseOption(x, y, 'Use');
Flag;
Wait(5000);
if i = 0 then if ((FindBitmapToleranceIn(CookedShrimp, tx, ty, MIX1, MIY1, MIX2, MIY2, 20)) or (FindBitmapToleranceIn(BurntShrimp, tx, ty, MIX1, MIY1, MIX2, MIY2, 20))) then
begin
WriteLn('We cooked/burned a Shrimp');
i := i +1;
end
if i = 1 then if (CountItemBmpTol(CookedShrimp, 20) > 1) or (CountItemBmpTol(BurntShrimp, 20) > 1) then
begin
WriteLn('We cooked/burned a Shrimp');
i := i +1;
end
if i = 1 then if (CountItemBmpTol(CookedShrimp, 20) = 1) and (CountItemBmpTol(BurntShrimp, 20) = 1) then
begin
WriteLn('We cooked and burned a Shrimp');
i := i +1;
end
end else
begin
if not FindBitmapToleranceIn(Shrimp, tx, ty, MIX1, MIY1, MIX2, MIY2, 20) then Break;
WriteLn('We did not find a fire, we are making one');
Chop(1);
Wait(500);
MakeFire(1);
Wait(1000);
end
until(i >= HowMuch)
FreeBitmap(Shrimp);
FreeBitmap(CookedShrimp);
FreeBitmap(BurntShrimp);
end;
procedure MakeDough(HowMuch: Integer);
var px, py, bx, by, PotOfFlour, BucketOfWater, Dough, i, slot: Integer; DoughTime: LongInt;
begin
PotOfFlour := BitmapFromString(18, 3, 'z78DA758E5B0A43210C44B714' +
'F318934F8DD7FD2FA9DEA68542DB0C041472E6187429D33DEDDF8' +
'6AAB2F634E3EC66C4135B2703AE6005696336972CCCFBCA9EE4CF' +
'5DFF4E06BE7E70A606A38709CFD8A1A139F240B3CF7D424387860' +
'1829808E91E760915E7DBB95A1C3685CAFFE599723155CB5ACB4F' +
'72F593B18EE279C9E28C6CD9C66DB13D9CFAAE2EDF68F272287E9' +
'93F00F6A7451C');
BucketOfWater := BitmapFromString(15, 2, '5C4615533F15493911493911' +
'4939114939114F3C115E58588D838369501B6049185C461560491' +
'8644D180000014939113F300E7B7B9B7B7B9B7B7B9B7B7B9B7B7B' +
'9B615A5A847A7A6860604534114534116049185C4615000001');
Dough := BitmapFromString(24, 1, 'AAA988AAA988AAA988AAA988A' +
'AA988AAA988A6A685A5A483A1A1809D9C7D999879959476909073' +
'8D8C7088886C7D7C6373735C6867535A59464D4D3E3C3C3000000' +
'1564D42564D42');
MarkTime(DoughTime);
GameTab(4);
repeat
ClickToContinue;
if ((FindBitmapToleranceIn(PotOfFlour, px, py, MIX1, MIY1, MIX2, MIY2, 20)) and (FindBitmapToleranceIn(BucketOfWater, bx, by, MIX1, MIY1, MIX2, MIY2, 20))) then
begin
Slot := InvCount;
Mouse(px, py, 1, 1, True);
Wait(500);
Mouse(bx, by, 1, 1, True);
Wait(3000);
if ((FindBitmapToleranceIn(Dough, x, y, MIX1, MIY1, MIX2, MIY2, 20)) and (InvCount > Slot)) then
begin
WriteLn('We made dough');
i := i +1;
end
end else Break;
if (TimeFromMark(DoughTime) > 180000) then
begin
WriteLn('Making Dough took longer then 3 mins, Terminating..');
TerminateScript;
end
until (i >= HowMuch)
FreeBitmap(PotOfFlour);
FreeBitmap(BucketOfWater);
FreeBitmap(Dough);
end;
procedure CookBread(HowMuch: Integer);
var dx, dy, tx, ty, BreadDough, Bread, i: Integer; CookBreadTime: LongInt;
begin
BreadDough := BitmapFromString(24, 1, 'AAA988AAA988AAA988AAA988A' +
'AA988AAA988A6A685A5A483A1A1809D9C7D999879959476909073' +
'8D8C7088886C7D7C6373735C6867535A59464D4D3E3C3C3000000' +
'1564D42564D42');
Bread := BitmapFromString(16, 2, '564D42000001A58715A28411A' +
'28411A28411987C118E7411886E0E846B0E7C660E745F0E6D590E' +
'604D094C3E093C3000000001A587159C7F11A284119F81119F811' +
'19F81119F81119579118B7111846B0E78620E705B0E6451095B4B' +
'094C3E09');
MakeDough(HowMuch);
GameTab(4);
if not FindFastMSArrow(x, y) then WalkToMMArrow;
MarkTime(CookBreadTime);
repeat
ClickToContinue;
if FindBitmapToleranceIn(BreadDough, dx, dy, MIX1, MIY1, MIX2, MIY2, 20) then
begin
Mouse(dx, dy, 1, 1, True);
Wait(100);
if FindMSArrow(tx, ty) then
begin
MMouse(tx, ty -5, 1, 1);
Wait(200);
if IsUpTextMulti('Use Range', 'Use', 'Range') then
begin
Mouse(tx, ty, 0, 0, False);
Wait(300);
ChooseOption(x, y, 'Use');
Flag;
Wait(6000);
if FindBitmapToleranceIn(Bread, tx, ty, MIX1, MIY1, MIX2, MIY2, 20) then
begin
WriteLn('We cooked bread');
i := i +1;
end
end
end
end else Break;
if (TimeFromMark(CookBreadTime) > 180000) then
begin
WriteLn('Cooking Bread took longer then 3 mins, Terminating..');
TerminateScript;
end
until(i >= HowMuch)
FreeBitmap(BreadDough);
FreeBitmap(Bread);
end;
procedure ClimbDownLadder;
var tx, ty, i, c: integer;
begin
MakeCompass('S');
if not FindFastMSArrow(x, y) then WalkToMMArrow;
repeat
ClickToContinue;
if FindMSArrow(tx, ty) then
begin
MMouse(tx, ty, 1, 1);
Wait(200);
if IsUpTextMulti('Climb-down Ladder', 'Ladder', 'down La') then
begin
Mouse(tx, ty, 0, 0, False);
Wait(300);
ChooseOption(x, y, 'Climb-down');
c := 0;
repeat
if (FindColor(x, y, 16711680, 180, 360, 320, 375) or (GetColor(327, 374) = 16711680)) then Break;
Wait(1000);
c := c +1;
until c > 9
if (FindColor(x, y, 16711680, 180, 360, 320, 375) or (GetColor(327, 374) = 16711680)) then Break;
i := i +1;
end
end
until(i > 10)
if i <= 10 then WriteLn('We are underground') else
begin
WriteLn('We are not underground, Terminating..');
TerminateScript;
end
Mouse(665, 25, 1, 1, True);
Wait(4000);
Flag;
end;
procedure ClimbUpLadder;
var tx, ty, i, c: integer;
begin
if not FindFastMSArrow(x, y) then WalkToMMArrow;
repeat
ClickToContinue;
if GetColor(232, 371) = 16711680 then if GetColor(320, 440) = 0 then Break;
if FindMSArrow(tx, ty) then
begin
MMouse(tx, ty +5, 4, 4);
Wait(200);
if IsUpTextMulti('Climb-up Ladder', 'Ladder', 'up La') then
begin
GetMousePos(tx, ty);
Mouse(tx, ty, 0, 0, False);
Wait(300);
if ChooseOption(x, y, 'Climb-up') then
repeat
if GetColor(232, 371) = 16711680 then if GetColor(320, 440) = 0 then Break;
Wait(1000);
c := c +1;
until c > 12
i := i +1;
end
end
until(i > 10)
if i <= 10 then WriteLn('We are out the cave!') else
begin
WriteLn('We are still underground, Terminating..');
TerminateScript;
end
end;
procedure Prospect;
var tx, ty, i, c, t: Integer; Prospecting: LongInt;
begin
MarkTime(Prospecting);
repeat
WalkToMMArrow;
Wait(1000);
Flag;
i := 0
repeat
ClickToContinue;
if c = 0 then if GetColor(325, 426) = 0 then if GetColor(280, 373) = 16711680 then Break;
if c = 1 then if GetColor(302, 426) = 0 then if GetColor(291, 374) = 16711680 then Break;
if FindMSArrow(tx, ty) then
begin
ClickToContinue;
MMouse(tx, ty, 1, 1);
Wait(200);
if IsUpTextMulti('Mine Rocks', 'Mine', 'Rocks') then
begin
Mouse(tx, ty, 0, 0, False);
Wait(300);
if ChooseOption(x, y, 'Prospect') then
begin
Flag;
Wait(500);
if c = 0 then if GetColor(325, 426) = 0 then if GetColor(280, 373) = 16711680 then Break;
if c = 1 then if GetColor(302, 426) = 0 then if GetColor(291, 374) = 16711680 then Break;
if PleaseWait then
begin
t := 0;
repeat
if not PleaseWait then Break;
Wait(1000);
t := t +1;
until t > 9
Wait(2000);
if ClickToContinue then
begin
WriteLn('We prospected an Ore');
Break;
end
end
i := i +1;
end;
end
end
until(i > 10)
if i > 10 then
begin
WriteLn('We got stuck while prospecting the ores, Terminating..');
TerminateScript;
end
c := c +1
until(c > 1);
WriteLn('We prospected 2 ores');
Wait(1500);
end;
procedure Mine(HowMuch: Integer);
var tx, ty, Slot, i, c, t, YouManageTo: Integer;
begin
YouManageTo := BitmapFromString(97, 2, 'z78DAB552CB0AC030' +
'08FB255B28AD4785FDFF2F8DDD1C12D176F39043D4101F444FA8C' +
'AC5DD2285BC0D15D125165136EECA23154359C66A0833F57FEB67' +
'EA7D2F54FE749F056FE04FE05F390FC85B9EDF9B1DF26E7674AF4' +
'C6555E7C577E639F6F4E36BFA9F39D9EDC9EC377FE9004F');
repeat
GameTab(4);
Slot := 0;
Slot := InvCount;
WalkToMMArrow;
Wait(1000);
Flag;
i := 0
repeat
if (InvCount > Slot) then Break;
if FindMSArrow(tx, ty) then
begin
ClickToContinue;
MMouse(tx, ty, 1, 1);
Wait(200);
if IsUpTextMulti('Mine Rocks', 'Mine', 'Rocks') then
begin
Mouse(tx, ty, 0, 0, False);
Wait(300);
if ChooseOption(x, y, 'Mine') then
begin
Flag;
Wait(500);
if PleaseWait then
begin
t := 0;
repeat
if not PleaseWait then Break;
Wait(1000);
t := t +1;
until t > 9
Wait(1000);
GameTab(4);
if (FindBitMapToleranceIn(YouManageTo, x, y, MCX1, MCY1, MCX2, MCY2, 20) or (InvCount > Slot)) then
begin
WriteLn('We mined an Ore');
Break;
end
end
end;
ClickToContinue;
i := i +1;
end
end
until(i > 10)
if i > 10 then
begin
WriteLn('We got stuck while mining the ores, Terminating..');
TerminateScript;
end
c := c +1
until(c >= HowMuch);
WriteLn('We mined '+ IntToStr(HowMuch) +' ores');
end;
procedure Smelt(HowMuch: Integer);
var i, ox, oy, tx, ty, Tin, Bar: Integer; Smelting: LongInt;
begin
Tin := BitmapFromString(29, 2, 'z78DA754F490E03210CFB521667' +
'E1C8B0FCFF49650AAAB8944856141CDB215A8F39D96808F1C32C4' +
'DC0A9218DBB4E8500A9558A11D61F7DF906547DD001CD3DD9183D' +
'10C8999656282363E3CDB9F128039011CD014FF18292D52766B65' +
'8B1365349569D9CBE3ADB5B9670257B501436D0D41DC65A767FEF' +
'1E47D1A1C3ABBF227F526DFE8DBFAB97A333A646BC6E92E91D6DE' +
'73C3843EDE87C00D9644776');
Bar := BitmapFromString(18, 2, 'z78DA3336300242303044268D8C' +
'0C9D0C5C4925CD0C4C2C8D9C2124C41C63B0F910D2D4C4C4D1D80' +
'942228B93673B4E5BCC4C5C4C8C00C70F2C55');
if not WalkToMMArrow then if FindSymbol(tx, ty, 'furnace') then MouseFindFlag(tx, ty, 1, 1);
Flag;
GameTab(4);
MarkTime(Smelting);
repeat
if FindBitmapToleranceIn(Tin, ox, oy, MIX1, MIY1, MIX2, MIY2, 20) then
begin
Mouse(ox, oy, 1, 1, True);
if FindMSArrow(tx, ty) then
begin
MMouse(tx, ty, 1, 1);
Wait(200);
if IsUpTextMulti('Use Furnace', 'Furnace', 'se Fur') then
begin
Mouse(tx, ty, 0, 0, True);
Wait(6000);
if FindBitmapToleranceIn(Bar, ox, oy, MIX1, MIY1, MIX2, MIY2, 20) then
begin
WriteLn('We melted a bar');
i := i +1;
end
end
end
end else Break;
if (TimeFromMark(Smelting) > 180000) then
begin
WriteLn('Smelting took longer then 3 mins, Terminating..');
TerminateScript;
end
until(i >= HowMuch)
FreeBitmap(Tin);
FreeBitmap(Bar);
end;
procedure Smith(HowMuch: Integer);
var bar, i, tx, ty: Integer; Smithing: LongInt;
begin
Bar := BitmapFromString(18, 2, 'z78DA3336300242303044268D8C' +
'0C9D0C5C4925CD0C4C2C8D9C2124C41C63B0F910D2D4C4C4D1D80' +
'942228B93673B4E5BCC4C5C4C8C00C70F2C55');
WalkToMMArrow;
GameTab(4);
Wait(1000);
Flag;
MarkTime(Smithing);
repeat
if FindBitmapToleranceIn(Bar, tx, ty, MIX1, MIY1, MIX2, MIY2, 20) then if not FindColorTolerance(x, y, 16777215, tx -10, ty -10, tx +10, ty +10, 5) then Mouse(tx, ty, 1, 1, True) else Break;
if FindMSArrow(tx, ty) then
begin
for i := 0 to 30 do
begin
MMouse(tx, ty + (5 +i), 1, 1);
Wait(200);
if IsUpTextMulti('Anvil', 'Use', 'nvil') then
begin
GetMousePos(tx, ty);
Mouse(tx, ty, 0, 0, False);
Wait(300);
if not ChooseOption(x, y, 'Anvil') then Break else
begin
Wait(2000);
Mouse(27, 66, 1, 1, True);
Wait(5000);
if not ClickToContinue then
begin
WriteLn('We smithed a Dagger');
i := i +1;
Break;
end
end
end
end
end
if (TimeFromMark(Smithing) > 180000) then
begin
WriteLn('Smithing took longer then 3 mins, Terminating..');
TerminateScript;
end
until(i >= HowMuch)
FreeBitmap(Bar);
end;
procedure Wield(What: string);
var tx, ty, Dagger, Shield, Sword, Arrows, Bow, Weapon: integer;
begin
Dagger := BitmapFromString(6, 9, 'z78DA65CD311603210804D02B' +
'81084809EAFDAF1412B2C9EE738A69E6A34E8ED8E01DBCB77077F' +
'2BE281A296B87ED1FE9D31DB94CADD5AC2C600307A404DB978C11' +
'825C8684044030EB29CD3525075D2F73E306A64B276C9B1669C43' +
'94D0BF819A500AB962DEB29EF6B755D0D1E94D24CB19D2BFC83E7' +
'2F87F9E605A39D43F5');
Shield := BitmapFromString(21, 5, 'z78DAA590410AC0200C04BFB' +
'43131254751FAFF2755B09582A6B4750F730B3304E8238D92614A' +
'62B09825566E123A03EF30299C2A8DB59399008F5C42E9D460970' +
'BF3D15872F6FC6A78EDF54B52446DF03ED37A9C8666FFE8754B46' +
'4E4A6E9F59F62EB53D9F1DB54F7BB0');
Sword := BitmapFromString(6, 7, 'z78DA75CC510E80300803D02B9' +
'532D8F8DCB279FF2349D42FA7FD21292F05DE6110421E34B1AB10' +
'EC66FBB668156B7040EC6F415D1DE8DEB3BFE5BE5F669988F030E' +
'1236DE8879412391199FA25D599C7A88A70D3DC6C475B29B58BF0' +
'9627C63A3300');
Arrows := BitmapFromString(10, 12, 'z78DA9D90490E80300C03BF' +
'1467A1ED9102FFFF1248E110885A2172B0BA4D6D99E835D05D3A8' +
'B9200879FD06CFC16B669E5AE2686438C1BEA9445D405BAF2EEAC' +
'EB80454A052B62D4E4E2D15D138B9CCA292EF7FE95679ECAD9F85' +
'29B54A6982DB3D9D14C99CBA0B1874B5C2FDD58BE67A3E8E86C6E' +
'6CD006E53CB9B1EC38623FFCF6607F39D209E29E8E5A');
Bow := BitmapFromString(15, 5, 'z78DA8D90D10E802008457F0916' +
'083C5AF2FFBF14CBDA34D375DDCE83BB9C31005EC14A39648B37B' +
'0E98C41412AE0C9298377FF13DBE0FCA03063E7FCBFE1D33426F0' +
'EAB9D9EC993229D8DAA9C816538553B0DA5AE7658365D4383ACAB' +
'C0727B6E51DA63901F2AE5BE5');
case LowerCase(what) of
'dagger' : Weapon := Dagger;
'shield' : Weapon := Shield;
'sword' : Weapon := Sword;
'arrows' : Weapon := Arrows;
'bow' : Weapon := Bow;
end;
GameTab(4);
if FindBitmapToleranceIn(Weapon, tx, ty, MIX1, MIY1, MIX2, MIY2, 20) then
begin
Mouse(tx, ty, 1, 1, True);
WriteLn('We wielded the '+What);
end
FreeBitmap(Dagger);
FreeBitmap(Shield);
FreeBitmap(Sword);
FreeBitmap(Arrows);
FreeBitmap(Bow);
end;
function ClickRat: Boolean;
var RatPoints: TPointArray; i, ci: integer;
begin
FindColorsSpiralTolerance(MSCx, MSCY, RatPoints, 9213847, 90, 65, 420, 250, 20)
for i := 0 to (GetArrayLength(RatPoints)-1) do
begin
if (Distance(RatPoints[ci].x, 0, RatPoints[i].x, 0) >= 10) and
(Distance(0, RatPoints[ci].y, 0, RatPoints[i].y) >= 10) then
ci := i
else
begin
RatPoints[i].x := 0;
RatPoints[i].y := 0;
end;
end;
for i := 0 to (GetArrayLength(RatPoints)-1) do
begin
if (RatPoints[i].x <> 0) then
begin
MMouse(RatPoints[i].x, RatPoints[i].y, 0, 0);
Wait(100);
if IsUpText('ack') then
begin
if not IsFightAt(RatPoints[i].x, RatPoints[i].y) then
begin
Mouse(RatPoints[i].x, RatPoints[i].y, 0, 0, True);
Result := True;
Exit;
end;
end;
end;
end;
end;
procedure Fight;
var WellDone, i, c: integer; WaitTime: LongInt;
begin
WellDone := BitmapFromString(56, 5, 'z78DAB553490AC0200CFC5' +
'25B28E83181FAFF27B5D84B4A98382EF5304834DB64A22A573EB6' +
'E794A2F5EE71E695411F6130A68826E9CDD588602DEFDD629633E' +
'D1F4B9885EF6B86D5413E7D771E57F1C930597195F6E2895884BE' +
'A8AA5821B63B833E2F5303FC63AA823117F1D9AB6DA846CF27AF4' +
'0C6B77317A8E91B95C6F3FA834FEA27E204EC17DC38E0D5985D5C' +
'0361BF0195C49065');
repeat
repeat
if GetColor(256, 432) = 8388608 then Mouse(256, 432, 1, 1, True);
if ClickRat then
begin
Flag;
Wait(2000);
if GetColor(307, 436) <> 8388608 then if GetColor(353, 400) <> 0 then Break;
ClickToContinue;
end
c := c +1;
until(c > 50)
WriteLn('We are fighting');
MarkTime(WaitTime);
repeat
Wait(1000);
if GetColor(256, 432) = 8388608 then Break;
if FindBitmapToleranceIn(WellDone, x, y, 115, 355, 205, 385, 30) then
begin
FreeBitmap(WellDone);
WriteLn('Killed a rat');
Exit;
end;
if not InFight then
begin
Wait(800);
if not InFight then Break;
end
until (TimeFromMark(WaitTime) > 75000)
i := i +1;
until i > 5
WriteLn('We took 6 tries to find a rat, but we did not found it');
TerminateScript;
end;
function GetDoorColor: integer; //Boreas
var Color,tmpx,tmpy,MinOfRange:integer;
Length206,Length217,Length233,Length241:integer;
Array206,Array217,Array233,Array241:array of tpoint;
RangeOfOthers206,RangeOfOthers217,RangeOfOthers233,RangeOfOthers241:integer;
tmpbool:boolean;
begin
for Color:=254 downto 200 do
begin
if not(((Color=206)or(Color=217)or(Color=233)or(Color=241))) then
begin
if FindColor(tmpx,tmpy,Color,mmx1,mmy1,mmx2,mmy2) then
begin
result:=Color;
tmpbool:=true;
end;
end;
if tmpbool then break;
end;
if not(tmpbool) then
begin
//writeln('its a drop dot color');
FindColorsTolerance(Array206,206,mmx1,mmy1,mmx2,mmy2,0);
Length206:=getarraylength(Array206);
FindColorsTolerance(Array217,217,mmx1,mmy1,mmx2,mmy2,0);
Length217:=getarraylength(Array217);
FindColorsTolerance(Array233,233,mmx1,mmy1,mmx2,mmy2,0);
Length233:=getarraylength(Array233);
FindColorsTolerance(Array241,241,mmx1,mmy1,mmx2,mmy2,0);
Length241:=getarraylength(Array241);
RangeOfOthers206:=max(Length233,max(Length217,Length241))-min(Length233,min(Length217,Length241));
RangeOfOthers217:=max(Length233,max(Length206,Length241))-min(Length233,min(Length206,Length241));
RangeOfOthers233:=max(Length206,max(Length217,Length241))-min(Length206,min(Length217,Length241));
RangeOfOthers241:=max(Length233,max(Length217,Length206))-min(Length233,min(Length217,Length206));
MinOfRange:=min(RangeOfOthers206,min(RangeOfOthers217,min(RangeOfOthers233,RangeOfOthers241)));
case MinOfRange of
RangeOfOthers206: result:=206;
RangeOfOthers217: result:=217;
RangeOfOthers233: result:=233;
RangeOfOthers241: result:=241;
end;
end;
end;
function OutGate(Color: integer): Boolean;
begin
if GetColor(647, 80) = Color then Result := True;
if not Result then
if GetColor(646, 85) = Color then Result := True;
if not Result then
if GetColor(646, 84) = Color then Result := True;
if not Result then
if GetColor(647, 78) = Color then Result := True;
if not Result then
if GetColor(647, 86) = Color then Result := True;
if not Result then Result := False;
if Result then WriteLn('We are out the Rat Cage!');
end;
procedure WalkToGate;
var DoorColor, t, c, i, tx, ty: integer;
begin
repeat
DoorColor := GetDoorColor;
WriteLn('DoorColor '+inttostr(doorcolor));
if c > 0 then if OutGate(DoorColor) then
begin
MakeCompass('N');
HighestAngle;
Exit;
end
if FindColor(tx, ty, DoorColor, MMX1, MMY1, MMX2, 115) then
begin
MouseFindFlag(tx, ty, -1, -1);
Flag;
MakeCompass('W');
LowestAngle;
for i := 0 to 30 do
begin
MMouse(205 +(i*3), 95 +(i*2), 1, 1);
Wait(200);
if IsUpTextMulti('Open', 'Gate', 'Open Gate') then
begin
GetMousePos(tx, ty);
WriteLn('We found the gate using the DoorColor');
Mouse(tx, ty, 0, 0, True);
MakeCompass('N');
t := 0
repeat
t := t +1;
Wait(500)
until((OutGate(DoorColor)) or (t > 8))
if t <= 8 then
begin
MakeCompass('N');
HighestAngle;
Exit;
end else Break;
end else c := c +1;
end
end else c := c +1
until(c > 20)
WriteLn('Could not find the Gate, Terminating..');
TerminateScript;
end;
procedure RangeRat;
var i, c, Moving: integer; WaitTime: LongInt;
begin
Moving := BitmapFromString(44, 5, 'z78DAB593C10E80200C43' +
'7F494D4CE0B825F2FF9FA4110E23654B55E4D04347CAF60015D12' +
'47AEB72AD52D4381A57B3EC69B5DAF680DFD4497EAA719FAEAA1C' +
'79FB9E3C8103D260F84C65F80B07E8D363557DAB381DFA98D6253' +
'8FEE02C8603DEE32C0EE10B417FB033A4C17738980EF3E9F7CCFC' +
'7D6ABA980331DD4B0ECE2FABD513633738E2');
if not FindObjEx(x, y, 'Attack' ,110, 85, 400, 230, 9213847, 30, 7, 7, 100, True) then WalkToMMArrow;
MakeCompass('W');
repeat
repeat
if ClickRat then
begin
Flag;
Wait(3000);
if GetColor(256, 432) = 8388608 then Mouse(256, 432, 1, 1, True) else Break;
end
c := c +1;
until(c > 50)
if c > 50 then
begin
WriteLn('We could not find a Rat to range, Terminating..');
TerminateScript;
end;
WriteLn('We are ranging');
MarkTime(WaitTime);
repeat
Wait(2000);
if FindBitmapToleranceIn(moving, x, y, 210, 360, 305, 380, 30) then
begin
WriteLn('Ranged a Rat');
MakeCompass('N');
Exit;
end;
until (TimeFromMark(WaitTime) > 40000)
i := i +1;
until i > 5
WriteLn('We took 6 tries to find a rat, but we did not found it');
TerminateScript;
end;
function MyOpenBank: Boolean;
var x, y, fs2: Integer;
begin
MakeCompass('S');
if not BankScreen then
repeat
if (FindObjEx(x, y, 'Use Bank', MSX1, MSY1, MSX2, MSY2, 2171171, 5, 10, 10, 100, True)) then
Mouse(x, y, 4, 4, False)
else
if (FindObjEx(x, y, 'Use Bank', MSX1, MSY1, MSX2, MSY2, 4276296, 10, 10, 10, 100, True)) then
Mouse(x, y, 4, 4, False)
else
if (FindObjEx(x, y, 'Use Bank', MSX1, MSY1, MSX2, MSY2, 540501, 10, 10, 10, 100, True)) then
Mouse(x, y, 4, 4, False);
Wait(250);
if (ClickOption('Use', 1)) then Result := True;
Flag;
fs2 := fs2 + 1;
until (Result) or (fs2 > 5);
MakeCompass('N');
end;
procedure CastStrikes;
var tx, ty, i, c, Almost: integer; WaitTime: LongInt;
begin
Almost := BitmapFromString(34, 3, 'z78DA73727474B2703400023' +
'73727301B99A45C9C804A4B47530B436492181350449074219374' +
'F20BB29B71F9856871CC1020C1CDC4D84879BCE077330E710082B' +
'D8EA3');
repeat
repeat
ClickToContinue;
if GetColor(602, 231) <> 16777215 then repeat Mouse(601, 238, 0, 0, True) until GetColor(602, 231) = 16777215
if FindObjEx(tx, ty, 'Chicken' ,MSX1, MSY1, MSX2, MSY2, 857975, 30, 7, 7, 100, True) then
begin
Mouse(tx, ty, 0, 0, False);
if ChooseOption(x, y, 'Chicken') then Break;
end else if c < 2 then MouseFindFlag(645, 80, -2, -2);
Flag;
c := c +1;
until(c > 50)
if c > 50 then
begin
WriteLn('We could not find a Chicken to mage, Terminating..');
TerminateScript;
end;
WriteLn('We are fighting');
MarkTime(WaitTime);
repeat
Flag;
Wait(2000);
if FindBitmapToleranceIn(Almost, x, y, 185, 360, 240, 380, 30) then Exit;
until (TimeFromMark(WaitTime) > 4000)
i := i +1;
until i > 7
WriteLn('We took 8 tries to kill a Chicken, but it did not work out..');
TerminateScript;
end;
function MsToMin(Ms: LongInt): Integer;
begin
Result := (Ms/1000)/60;
end;
function MsToSec(Ms: LongInt): Integer;
begin
Result := Ms/1000;
end;
procedure RuneScapeGuide;
var TempTime: LongInt;
begin
WriteLn('Making character');
if SmartzCharMaker then SmartzCharacter else NielsMakeChar;
WriteLn('Starting with the RuneScape Guide');
MarkTime(TotalTime);
MarkTime(TempTime);
ClickToContinue;
HighestAngle;
TalkToNpcByArrow('RuneScape Guide');
HandleTalk;
GameTab(11);
Wait(1000);
Mouse(712, 226, 1, 1, True);
Wait(1000);
SetRun(True);
ClickToContinue;
TalkToNpcByArrow('RuneScape Guide');
HandleTalk;
WalkToMMArrow;
OpenDoorAt(1);
ClickToContinue;
WriteLn('Ended the RuneScape Guide');
AddToReport(' RuneScape Guide took: '+ IntToStr(Round(MsToSec(TimeFromMark(TempTime)))) +' sec.');
WriteLn(' ');
end;
procedure SurvivalExpert;
var TempTime: LongInt;
begin
Mouse(665, 105, 1, 1, True);
Flag;
Wait(500);
MarkTime(TempTime);
WriteLn('Starting with the Survival Expert');
TalkToNpcByArrow('Survival Expert');
HandleTalk;
GameTab(4);
ClickToContinue;
Chop(2);
Wait(500);
MakeFire(1);
GameTab(2);
TalkToNpcByArrow('Survival Expert');
HandleTalk;
Fish(2);
ClickToContinue;
CookShrimp(2);
WriteLn('Ended the Survival Expert');
AddToReport(' Survival Expert took: '+ IntToStr(Round(MsToSec(TimeFromMark(TempTime)))) +' sec.');
WriteLn(' ');
end;
procedure MasterChef;
var TempTime: LongInt;
begin
WriteLn('Starting with Master Chef');
MarkTime(TempTime);
WalkToMMArrow;
OpenGateAt(1);
WalkToMMArrow;
OpenDoorAt(2);
SetRun(False);
TalkToNpcByArrow('Master Chef');
HandleTalk;
CookBread(1);
Wait(1000);
GameTab(13);
Wait(1500);
WriteLn('Ended Master Chef');
AddToReport(' Master Chef took: '+ IntToStr(Round(MsToSec(TimeFromMark(TempTime)))) +' sec.');
WriteLn(' ');
end;
procedure QuestGuide;
var TempTime: LongInt;
begin
WriteLn('Starting with the QuestGuide');
MarkTime(TempTime);
WalkToMMArrow;
OpenDoorAt(3);
Wait(1500);
GameTab(13);
DoEmote(Random(5) +1);
Wait(1000);
DoEmote(Random(5) +1);
Wait(1000);
GameTab(12);
SetRun(True);
Wait(1500);
Mouse(650, 30, -1, -1, True);
Wait(3000);
Flag;
Mouse(675, 30, 1, 1, True);
Wait(3000);
Flag;
if not WalkToMMArrow then
begin
Mouse(630, 38, 1, 1, True);
Wait(3000);
Flag;
end
OpenDoorAt(4);
TalkToNpcByArrow('Quest Guide');
HandleTalk;
GameTab(3);
Wait(3000);
TalkToNpcByArrow('Quest Guide');
HandleTalk;
ClimbDownLadder;
WriteLn('Ended the QuestGuide');
AddToReport(' QuestGuide took: '+ IntToStr(Round(MsToSec(TimeFromMark(TempTime)))) +' sec.');
WriteLn(' ');
end;
procedure MiningInstructor;
var TempTime: LongInt;
begin
WriteLn('Starting with the Mining Instructor');
MakeCompass('N');
//SetRun(False);
MarkTime(TempTime);
TalkToNpcByArrow('Mining Instructor');
HandleTalk;
Prospect;
TalkToNpcByArrow('Mining Instructor');
HandleTalk;
Mine(2);
Smelt(1);
TalkToNpcByArrow('Mining Instructor');
HandleTalk;
Smith(1);
WalkToMMArrow;
WriteLn('Ended the Mining Instructor');
AddToReport(' Mining Instructor took: '+ IntToStr(Round(MsToSec(TimeFromMark(TempTime)))) +' sec.');
WriteLn(' ');
end;
procedure CombatInstructor;
var TempTime: LongInt;
begin
WriteLn('Starting with the Combat Instructor');
MarkTime(TempTime);
OpenGateAt(2);
TalkToNpcByArrow('Combat Instructor');
HandleTalk;
GameTab(5);
Wait(1000);
Mouse(650, 430, 2, 2, True);
Wait(2000);
Wield('Dagger');
ClickToContinue;
Wait(2000);
Mouse(485, 39, 1, 1, True);
TalkToNpcByArrow('Combat Instructor');
HandleTalk;
GameTab(5);
Mouse(593, 301, 1, 1, False);
ChooseOption(x, y, 'Remove');
Wait(1500);
GameTab(4);
Wait(1000);
Wield('Sword');
Wait(1000);
Wield('Shield');
Wait(1000);
GameTab(1);
Wait(2000);
WalkToMMArrow;
OpenGateAt(3);
Fight;
WalkToGate;
TalkToNpcByArrow('Combat Instructor');
HandleTalk;
GameTab(4);
Wait(2000);
Wield('Arrows');
Wait(1000);
Wield('Bow');
Wait(2000);
RangeRat;
Mouse(660, 40, 1, 1, True);
Wait(2000);
Flag;
ClimbUpLadder;
WriteLn('Ended the Combat Instructor');
AddToReport(' Combat Instructor took: '+ IntToStr(Round(MsToSec(TimeFromMark(TempTime)))) +' sec.');
WriteLn(' ');
end;
procedure Bank;
var TempTime: LongInt;
begin
WriteLn('Starting with the Bank');
MarkTime(TempTime);
WalkToMMArrow;
MyOpenBank;
Wait(2000);
ClickToContinue;
Wait(1000);
Mouse(261, 399, 2, 2, True);
Wait(3000);
CloseBank;
WalkToMMArrow;
OpenDoorAt(5);
WriteLn('Ended the Bank');
AddToReport(' Bank took: '+ IntToStr(Round(MsToSec(TimeFromMark(TempTime)))) +' sec.');
WriteLn(' ');
end;
procedure FinancialAdvisor;
var TempTime: LongInt;
begin
WriteLn('Starting with the Financial Advisor');
MarkTime(TempTime);
TalkToNpcByArrow('Financial Advisor')
HandleTalk;
WalkToMMArrow;
OpenDoorAt(6);
Mouse(670, 125, 3, 3, True);
Flag;
WalkToMMArrow;
MakeCompass('E');
if FindObjEx(x, y, 'Open', MSX1, MSY1, MSX2, MSY2, 2189191, 10, 3, 3, 100, True) then
begin
Mouse(x, y, 1, 1, False);
ChooseOption(x, y, 'Open');
Flag;
Wait(1000);
end
WriteLn('Ended the Financial Advisor');
AddToReport(' Financial Advisor took: '+ IntToStr(Round(MsToSec(TimeFromMark(TempTime)))) +' sec.');
WriteLn(' ');
end;
procedure BrotherBrace;
var TempTime: LongInt;
begin
WriteLn('Starting with Brother Brace');
MarkTime(TempTime);
TalkToNpcByArrow('Brother Brace');
HandleTalk;
GameTab(6);
Wait(2000);
MakeCompass('N');
TalkToNpcByArrow('Brother Brace');
HandleTalk;
GameTab(8);
Wait(3000);
GameTab(9);
Wait(3000);
TalkToNpcByArrow('Brother Brace');
HandleTalk;
WalkToMMArrow;
OpenDoorAt(7);
MouseFindFlag(685, 118, 2, 2);
Flag;
WriteLn('Ended Brother Brace');
AddToReport(' Brother Brace took: '+ IntToStr(Round(MsToSec(TimeFromMark(TempTime)))) +' sec.');
WriteLn(' ');
end;
procedure MagicInstructor;
var TempTime: LongInt;
begin
WriteLn('Starting with the Magic Instructor');
MarkTime(TempTime);
TalkToNpcByArrow('Magic Instructor');
HandleTalk;
GameTab(7);
Wait(3000);
HandleTalk;
CastStrikes;
TalkToNpcByArrow('Magic Instructor');
Wait(1000);
ClickToContinue;
Wait(1000);
Mouse(257, 397, 2, 2, True);
Wait(1000);
HandleTalk;
Wait(5000);
ClickToContinue;
WriteLn('Ended the Magic Instructor in '+ IntToStr(Round(MsToSec(TimeFromMark(TempTime)))) +' sec, that means...');
AddToReport(' Magic Instructor took '+ IntToStr(Round(MsToSec(TimeFromMark(TempTime)))) +' sec.');
Wait(100);
WriteLn('We made it!! =] Total Time was: '+ IntToStr(Round(MsToMin(TimeFromMark(TotalTime)))) +' mins.');
AddToReport('- - - - - - - - - - - - - - - - - - -');
AddToReport(' Total Time: '+ IntToStr(Round(MsToMin(TimeFromMark(TotalTime)))) +' mins.');
AddToReport('- - - - - - - - - - - - - - - - - - -');
LogOut;
end;
procedure Nielsie95;
begin
ChangeReportWidth(320);
AddToReport('- - - - - - - - - - - - - - - - - - -');
AddToReport(' Nielsie95 Tut Island Runner 0.33');
AddToReport('- - - - - - - - - - - - - - - - - - -');
WriteLn(' ______ ___ _________ ');
Wait(100);
WriteLn('| \ | | ___ / \ ');
Wait(100);
WriteLn('| \ | | | | | __ | ');
Wait(100);
WriteLn('| |\ \ | |__ | | | {__} |______ ');
Wait(100);
WriteLn('| | \ \ | | |____ | | _____ | | _____}');
Wait(100);
WriteLn('| | \ \ | | |__ \ | | / ___} \_____ | | ');
Wait(100);
WriteLn('| | \ \| | |__\ \| | { {___ | | |____ ');
Wait(100);
WriteLn('| | \ | |_____|| |___\_ __ \ ______| |___ \');
Wait(100);
WriteLn('| | \ | |_____ | | __} } / |___} |');
Wait(100);
WriteLn('|___| ___ \_____| _| ___/ |_________| ___/ \__________/______/');
Wait(100);
WriteLn(' |utorial Island Runner \/ersion 0.33');
WriteLn(' ');
end;
begin
ClearDebug;
ClearReport;
SetupSRL;
ActivateClient;
BenMouse := False;
MouseSpeed := 13;
LoadBmps;
Nielsie95;
RuneScapeGuide;
SurvivalExpert;
MasterChef;
QuestGuide;
MiningInstructor;
CombatInstructor;
Bank;
FinancialAdvisor;
BrotherBrace;
MagicInstructor;
end.
anyone think they can help me get this to work or is it a lost cause cuz it's too old?