With Dankness's edits…..
program New;
{.include SRL/srl.scar}
//////// VERSION 1 ////////////////////////////////////////
// Initial release, of course it had some major bugs.
// I fixed most of them in the same version later on.
// still has some bugs to wipe out
////////////////////////////////////////////////////////////
//////// VERSION 2 ////////////////////////////////////////
// Fixed some of your bugs (Flyboy and krazy's suggestion).
// Note the "I cannot reach that" bug is not fixed,
// any suggestions ? - this bug only occur rarely
////////////////////////////////////////////////////////////
///////// SETUP ////////////////////////////////////////
// TUT ISLAND RUNNER v1.0 BY LORAX
// leave you char at clothing if you want the script to choose
// your apperence, othervise choose your own appearence ....
// don't touch any settings, not even brightness with your man
// when you create him, it is supposed to use the rs defaults ..
// have your screen 32 bits
// press run
// sit back and enjoy, note if anything goes wrong give it
// 1 min, it might be able to correct it's mistakes, woaw !
////////////////////////////////////////////////////////////
///////// BUG ////////////////////////////////////////
// If you note any bugs then please make a reply at the
// thread you picked this up from, or tell the guy who gave
// it to you to give you a link to that thread, so you can reply
// If none of this is possible then please mail me at cnn89@msn.com
// note I don't check this mail more than once every 1 or 2 month
////////////////////////////////////////////////////////////
///////// DONATIONS ////////////////////////////////////////
// If you think that this script is kick-ass or if you just
// feel like being nice, you can make a donation to me at
// paypal, my paypal account is claes89@gmail.com
////////////////////////////////////////////////////////////
var
Position, NoPlaceInt: Integer;
const
AllowFemale= false; //Allow your players to be females to..
procedure DeclarePlayers;
begin
HowManyPlayers:= 1;
NumberOfPlayers(HowManyPlayers);
Players[0].Name :='';
Players[0].Pass :='';
Players[0].Nick :='';
Players[0].Active:=True;
end;
function loadBmp(Name: string): Integer;
begin
case LowerCase(Name) of
'minimap arrow':
result:= BitmapFromString(5, 10, 'z78DA73737573713272A33FE9E2E66' +
'8EE4426E9ECE668E24626E9E466696C82937474333774C4450200' +
'18654BF1');
'mainscreen arrow':
result:= BitmapFromString(7, 18, 'z78DA737375737132761B99A48B9BB' +
'3A5D390201DCD078E7476733475A53E69E24C14E9E466696C495D' +
'1200591DC106');
'accept':
result:= BitmapFromString(25, 12, 'z78DA33301805A380D6C01983A49D' +
'1A62543A13ED66F2D43893A57224B88AF8581ED8B0A23C546991D' +
'A9D290855FAE7F7C1590A61070059FE557F');
'continue1':
result:= BitmapFromString(15, 5, 'z78DA33303030707373B27434B5308' +
'49006C822469696E6A628242E95C8226095C86C5C22B8CC87A844' +
'26F19B83CB6452F5E2B7114516C9D7C4E825E06B0A48002A2162D' +
'3');
'continue2':
result:= BitmapFromString(16, 4, 'z78DA7332B2B43437750303274B475' +
'30B4308892202568342E252892C82A49E18115CB6B861004C95C4' +
'9B4F9EDB70D98EC56D48E1408C5E00761A5BDD');
'log':
result:= BitmapFromString(12, 3, 'z78DA6D8CC10DC0200C035702E338F' +
'0045AF61FA955E181443F27C576AEB61C2D54F9C55B9D1D526181' +
'4974508906283001D618102767B2DA6F59B30F8E1FCF69DB39F36' +
'DB97BCC538DD27BC39773EE8FAFD56E7C008EFD2E58');
'tinder box':
result:= BitmapFromString(13, 7, 'z78DAA58F3B0EC0200C43AF4403899' +
'D91B4E5FE47EA77E98084A8233D797A915DA82CDE6362A614154F' +
'7984AE3CD3E3B8073B04E295C1E871C853AD596342411EFFDEF50' +
'80CFAF45F9E822BF746C036DB263DF72E1AFCBC29DBC74304E2DD' +
'B86241825A581CA5B17301');
'wait':
result:= BitmapFromString(16, 4, 'z78DA33303030707373727474B2708' +
'492968EA616860660716412591699C4AFD200C37C4C1114710C93' +
'C914C16B327E5F106F23F126E3520F00C8DE56E4');
'shrimp':
result:= BitmapFromString(12, 4, 'z78DA658D411204210803BFE440207' +
'A5466FCFF93D69539EC96A42A87101A2DB2A4DBCD7143D2CB77AE' +
'88A644B0D27D54366387079EDC1AD075FC5E9DC9CBF10A9BA5151' +
'626878E476B6ECFEF2F677B761E0D1B4BA47972384D57B81A324E' +
'4E26A7C702766F70815731D31B9429A2145CED8FB3BF7F002B543' +
'C1E');
'fire':
result:= BitmapFromString(23, 4, 'z78DA7373430053175313137362480' +
'303907A4C12B77A04C06D0208B891E81E4C1330EDC25449C82FE8' +
'2EC1348D189790AA1297F860700900CBF77C20');
'pot':
result:= BitmapFromString(8, 5, '5F3917887C7CBBB2B1B7AEAE9B8D8D7' +
'D4B20834E2170431CD3CDCDD1CBCBCEC8C8CDC6C5B9B0B0968888' +
'70666570431CE7E4E4E4E0E0E1DDDDD3CDCDC4BDBDAA9F9F90838' +
'2635A5A452911E7E4E4F4F3F3E2DEDECFC9C98E81809083826C41' +
'1C865023804D217D4B207A491E73441D70431C6C411C663C1A');
'bucket':
result:= BitmapFromString(10, 7, 'z78DABD8DC10A82310C835FA' +
'94D936E3BCEFAEFFD1FC9E1F024885EA4F051D226494FEF917F24' +
'173B7B08B2F6AB5764ED9941BB11B86C9C1CDC7D6D762F13C2C78' +
'BBE9CB637770B252F5E2A36781A07228385AD47597D669680F6EE' +
'CD9D09E69041E7279712BD411DA34913F35C773B7C6990B0AF720' +
'E9FFA038F0457D5');
'dough':
result:= BitmapFromString(6, 4, '8E8D698A8A6686856381805F7D7C5C7' +
'6755793926C8E8D698887648383617E7E5E78785995946E90906B' +
'8D8C6788876481805F7D7C5C98977093926C8E8D698A8A6683836' +
'17E7E5E');
'minimap arrow2':
result:= DTMFromString('78DA639CCAC4C020C38002FE033150948111C' +
'40602C6C9409E086E3520C03803C81322A0663690274640CD3420' +
'4F1CBF1A0071310C76');
'copper':
result:= BitmapFromString(6, 6, '00000151260C9546170000010000010' +
'00001000001612E0E884116A24D1AA54F1A0000010000016F3511' +
'884116AF531CB2541CA54F1A0000017D3B13884116A24D1ABC5A1' +
'EBE5B1E0000018B4216884116A9501AC85F20CB61200000019546' +
'17A54F1AB5571DC45E20D76723');
'bar':
result:= BitmapFromString(7, 7, 'z78DA33363632313434C64B9A181AB9' +
'1A9A1B3A1A1A1B5842485C6A3055629243512500B3FA3CB8');
'knife':
result:= BitmapFromString(7, 4, '5B5A058C8B079795090000013425123' +
'425123425123D3C03676605898707979509A5A309342512000001' +
'202000464503676605898707939109A1A009AFAD0B00000138380' +
'3636205858307908E099E9C09A8A609');
'sword':
result:= BitmapFromString(5, 5, '0000010000011B13090000013020209' +
'E9C091610071B1309000001302020908E099E9C09000001302020' +
'3020207D7C07908E09A1A0090000014D4438301803817F07908E0' +
'9A1A009000001');
'shield':
result:= BitmapFromString(9, 9, 'z78DA3376357234343046269D8CCC0D' +
'DCB090E646A6062E509218F5F4D485AC7E70DA45B12E2333434B0' +
'3D498C2A51749BD9181A1998101009B50695A');
'well done':
result:= BitmapFromString(16, 8, 'z78DA73727274B53472228B3400023' +
'7375245E8633E441C99C469BEA3A3938523844451091127C25504' +
'DC86693E920879BEC6224E96F9F86387181F6192F8C39C72F3316' +
'D41B111AF4B30550200EDC0B5D6');
'arrows':
result:= BitmapFromString(10, 7, 'z78DA3376317433303634357032800' +
'04308690C1687B20D8C8010531C972E12C471988C4B1C93A48F8D' +
'282A49B511432FA92E010073395349');
'bow':
result:= BitmapFromString(6, 6, 'z78DA7DCE3B0EC0300803D02B391853' +
'654C3FF7BF52A364A18A1A903CF80D00F42961AAAA39317A6C95B' +
'0BE33F72AF7C6F357C36FB77C31EBE793830FB46A901724B240B3' +
'790148F42AD2');
'moving on':
result:= BitmapFromString(19, 8, 'z78DA73727474B2703400023737274' +
'B47530B43088929E204568922824942D4E025A126E3308D287B89' +
'B00527498C8DD4B28B3C1B31ED25CF2548BA50C21C4916228E4C6' +
'2DA85298EC534FC36E2F53515D21EF16918BF8D44C41DA9261325' +
'8E6417003756D483');
'almost':
result:= BitmapFromString(16, 7, 'z78DA73727274B5347282908E8E4E1' +
'68E50D2D2D1D4C210993400023737143578D543495CEA317441CD' +
'C765CE809A0FD18B4C62DA85298EA90B1789DF1C6A8993EA7EE2C' +
'571B1099883375E20E200EBC99D6E');
end;
end;
function GetEmptySlot(var i: Integer): Boolean;
begin
GameTab(4);
for i:= 1 to 28 do
begin
if(not ExistsItem(i))then
result:= true;
if(result)then
Exit;
end;
end;
procedure TMouse(mousex, mousey, ranx, rany : Integer; left : Boolean); // By Mutant Squirrle
var
a, b, c : Integer;
begin
if (smooth) then
begin
if BenMouse then
MMouse(mousex, mousey, ranx, rany)
else
MMouse(mousex, mousey, ranx, rany);
Wait(150 + Random(50));
GetMousePos(b, c);
HoldMouse(b + 1, c, left);
repeat
Wait(10 + Random(40));
a := a + 1;
until (a > 4);
GetMousePos(b, c);
ReleaseMouse(b, c, left);
end;
if (not smooth) then
begin
if BenMouse then
MMouse(mousex, mousey, ranx, rany)
else
MMouse(mousex, mousey, ranx, rany);
Wait(150 + Random(50));
GetMousePos(b, c);
ClickMouse(b, c, left);
end;
Wait(clicktiming + Random(clicktimingran));
end;
function ClickMinimapArrow: Boolean;
var
bmpMinimapArrow, tx, ty, Counter: Integer;
begin
bmpMinimapArrow:= loadBmp('Minimap arrow');
repeat
if(FindBitmapToleranceIn(bmpMinimapArrow, tx, ty, 575, 8, 720, 160, 20))then
result:= true;
Wait(20 + Random(10));
Counter:= Counter + 1;
until(result)or
(Counter = 20);
if(result)then
begin
TMouse(tx + 3, ty + 15, 0, 0, true);
Wait(100);
if(not FlagPresent)then
TMouse(tx + 3, ty + 15, 0, 0, true);
flag;
end;
Wait(700);
FreeBitmap(bmpMinimapArrow);
end;
function ClickMainscreenArrow: Boolean;
var
bmpMainscreenArrow, tx, ty, Counter: Integer;
begin
bmpMainscreenArrow:= loadBmp('Mainscreen arrow');
repeat
if(FindBitmapToleranceIn(bmpMainscreenArrow, tx, ty, 1, 1, 550, 336, 20))then
result:= true;
Wait(20 + Random(10));
Counter:= Counter + 1;
until(result)or
(Counter = 20);
if(result)then
MouseFlag(tx + 4, ty + 35, 0, 0);
FreeBitmap(bmpMainscreenArrow);
end;
function AtPos: Integer;
var
Hue, Saturation, Luminance, MaxLum: Extended;
begin
MaxLum:= 37;
ColortoHSL(GetColor(427, 308), Hue, Saturation, Luminance); //magic
if(Luminance > MaxLum)then
begin
result:= 10;
Exit;
end;
ColortoHSL(GetColor(385, 308), Hue, Saturation, Luminance); //prayer
if(Luminance > MaxLum)then
begin
result:= 9;
Exit;
end;
ColortoHSL(GetColor(344, 308), Hue, Saturation, Luminance); //bank
if(Luminance > MaxLum)then
begin
result:= 8;
Exit;
end;
ColortoHSL(GetColor(258, 308), Hue, Saturation, Luminance); //fight
if(Luminance > MaxLum)then
begin
result:= 7;
Exit;
end;
ColortoHSL(GetColor(218, 308), Hue, Saturation, Luminance); //mine
if(Luminance > MaxLum)then
begin
result:= 6;
Exit;
end;
ColortoHSL(GetColor(197, 308), Hue, Saturation, Luminance); //quest
if(Luminance > MaxLum)then
begin
result:= 5;
Exit;
end;
ColortoHSL(GetColor(175, 308), Hue, Saturation, Luminance); //run
if(Luminance > MaxLum)then
begin
result:= 4;
Exit;
end;
ColortoHSL(GetColor(134, 307), Hue, Saturation, Luminance); //cook
if(Luminance > MaxLum)then
begin
result:= 3;
Exit;
end;
ColortoHSL(GetColor(91, 308), Hue, Saturation, Luminance); //fish
if(Luminance > MaxLum)then
begin
result:= 2;
Exit;
end;
ColortoHSL(GetColor(75, 308), Hue, Saturation, Luminance); //cloth
if(Luminance > 22)and(Luminance < MaxLum)or
(Luminance < MaxLum)then
begin
result:= 1;
Exit;
end;
end;
procedure ChangeGender;
begin
TMouse(460, 290, 10, 10, true);
end;
function AcceptVisible: Boolean;
var
bmpAccept, tx, ty: Integer;
begin
bmpAccept:= loadBmp('Accept');
result:= FindBitmapToleranceIn(bmpAccept, tx, ty, 240, 275, 285, 300, 20);
FreeBitmap(bmpAccept);
end;
procedure PressAccept;
var
bmpAccept, tx, ty: Integer;
begin
bmpAccept:= loadBmp('Accept');
if(FindBitmapToleranceIn(bmpAccept, tx, ty, 240, 275, 285, 300, 20))then
TMouse(tx, ty, 10, 10, true);
Wait(400 + Random(300));
FreeBitmap(bmpAccept);
end;
procedure ChooseCloth;
var
ranVal, Clicks, Counter: Integer;
begin
ranVal:= Random(2);
if(ranVal = 1)and(AllowFemale)then
ChangeGender;
for Counter:= 0 to 6 do
begin
ranVal:= Random(9);
while ranVal > Clicks do
begin
TMouse(165, 90 + 35 * Counter, 5, 5, true);
Clicks:= Clicks + 1;
Wait(300 + Random(300));
end;
Clicks:= 0;
end;
for Counter:= 0 to 4 do
begin
ranVal:= Random(14);
while ranVal > Clicks do
begin
TMouse(470, 95 + 35 * Counter, 10, 10, true);
Clicks:= Clicks + 1;
Wait(300 + Random(300));
end;
Clicks:= 0;
end;
PressAccept;
end;
function ContinueTalk: Boolean;
var
bmpContinue1, bmpContinue2, tx, ty: Integer;
begin
bmpContinue1:= loadBmp('Continue1');
bmpContinue2:= loadBmp('Continue2');
if(FindBitmapToleranceIn(bmpContinue1, tx, ty, 120, 430, 320, 460, 30))or
(FindBitmapToleranceIn(bmpContinue2, tx, ty, 120, 430, 320, 460, 30))then
begin
TMouse(270, 447, 10, 3, true);
Wait(1500 + Random(400));
result:= true;
end;
FreeBitmap(bmpContinue1);
FreeBitmap(bmpContinue2);
end;
procedure TalkAlong;
begin
repeat
Wait(1);
until(not ContinueTalk)or
(not LoggedIn);
end;
function TalkToArrow: Boolean;
var
bmpMainscreenArrow, tx, ty, Counter, Counter2: Integer;
tmpresult: Boolean;
begin
bmpMainscreenArrow:= loadBmp('Mainscreen arrow');
repeat
Counter:= 0;
tmpresult:= false;
repeat
if(FindBitmapToleranceIn(bmpMainscreenArrow, tx, ty, 1, 1, 550, 336, 20))then
tmpresult:= true;
Wait(20 + Random(10));
Counter:= Counter + 1;
until(tmpresult)or
(Counter = 20);
if(tmpresult)then
begin
TMouse(tx + 4, ty + 35, 0, 0, false);
Wait(100);
if(ChooseOption(tx, ty, 'Talk'))then
result:= true;
end;
Counter2:= Counter2 + 1;
Wait(20);
until(result)or
(Counter2 = 5)or
(not LoggedIn);
flag;
Wait(1200 + Random(300));
TalkAlong;
FreeBitmap(bmpMainscreenArrow);
end;
function ActionWithArrow(Action: string; WaitTime, RandTime: Integer): Boolean;
var
bmpMainscreenArrow, tx, ty, Counter, Counter2: Integer;
tmpresult: Boolean;
begin
bmpMainscreenArrow:= loadBmp('Mainscreen arrow');
repeat
Counter:= 0;
tmpresult:= false;
repeat
if(FindBitmapToleranceIn(bmpMainscreenArrow, tx, ty, 1, 1, 550, 336, 20))then
tmpresult:= true;
Wait(20 + Random(10));
Counter:= Counter + 1;
until(tmpresult)or
(Counter = 20);
if(tmpresult)then
begin
TMouse(tx + 4, ty + 35, 0, 0, false);
Wait(100);
if(ChooseOption(tx, ty, Action))then
result:= true;
end;
Counter2:= Counter2 + 1;
Wait(20);
until(result)or
(Counter2 = 5)or
(not LoggedIn);
flag;
Wait(WaitTime + Random(RandTime));
FreeBitmap(bmpMainscreenArrow);
end;
procedure DoClothing;
begin
WriteLn('Clothing');
if(not LoggedIn)then Exit;
if(AcceptVisible)then
ChooseCloth;
if(not LoggedIn)then Exit;
ClickMinimapArrow;
if(not LoggedIn)then Exit;
TalkToArrow;
if(not LoggedIn)then Exit;
ClickMinimapArrow;
if(not LoggedIn)then Exit;
MakeCompass('w');
if(not LoggedIn)then Exit;
ActionWithArrow('Open', 1000, 500);
if(not LoggedIn)then Exit;
MakeCompass('n');
if(not LoggedIn)then Exit;
end;
procedure OpenBagFirstTime;
begin
GameTab(4);
Wait(50 + Random(30));
end;
procedure TalkToSurvival;
var
tx, ty: Integer;
begin
repeat
Wait(20);
if(not LoggedIn)then Exit;
until(FindObj3(tx, ty, 'Talk', 3421807, 15));
TMouse(tx, ty, 0, 0, false);
if(not ChooseOption(tx, ty, 'Talk'))then
begin
ClickMinimapArrow;
TalkToSurvival;
end;
flag;
Wait(2000);
TalkAlong;
end;
procedure CutDownTree;
var
tx, ty, Counter, sCount: Integer;
begin
GameTab(4);
sCount:= InventoryCount;
if(FindObj(tx, ty, 'Chop', 806976, 15))then
MouseFlag(tx, ty, 3, 3);
Counter:= 0;
repeat
Wait(20);
Counter:= Counter + 1;
until(sCount <> InventoryCount)or
(not LoggedIn)or(Counter = 250);
if(Counter = 250)then
begin
CutDownTree;
Exit;
end;
end;
procedure CutDownTree2;
var
Counter, sCount: Integer;
begin
GameTab(4);
sCount:= InventoryCount;
ClickMainscreenArrow;
Counter:= 0;
repeat
Wait(20);
Counter:= Counter + 1;
until(sCount <> InventoryCount)or
(not LoggedIn)or(Counter = 250);
if(Counter = 250)then
begin
CutDownTree2;
Exit;
end;
end;
procedure LightTree;
var
bmpLog, bmpTinderBox, bmpWait,
tx, ty, sCount, Counter: Integer;
begin
bmpLog:= loadBmp('Log');
bmpTinderBox:= loadBmp('Tinder box');
bmpWait:= loadBmp('wait');
GameTab(4);
sCount:= InventoryCount;
if(FindBitmapToleranceIn(bmpLog, tx, ty, 555, 205, 745, 465, 15))then
begin
TMouse(tx, ty, 3, 3, true);
if(FindBitmapToleranceIn(bmpTinderBox, tx, ty, 555, 205, 745, 465, 15))then
begin
TMouse(tx, ty, 3, 3, true);
repeat
Wait(15);
Counter:= Counter + 1;
until(InventoryCount <> sCount)or
(Counter = 60);
if(Counter = 60)then
begin
TMouse(645 + NoPlaceInt, 78, 0, 0, true);
MouseFlag(645 + NoPlaceInt, 78, 0, 0);
if(NoPlaceInt < 0)then
NoPlaceInt:= NoPlaceInt - 5;
if(NoPlaceInt = 15)then
NoPlaceInt:= -5;
if(NoPlaceInt >= 0)then
NoPlaceInt:= NoPlaceInt + 5;
LightTree;
Exit;
end;
Wait(400 + Random(300));
while FindBitmapToleranceIn(bmpWait, tx, ty, 147, 352, 399, 390, 20) do
Wait(30);
Wait(300 + Random(50));
end else
WriteLn('Couldn''t find tinderbox');
end else
WriteLn('Couldn''t find log');
FreeBitmap(bmpLog);
FreeBitmap(bmpTinderBox);
FreeBitmap(bmpWait);
NoPlaceInt:= 0;
end;
procedure OpenStatFirstTime;
begin
GameTab(2);
Wait(300 + Random(300));
end;
procedure FishThemShrimps;
var
tx, ty, i, Counter: Integer;
begin
GameTab(4);
if(not GetEmptySlot(i))then
begin
for Counter:= 3 to 28 do
DropItem(Counter);
GetEmptySlot(i);
end;
if(FindObj3(tx, ty, 'Net', 15382680, 10))then
MouseFlag(tx, ty, 0, 0);
Wait(1000);
repeat
Wait(20);
until(ExistsItem(i))or
(not LoggedIn);
end;
procedure CookShrimp;
var
bmpShrimp, tx, ty, ix, iy, tx1,
ty1, tx2, ty2, bmpFire: Integer;
begin
bmpShrimp:= loadBmp('Shrimp');
bmpFire:= loadBmp('Fire');
tx1:= 255; ty1:= 145;
tx2:= 280; ty2:= 170;
GameTab(4);
repeat
if(FindColorTolerance(ix, iy, 3249609, tx1, ty1, tx2, ty2, 7))then
begin
if(FindBitmapToleranceIn(bmpShrimp, tx, ty, 555, 205, 745, 465, 15))then
begin
TMouse(tx, ty, 0, 0, true);
Wait(100);
TMouse(ix, iy, 0, 0, false);
Wait(500 + Random(300));
if(FindBitmapToleranceIn(bmpFire, tx, ty, 1, 1, 550, 336, 20))then
begin
TMouse(tx - 20, ty , 10, 0, true);
Wait(2200 + Random(300));
end;
Wait(300 + Random(100));
end;
Wait(20);
end;
tx1:= tx1 - 10; ty1:= ty1 - 5;
tx2:= tx2 + 10; ty2:= ty2 + 5;
if(tx2 > 400)or(ty1 < 20)then
begin
tx1:= 255; ty1:= 145;
tx2:= 280; ty2:= 170;
end;
Wait(10);
until(not LoggedIn)or
(FindColorTolerance(tx, ty, 615589, 555, 205, 745, 465, 2));
FreeBitmap(bmpShrimp);
FreeBitmap(bmpFire);
end;
procedure DoFishing;
begin
WriteLn('Fishing');
if(not LoggedIn)then Exit;
ClickMinimapArrow;
if(not LoggedIn)then Exit;
TalkToArrow;
if(not LoggedIn)then Exit;
OpenBagFirstTime;
if(not LoggedIn)then Exit;
ClickMinimapArrow;
if(not LoggedIn)then Exit;
CutDownTree2;
if(not LoggedIn)then Exit;
LightTree;
if(not LoggedIn)then Exit;
OpenStatFirstTime;
if(not LoggedIn)then Exit;
Wait(300 + Random(300));
if(not LoggedIn)then Exit;
ClickMinimapArrow;
if(not LoggedIn)then Exit;
TalkToArrow;
if(not LoggedIn)then Exit;
ClickMinimapArrow;
if(not LoggedIn)then Exit;
Wait(200);
if(not LoggedIn)then Exit;
FishThemShrimps;
if(not LoggedIn)then Exit;
FishThemShrimps;
if(not LoggedIn)then Exit;
AngleWalker(20, 20);
if(not LoggedIn)then Exit;
Flag;
if(not LoggedIn)then Exit;
CutDownTree;
if(not LoggedIn)then Exit;
LightTree;
if(not LoggedIn)then Exit;
CookShrimp;
if(not LoggedIn)then Exit;
CookShrimp;
if(not LoggedIn)then Exit;
ClickMinimapArrow;
if(not LoggedIn)then Exit;
ClickMinimapArrow;
if(not LoggedIn)then Exit;
ActionWithArrow('Open', 1000, 500);
if(not LoggedIn)then Exit;
WriteLn('Done fishing');
end;
procedure MixAndCookDough;
var
bmpPot, bmpBucket, bmpDough, tx, ty: Integer;
begin
bmpPot:= loadBmp('Pot');
bmpBucket:= loadBmp('Bucket');
bmpDough:= loadBmp('Dough');
if(FindBitmapToleranceIn(bmpPot, tx, ty, 555, 205, 745, 465, 15))then
begin
TMouse(tx + 5, ty + 5, 3, 3, true);
if(FindBitmapToleranceIn(bmpBucket, tx, ty, 555, 205, 745, 465, 15))then
begin
TMouse(tx + 10, ty + 10, 3, 3, true);
Wait(2000 + Random(500));
if(FindBitmapToleranceIn(bmpDough, tx, ty, 555, 205, 745, 465, 15))then
begin
ClickMinimapArrow;
TMouse(tx, ty, 3, 3, true);
Wait(300 + Random(300));
ClickMainscreenArrow;
Wait(2000 + Random(500));
end;
end;
end;
FreeBitmap(bmpPot);
FreeBitmap(bmpBucket);
FreeBitmap(bmpDough);
end;
procedure OpenMusic;
begin
TMouse(738, 484, 10, 10, true);
Wait(400 + Random(200));
end;
procedure DoCooking;
begin
WriteLn('Cooking');
if(not LoggedIn)then Exit;
ClickMinimapArrow;
if(not LoggedIn)then Exit;
ClickMainscreenArrow;
if(not LoggedIn)then Exit;
Wait(500 + Random(250));
if(not LoggedIn)then Exit;
TalkToArrow;
if(not LoggedIn)then Exit;
MixAndCookDough;
if(not LoggedIn)then Exit;
Wait(500);
if(not LoggedIn)then Exit;
OpenMusic;
if(not LoggedIn)then Exit;
ClickMinimapArrow;
if(not LoggedIn)then Exit;
ClickMainscreenArrow;
if(not LoggedIn)then Exit;
end;
function ClickMinimapArrow2(Dist: Integer): Boolean;
var
dtmMinimapArrow, tx, ty, Counter: Integer;
Angle: Extended;
begin
dtmMinimapArrow:= loadBmp('Minimap arrow2');
repeat
if(FindDTMRotated(dtmMinimapArrow, tx, ty, 575, 8, 720, 160, 0, 360, 5, Angle))then
result:= true;
Wait(20 + Random(10));
Counter:= Counter + 1;
until(result)or
(Counter = 20);
if(result)then
HumanMouseFlag(tx + 3, ty + 15, 0, 0, Dist);
FreeDTM(dtmMinimapArrow);
end;
procedure DoRunning;
begin
WriteLn('Running');
SetRun(true);
if(not LoggedIn)then Exit;
Wait(400 + Random(200));
if(not LoggedIn)then Exit;
ClickMinimapArrow2(20);
if(not LoggedIn)then Exit;
ClickMinimapArrow2(0);
if(not LoggedIn)then Exit;
ClickMinimapArrow;
if(not LoggedIn)then Exit;
ClickMainscreenArrow;
if(not LoggedIn)then Exit;
end;
procedure DoQuest;
begin
WriteLn('Questing');
if(not LoggedIn)then Exit;
ClickMinimapArrow;
if(not LoggedIn)then Exit;
TalkToArrow;
if(not LoggedIn)then Exit;
GameTab(3);
if(not LoggedIn)then Exit;
TalkToArrow;
if(not LoggedIn)then Exit;
ClickMinimapArrow;
if(not LoggedIn)then Exit;
ActionWithArrow('Climb', 4000, 500);
if(not LoggedIn)then Exit;
end;
procedure TalkToDaMiner;
begin
if(not ClickMinimapArrow)then
begin
AngleWalker(200, 55);
repeat
Wait ( 20 );
if ( not ( LoggedIn )) then Exit;
until ( ClickMinimapArrow );
end;
ClickMinimapArrow;
TalkToArrow;
end;
procedure ProspectSieRocks;
begin
ClickMinimapArrow;
ActionWithArrow('Prospect', 5000, 2000);
ClickMinimapArrow;
ActionWithArrow('Prospect', 5000, 2000);
end;
procedure MineRock;
var
sCount, Counter: Integer;
begin
sCount:= InventoryCount;
ClickMainscreenArrow;
repeat
Wait(30);
Counter:= Counter + 1;
until(Counter = 100)or
(sCount <> InventoryCount)or
(not LoggedIn);
if(Counter = 100)then
begin
MineRock;
Exit;
end;
end;
procedure MineRocks;
begin
ClickMinimapArrow;
MineRock;
ClickMinimapArrow;
MineRock;
end;
procedure SmeltBar;
var
bmpCopper, tx, ty: Integer;
begin
bmpCopper:= loadBmp('Copper');
if(FindBitmapToleranceIn(bmpCopper, tx, ty, 555, 205, 745, 465, 15))then
begin
TMouse(tx, ty, 3, 3, true);
Wait(400 + Random(200));
ClickMainscreenArrow;
Wait(2000 + Random(500));
end;
FreeBitmap(bmpCopper);
end;
procedure MakeKnife;
var
bmpBar, tx, ty: Integer;
begin
bmpBar:= loadBmp('Bar');
if(FindBitmapToleranceIn(bmpBar, tx, ty, 555, 205, 745, 465, 20))then
begin
TMouse(tx, ty, 3, 3, true);
Wait(400 + Random(200));
ClickMainscreenArrow;
Wait(1000 + Random(200));
TMouse(61, 83, 3, 3, true);
Wait(3000 + Random(500));
end else
WriteLn('Couldn''t find bar');
FreeBitmap(bmpBar);
end;
procedure OpenGate;
var
tx, ty: Integer;
begin
repeat
if ( not ( LoggedIn )) then Exit;
repeat
WWait ( 500 );
if ( not ( LoggedIn )) then Exit;
until ( FindObj3(tx, ty, 'Open', 7960965, 7));
Mouse (tx, ty, 3, 3, False);
until ( ChooseOption ( tx, ty, 'O'));
Flag;
WWait(1500);
end;
procedure DoMining;
begin
WriteLn('Mining');
if(not LoggedIn)then Exit;
TalkToDaMiner;
if(not LoggedIn)then Exit;
ProspectSieRocks;
if(not LoggedIn)then Exit;
ClickMinimapArrow;
if(not LoggedIn)then Exit;
TalkToArrow;
if(not LoggedIn)then Exit;
MineRocks;
if(not LoggedIn)then Exit;
ClickMinimapArrow;
if(not LoggedIn)then Exit;
SmeltBar;
if(not LoggedIn)then Exit;
ClickMinimapArrow;
if(not LoggedIn)then Exit;
TalkToArrow;
if(not LoggedIn)then Exit;
ClickMinimapArrow;
if(not LoggedIn)then Exit;
MakeKnife;
if(not LoggedIn)then Exit;
ClickMinimapArrow;
if(not LoggedIn)then Exit;
OpenGate;
if(not LoggedIn)then Exit;
end;
procedure OpenWield;
begin
GameTab(5);
end;
procedure WieldKnife;
var
bmpKnife, tx, ty: Integer;
begin
bmpKnife:= loadBmp('Knife');
GameTab(4);
if(FindBitmapToleranceIn(bmpKnife, tx, ty, 555, 205, 745, 465, 15))then
begin
TMouse(tx, ty, 3, 3, true);
Wait(1500 + Random(500));
end;
FreeBitmap(bmpKnife);
end;
procedure WieldWeapons;
var
bmpSword, bmpShield, tx, ty: Integer;
begin
bmpSword:= loadBmp('Sword');
bmpShield:= loadBmp('Shield');
GameTab(4);
Wait(1500);
if(FindBitmapToleranceIn(bmpSword, tx, ty, 555, 205, 745, 465, 25))then
begin
TMouse(tx, ty, 3, 3, true);
Wait(1500 + Random(500));
end;
if(FindBitmapToleranceIn(bmpShield, tx, ty, 555, 205, 745, 465, 25))then
begin
TMouse(tx, ty, 3, 3, true);
Wait(1500 + Random(500));
end;
FreeBitmap(bmpSword);
FreeBitmap(bmpShield);
end;
procedure OpenAttack;
begin
GameTab(1);
end;
procedure AttackRat;
var
tx, ty, bmpWellDone: Integer;
begin
bmpWellDone:= loadBmp('Well done');
repeat
if(FindObj(tx, ty, 'Attack', 5517874, 7))then
begin
MouseFlag(tx, ty, 0, 0);
Wait(1000);
repeat
Wait(20);
until(not FindColor(tx, ty, 65280, 230, 135, 270, 160));
end;
Wait(100);
if(not LoggedIn)then Exit;
until(FindBitmapToleranceIn(bmpWellDone, tx, ty, 105, 350, 215, 390, 20));
FreeBitmap(bmpWellDone);
end;
procedure OpenFightGate;
begin
MakeCompass('w');
OpenGate;
end;
procedure WieldBowAndArrows;
var
bmpArrows, bmpBow, tx, ty: Integer;
begin
bmpArrows:= loadBmp('Arrows');
bmpBow:= loadBmp('Bow');
GameTab(4);
Wait(1500);
if(FindBitmapToleranceIn(bmpArrows, tx, ty, 555, 205, 745, 465, 25))then
begin
TMouse(tx, ty, 3, 3, true);
Wait(1500 + Random(500));
end;
if(FindBitmapToleranceIn(bmpBow, tx, ty, 555, 205, 745, 465, 25))then
begin
TMouse(tx, ty, 3, 3, true);
Wait(1500 + Random(500));
end;
FreeBitmap(bmpArrows);
FreeBitmap(bmpBow);
end;
function MovingOn : Boolean;
var
tx, ty, s:integer;
begin
s := CreateBitmapMaskFromText('Moving', npcchars);
Result := FindBitmapMaskTolerance(s, tx, ty, 9, 348, 523, 471, 50, 10);
FreeBitmap(s);
end;
procedure UnEquipBow;
begin
GameTab (5);
WWait ( 1000 );
Mouse ( 685, 266, 5, 5, True);
WWait ( 1000 );
Mouse ( 590, 307, 5, 5, True);
WWait ( 1000 );
GameTab ( 4);
end;
procedure RangeRat;
var
tx, ty : Integer;
begin
repeat
repeat
Wait(20);
until(ClickMinimapArrow);
if(FindObj(tx, ty, 'Attack', 5517874, 7))then
begin
MouseFlag(tx, ty, 0, 0);
Wait(1000);
repeat
Wait(20);
until(not FindColor(tx, ty, 65280, tx - 20, ty - 20, tx + 20, ty + 20));
end;
until MovingOn;
UnEquipBow;
end;
procedure DoFighting;
begin
WriteLn('Fighting');
if(not LoggedIn)then Exit;
ClickMinimapArrow;
if(not LoggedIn)then Exit;
TalkToArrow;
if(not LoggedIn)then Exit;
Wait(400);
if(not LoggedIn)then Exit;
OpenWield;
if(not LoggedIn)then Exit;
Wait(400);
if(not LoggedIn)then Exit;
OpenBagFirstTime;
if(not LoggedIn)then Exit;
WieldKnife;
if(not LoggedIn)then Exit;
Wait(400);
if(not LoggedIn)then Exit;
TalkToArrow;
if(not LoggedIn)then Exit;
WieldWeapons;
if(not LoggedIn)then Exit;
Wait(400);
if(not LoggedIn)then Exit;
OpenAttack;
if(not LoggedIn)then Exit;
Wait(1500 + Random(300));
if(not LoggedIn)then Exit;
ClickMinimapArrow;
if(not LoggedIn)then Exit;
OpenFightGate;
if(not LoggedIn)then Exit;
AttackRat;
if(not LoggedIn)then Exit;
OpenFightGate;
if(not LoggedIn)then Exit;
MakeCompass('n');
if(not LoggedIn)then Exit;
ClickMinimapArrow;
if(not LoggedIn)then Exit;
TalkToArrow;
if(not LoggedIn)then Exit;
WieldBowAndArrows;
if(not LoggedIn)then Exit;
RangeRat;
if(not LoggedIn)then Exit;
ClickMinimapArrow2(20);
if(not LoggedIn)then Exit;
ClickMinimapArrow;
if(not LoggedIn)then Exit;
ClickMainscreenArrow;
if(not LoggedIn)then Exit;
end;
procedure OpenDieBank;
begin
TalkToArrow;
Wait(400 + Random(300));
TMouse(255, 398, 0, 0, true);
Wait(2000);
end;
procedure DoBanking;
begin
WriteLn('Banking');
if(not LoggedIn)then Exit;
ClickMinimapArrow;
if(not LoggedIn)then Exit;
OpenDieBank;
if(not LoggedIn)then Exit;
CloseWindow;
if(not LoggedIn)then Exit;
ActionWithArrow('Open', 1500, 500);
if(not LoggedIn)then Exit;
TalkToArrow;
if(not LoggedIn)then Exit;
ClickMainscreenArrow;
end;
procedure OpenDoor2;
var
tx, ty: Integer;
begin
if(FindObj(tx, ty, 'Open', 1058627, 7))then
MouseFlag(tx, ty, 0, 0);
Wait(600 + Random(500));
end;
procedure OpenPrayer;
begin
GameTab(6);
Wait(800 + Random(300));
end;
procedure OpenFriendAndIgnore;
begin
TMouse(583, 481, 2, 2, true);
Wait(400 + Random(300));
TMouse(609, 482, 2, 2, true);
Wait(800 + Random(300));
end;
procedure DoPrayer;
begin
WriteLn('Praying');
if(not LoggedIn)then Exit;
AngleWalker(170, 60);
if(not LoggedIn)then Exit;
Flag;
if(not LoggedIn)then Exit;
ClickMinimapArrow;
if(not LoggedIn)then Exit;
OpenDoor2;
if(not LoggedIn)then Exit;
ClickMinimapArrow;
if(not LoggedIn)then Exit;
TalkToArrow;
if(not LoggedIn)then Exit;
OpenPrayer;
if(not LoggedIn)then Exit;
TalkToArrow;
if(not LoggedIn)then Exit;
OpenFriendAndIgnore;
if(not LoggedIn)then Exit;
TalkToArrow;
if(not LoggedIn)then Exit;
ClickMinimapArrow;
if(not LoggedIn)then Exit;
ClickMainscreenArrow;
if(not LoggedIn)then Exit;
end;
procedure OpenMagic;
begin
GameTab(7);
Wait(1200 + Random(300));
end;
procedure KillChicken;
var
tx, ty, bmpAlmost: Integer;
begin
bmpAlmost:= loadBmp('Almost');
repeat
TMouse(564, 225, 2, 2, true);
Wait(100);
Flag;
Wait(300 + Random(100));
ActionWithArrow('Cast', 200, 100);
until(SimilarColors(GetColor(564, 255), 2500134, 2))or
(FindBitmapToleranceIn(bmpAlmost, tx, ty, 180, 350, 245, 390, 20));
if(SimilarColors(GetColor(564, 255), 2500134, 2))then
begin
if(FindObj(tx, ty, 'Talk', 6502405, 7))then
MouseFlag(tx, ty, 0, 0);
Wait(800 + Random(100));
TalkAlong;
KillChicken;
Exit;
end;
end;
procedure GoToMainLand;
begin
Wait(1000 + Random(200));
TMouse(256, 398, 0, 0, true);
Wait(1000 + Random(200));
TalkALong;
Wait(6000 + Random(1000));
end;
procedure DoSayOutYourPassword;
begin
WriteLn('Tell aloud your password');
if(not LoggedIn)then Exit;
AngleWalker(140, 60);
if(not LoggedIn)then Exit;
Flag;
if(not LoggedIn)then Exit;
ClickMinimapArrow2(20);
if(not LoggedIn)then Exit;
ClickMinimapArrow;
if(not LoggedIn)then Exit;
TalkToArrow;
if(not LoggedIn)then Exit;
OpenMagic;
if(not LoggedIn)then Exit;
TalkALong;
if(not LoggedIn)then Exit;
ClickMinimapArrow;
if(not LoggedIn)then Exit;
KillChicken;
if(not LoggedIn)then Exit;
ClickMinimapArrow;
if(not LoggedIn)then Exit;
TalkToArrow;
if(not LoggedIn)then Exit;
GoToMainLand;
if(not LoggedIn)then Exit;
NextPlayer(false);
end;
procedure GetScreenUp;
begin
KeyDown(VK_UP);
Wait(600 + Random(300));
KeyUp(VK_UP);
end;
begin
SetupSRL;
ActivateClient;
Wait(300);
GetScreenUp;
repeat
Position:= 0;
Position:= AtPos;
case Position of
1: DoClothing;
2: DoFishing;
3: DoCooking;
4: DoRunning;
5: DoQuest;
6: DoMining;
7: DoFighting;
8: DoBanking;
9: DoPrayer;
10: DoSayOutYourPassword;
end;
if(not LoggedIn)then NextPlayer(false);
Wait(200 + Random(200));
until(false);
end.