SCAR Code:
program Flax picker;
var
bk1,bk2,bk3,bk4,px,py,BeeKeepers:integer;
procedure bkDtms;
begin
bk1:= DTMFromString('78DA637CCFC0C010C08002AE5FBAC8C00FA41' +
'9A17CC63740C20E55CDC553A750D5DC02129EA86A5E3C7D8AAAE6' +
'2C9088475573E7FA755435DC40561CAA9A2533A6A3AA01B1BC50D' +
'5ECDEB001450D004BC013DD');;
bk2:=DTMFromString('78DA639CC8C0C010C880020EEDDCC1C00FA41' +
'9A17CC6D3986AD62C5880AA662990484355B36BE3465435AB31D5' +
'6C5FB31A55CD464C355B56AE4055B30D53CDBA850B51D59C0712E' +
'9A86A66F6F761AA89425533A1AD0D554D2FA69A5DEBD7A3AAE9C3' +
'74CFD1BD7B51D4000064E81F19');
bk4:= DTMFromString('78DA63BCCBC0C060C780028EEDDBC7C00FA41' +
'9A17C460920CB0155CD9A050B50D5480359EEA86AA67476A2AAB9' +
'0524DC50D56C5BB31A55CD43201185AAE6C0F66DA86A8481AC105' +
'4353BD6AE4155F3034878A0AA59347D3A8A1A0009451441');
bk3:=DTMFromString('78DA63DCC8C0C050C880020EEEDCC1C00FA41' +
'9A17CC63740221F55CDDA850B51D5BC071215A86AA67476A2AAB9' +
'0E249A51D5CCECEF4355730E4834A0AA1115124255B31648B4A1A' +
'AD9B97E1DA67B5A51D5CC993811450D0020E41535');
end;
procedure bkSetup;
begin
bkDtms;
end;
function FindBeeKeeper:boolean;
var
ct:integer;
begin
ct:=0;
repeat
ct:=ct+1;
until(FindColorTolerance(x,y,14802401,163, 96,427, 255,ct));
MMouse(x,y,0,0);
wait(100+random(50));
Result:=IsUpText('per');
if(Result) then wait(100+random(50));
end;
function OpenWin:boolean;
begin
if(not(IsUpText('per'))) then FindBeeKeeper else GetMousePos(x,y);
Mouse(x,y,0,0,true);
wait(10);
Flag;
MMouse(296, 447,10,1);
wait(1000+random(100));
while(FindColor(x,y,16777215,23, 437,394, 461)) do begin
Mouse(296, 447,10,1,true);
wait(1000+random(200));
end;
Result:=true;
wait(1000+random(500));
end;
procedure DoneBk;
begin
MMouse(254, 270,3,3);
getmousepos(x,y);
wait(200+random(100));
Mouse(x,y,0,0,true);
wait(1000);
repeat
wait(100);
until(FindColor(x,y,16711680,23, 437,394, 461));
Wait(1000+random(500));
BeeKeepers:=BeeKeepers+1;
WriteLn('Solved Bee Keeper!');
end;
function FindPiece(piece:integer):boolean;
var
fpMark:longint;
begin
MarkTime(fpMark);
repeat
wait(100);
if(TimeFromMark(fpMark)>40000) then Exit;
until(FindDtm(piece,px,py,23, 29 ,426, 224));
Result:=True;
end;
function ClickPiece(piece:integer):boolean;
begin
if(not(FindPiece(piece))) then Exit;
Mouse(px+5,py+10,1,1,true);
wait(800+random(100));
Result:=True;
end;
procedure ClickArrow(arrow:integer);
begin
if(arrow=1) then Mouse(141, 275,5,5,true);
if(arrow=2) then Mouse(194, 269,5,5,true);
if(arrow=3) then Mouse(314, 273,5,5,true);
if(arrow=4) then Mouse(361, 271,5,5,true);
end;
function MovePiece(mx,my,piece:integer):boolean;
begin
if(not(ClickPiece(piece))) then Exit;
Result:=True;
while(px<mx) do begin
ClickArrow(4);
wait(900+random(100));
px:=px+15;
end;
while(py<my) do begin
ClickArrow(2);
wait(900+random(100));
py:=py+15;
end;
while(px>mx+16) do begin
ClickArrow(3);
wait(900+random(100));
px:=px-15;
end;
while(py>my+16) do begin
ClickArrow(1);
wait(900+random(100));
py:=py-15;
end;
end;
function FixPiece(piece:integer):boolean;
begin
if(piece=1) then begin
Result:=MovePiece(84, 62,bk1);
end;
if(piece=2) then begin
Result:=MovePiece(61, 165,bk2);
end;
if(piece=3) then begin
Result:=MovePiece(350, 47,bk3);
end;
if(piece=4) then begin
Result:=MovePiece(350, 158,bk4);
end;
end;
function SolvePiece(piece:integer):boolean;
begin
if(piece=1) then begin
Result:=MovePiece(259,29,bk1);
end;
if(piece=2) then begin
Result:=MovePiece(222,82,bk2);
end;
if(piece=3) then begin
Result:=MovePiece(224,141,bk3);
end;
if(piece=4) then begin
Result:=MovePiece(224,190,bk4);
end;
end;
function FixPieces:boolean;
begin
if(not(FixPiece(2))) then Exit;
if(not(FixPiece(4))) then Exit;
if(not(FixPiece(3))) then Exit;
if(not(FixPiece(1))) then Exit;
Result:=True;
end;
function MovePieces:boolean;
begin
if(not(SolvePiece(2))) then Exit;
if(not(SolvePiece(4))) then Exit;
if(not(SolvePiece(3))) then Exit;
if(not(SolvePiece(1))) then Exit;
Result:=True;
end;
procedure SolveBeeKeeper;
begin
OpenWin;
if(not(FixPieces)) then begin
WriteLn('Error solving bee keeper, Trying Again');
Mouse(497, 17,3,3,true);
SolveBeeKeeper;
end;
if(not(MovePieces)) then begin
WriteLn('Error solving bee keeper, Trying Again');
Mouse(497, 17,3,3,true);
SolveBeeKeeper;
end;
DoneBk;
end;
function BeeKeeper:boolean;
begin
if(GetColor(649, 78)=0) then begin
WriteLn('Middle of mm black, checking for bee keeper');
wait(3000+random(200));
if(FindBeeKeeper) then begin
WriteLn('Found Bee Keeper, Trying to solve');
Result:=True;
SolveBeeKeeper;
end;
end;
end;
//****************************************************//
var
Bankers,TreeSymbolColor,MMFlaxColor,FinalMinutesPerPlayer,BankBooth,TotalLoads,Direction,TreeSymbolBmp:integer;
PlayerStartMark,StartScriptMark,LastAntiBan,NextAntiBan:longint;
const
FlaxColor=940041;
MinutesPerPlayer=20;
RandomMinutesPerPlayer=10;
Version=13;
AntiBanRandTime=120000;
procedure CheckVersion;
begin
if(Version=strtoint(GetPage('http://dontpanic0.googlepages.com/FlaxPickerVersion.txt'))) then begin
WriteLn('You have the latest version!');
end else begin
WriteLn('You''re version is outdated. Please download');
WriteLn('the latest version from:');
WriteLn('dontpanic0.googlepages.com/FlaxPicker.scar');
TerminateScript;
end;
end;
procedure SetupScript;
begin
ClearDebug;
CheckVersion;
SetupSRL;
MouseSpeed:=7;
Direction:=random(2);
bkSetup;
CheckHPFirst:=true;
StartPlayers(true,'');
TotalLoads:=0;
Bankers:= DTMFromString('78DA632C62626070654001FFFE09337001694' +
'6289FB109A18605979A3622D4F413A1A610A8C607550D4C16AEA6' +
'920835AD44A8E923AC0600FC7C0EEF');
MMFlaxColor:=0;
BankBooth := DTMFromString('78DA63E4676460E8654001610E9C0C5C409A1' +
'1CA6704A96985B0B9A062011E3E986AEA51D574E61860AAA94455' +
'33A13907450D00C80806C0');
TreeSymbolBmp:=BitmapFromString(3, 11, 'z78DAA58D3B0EC0300843CF6487267' +
'42C22DCFF48FD7861AF8727EB0964944F14790D0E113F4CF7D8D3' +
'51E19191076C30D5C5495BCCF47CF35137EA2C2E5A37A27E71623' +
'F5B8D3707C82CDB');
ActivateClient;
wait(500);
MarkTime(StartScriptMark);
end;
function FindBankers(var x,y:integer):boolean;
begin
Result:=FindDtm(Bankers,x,y,MMX1,MMY1,MMX2,MMY2);
end;
procedure AlignCompass;
var
Used:boolean;
begin
Used:=False;
while(not(FindBankers(x,y))) do begin
Used:=True;
if(Direction=0) then KeyDown(vk_left)
else KeyDown(vk_right);
repeat
wait(30+random(10));
until(FindBankers(x,y));
if(Direction=0)then KeyUp(vk_left)
else KeyUp(vk_right);
if(Direction=0) then Direction:=1
else Direction:=0;
wait(300+random(100));
end;
if(Used)then begin
if(Direction=0) then Direction:=1
else Direction:=0;
end;
end;
procedure FindRands2;
begin
BeeKeeper;
FindDead;
FindMime;
FindMaze;
FindQuiz;
FindDemon;
FindScapeRune;
FindLamp(LampSkill);
if (FindNewBox) then SolveBox;
end;
function FindWestFlax(var x,y:integer):boolean;
var
i:integer;
begin
i:=574;
repeat
i:=i+1;
if(i=721)then begin
Result:=false;
Exit;
end;
until(FindColor(x,y,MMFlaxColor,i,MMY1,i+1,MMY2));
Result:=True;
end;
function FindNorthFlax(var x,y:integer):boolean;
var
i:integer;
begin
i:=8;
repeat
i:=i+1;
if(i=170)then begin
Result:=false;
Exit;
end;
until(FindColor(x,y,MMFlaxColor,MMX1,i,MMX2,i));
Result:=True;
end;
function FindFlax(var x,y:integer):boolean;
var
tx,ty,i:integer;
begin
Result:=False;
if(FindNorthFlax(i,ty) and FindWestFlax(tx,i)) then begin
x:=tx;
y:=ty;
Result:=True;
end;
end;
procedure RunFromFight;
begin
FindFlax(x,y);
Mouse(x,y,0,0,true);
FFlag(10);
FindFlax(x,y);
Mouse(x-30,y,0,0,true);
FFlag(10);
wait(5000+random(5000));
FindFlax(x,y);
Mouse(x,y,0,0,true);
wait(50+random(50));
Flag;
end;
procedure FindRands1;
begin
if(FindTalk) then FindRands2;
if(FindFight) then begin
RunFromFight;
end;
end;
procedure GetTreeSymbolColor;
begin
FindDeformed(x,y,TreeSymbolBmp,MMX1,MMY1,MMX2,MMY2);
TreeSymbolColor:=GetColor(x,y);
WriteLn('Tree symbol color: '+inttostr(TreeSymbolColor));
end;
function FindTreeSymbol(a:integer;var x,y:integer):boolean;
var
tx,ty,i:integer;
begin
i:=a-1;
repeat
i:=i+1;
if(i=170) then begin
Result:=False;
Exit;
end;
until(FindColor(tx,ty,TreeSymbolColor,MMX1,i,MMX2,i));
Result:=True;
x:=tx;
y:=ty;
end;
procedure GetMMFlaxColor;
var
tol,fx,fy,BaseColor:integer;
begin
BaseColor:=11884646;
tol:=-1;
repeat
tol:=tol+1;
until(FindColorTolerance(fx,fy,BaseColor,648, 83,MMX2,MMY2,tol));
MMFlaxColor:=GetColor(fx,fy);
WriteLn('MM flax color: '+inttostr(MMFlaxColor));
end;
procedure Error(n:integer);
begin
WriteLn('Error: '+inttostr(n));
Logout;
end;
procedure ToFlax;
begin
if(not(FindTreeSymbol(80,x,y))) then begin
Error(1);
Exit;
end;
Mouse(x-15,y,0,0,true);
SetRun(true);
FFlag(10);
if(not(FindTreeSymbol(60,x,y))) then begin
Error(2);
Exit;
end;
Mouse(x-20,y+50,0,0,true);
GameTab(4);
FFlag(10);
if(not(FindTreeSymbol(80,x,y))) then begin
Error(3);
Exit;
end;
Mouse(x+20,y+40,0,0,true);
FFlag(10);
if(not(FindTreeSymbol(20,x,y))) then begin
Error(4);
Exit;
end;
Mouse(x+40,y+80,0,0,true);
FFlag(10);
if(MMFlaxColor=0) then GetMMFlaxColor;
if(not(FindFlax(x,y))) then begin
Error(5);
Exit;
end;
Mouse(x+10,y+10,0,0,true);
FFlag(10);
end;
procedure ToBank;
begin
if(not(FindFlax(x,y))) then begin
Error(6);
Exit;
end;
Mouse(x,y+30,0,0,true);
SetRun(False);
FFlag(20);
if(not(FindFlax(x,y))) then begin
Error(7);
Exit;
end;
Mouse(x-30,y,0,0,true);
FFlag(20);
if(not(FindFlax(x,y))) then begin
Error(8);
Exit;
end;
Mouse(x-60,y-40,0,0,true);
wait(2500);
FFlag(20);
if(not(FindTreeSymbol(40,x,y))) then begin
Error(10);
Exit;
end;
Mouse(x+10,y-40,0,0,true);
wait(2500);
FFlag(20);
if(not(FindTreeSymbol(20,x,y))) then begin
Error(11);
Exit;
end;
Mouse(x-15,y-20,0,0,true);
FFlag(20);
if(not(FindTreeSymbol(50,x,y))) then begin
Error(12);
Exit;
end;
Mouse(x-10,y-40,0,0,true);
Flag;
wait(400+random(200));
end;
procedure PickFlag;
var
FlagBegin:LongInt;
begin
MarkTime(FlagBegin);
while(FlagPresent) do begin
wait(10+random(10));
if(TimeFromMark(FlagBegin)>4000) then
Exit;
end;
end;
procedure PickFlax;
var
i:integer;
done:boolean;
begin
x:=276;
y:=164;
i:=-1;
done:=false;
repeat
i:=i+1;
if(i>9) then begin
if(FindObj(x,y,'lax',941321,20)) then begin
Mouse(x,y,0,0,true);
Wait(50+random(50));
PickFlag;
wait(400+random(200));
Exit;
end;
end;
if(i=20) then begin
FindRands2;
end;
if(i=30) then begin
WriteLn('Error finding flax.');
Logout;
Exit;
end;
if(FindColorSpiralTolerance(x,y,FlaxColor,MSX1,MSY1,MSX2,MSY2,i)) then begin
MMouse(x,y,0,0);
wait(50+random(50));
if(IsUpTextMulti('Pic','lax','Fla')) then begin
done:=true;
HoldMouse(x,y,true);
wait(30+random(20));
ReleaseMouse(x,y,true);
wait(50+random(40));
PickFlag;
wait(400+random(200));
end;
end;
until(done or not(LoggedIn));
end;
procedure ArrowKeys;
begin
KeyDown(vk_down);
wait(300+random(500));
KeyUp(vk_down);
wait(300+random(200));
HighestAngle;
end;
procedure RandomChat;
var
Text:string;
begin
case random(58) of
00: Text:='gah this is so boring';
01: Text:='i bet ive got more flax then u';
03: Text:='farming lvls?';
04: Text:='im going for a million flax!';
05: Text:='im goin for a billion flax :)';
06: Text:='gah i hate all the dumb noob lvl 3s';
07: Text:='this is my flax field everyone leave';
08: Text:='so much flax';
09: Text:='selling flax in bank only 500 each!';
10: Text:='free flax!!! haha jk';
11: Text:='ill kill any1 who steals my flax';
12: Text:='maybe i should sell this flax now';
13: Text:='maybe il sell flax on forums';
14: Text:='ur all noobs';
15: Text:='boring.....';
16: Text:='what times it there?';
17: Text:='asdfghjk;';
18: Text:='qwertyuiop[]';
19: Text:='zxcvbnm,./';
20: Text:='look @ my cards: []]]]]]]]]]]]]]]]]]';
21: Text:='pick a card []]]]]]]]]]]]]]]]]]]]]]';
22: Text:='im so sad :( my cat died today';
23: Text:='my dog died today :(';
24: Text:='i got a pet dog today =)';
25: Text:='i have a dog, how bout you?';
26: Text:='i have a cat, how about you?';
27: Text:='i got a pet cat today but it bit me lol';
28: Text:='lol noob';
29: Text:='i own all you';
30: Text:='blahh so bored lol';
31: Text:='press 111 if youo like pures';
32: Text:='who likes dueling?';
33: Text:='who likes pkin?';
34: Text:='why does this take so long';
35: Text:='why doesnt jagex put a bank in the middle of here?';
36: Text:='i want to do a minigame soon';
37: Text:='-.- so bored';
38: Text:='picking flax is boring =(';
39: Text:='Firefox is so awsome';
40: Text:='i hate internet explorer';
41: Text:='i hate windows';
42: Text:='yall should use firefox';
43: Text:='i hate internet explorer';
44: Text:='linux is awsome';
45: Text:='whos your fav band?';
46: Text:='ipods are so cool';
47: Text:='i wanna get an iphone there ownage';
48: Text:='gahh i think my computer got viruses';
49: Text:='im infected';
50: Text:='some fansite gave me viri';
51: Text:='lollolllll so bored';
52: Text:='white:loading... please wait';
53: Text:='white:connection lost... attempting to reestablish';
54: Text:='laggggg';
55: Text:='the new loading update is so cool';
56: Text:='green:||||||||||||||';
57: Text:='red:||||||||||||||';
end;
TypeSend(Text);
wait(300+random(100));
end;
procedure RunOn;
begin
SetRun(true);
GameTab(4);
end;
procedure RandomTab;
begin
GameTab(1+random(11));
wait(600+random(300));
GameTab(4);
end;
procedure HoverRandomSkill;
begin
case random(9) of
0: HoverSkill('attack',false);
1: HoverSkill('defence',false);
2: HoverSkill('strength',false);
3: HoverSkill('woodcutting',false);
4: HoverSkill('mining',false);
5: HoverSkill('hitpoints',false);
6: HoverSkill('prayer',false);
7: HoverSkill('magic',false);
8: HoverSkill('crafting',false);
end;
end;
procedure AntiBan;
begin
case random(8) of
0: ArrowKeys;
1: SleepAndMoveMouse(1000+random(500));
2: RandomChat;
3: RunOn;
4: PickUpMouse;
5: RandomTab;
6: AlmostLogout;
7: HoverRandomSkill;
end;
end;
procedure AntiBanIfNeeded;
begin
if(TimeFromMark(LastAntiBan)>=NextAntiBan) then begin
AntiBan;
MarkTime(LastAntiBan);
NextAntiBan:=random(AntiBanRandTime);
end;
end;
procedure FillInv;
begin
repeat
PickFlax;
FindRands1;
AntiBanIfNeeded;
until(not(LoggedIn) or InventoryFull);
end;
procedure FindObjBank;
var
i:integer;
begin
repeat
if((i=0)or(i=3)or(i=6)or(i=9)) then if FindObj(x,y,'Use',541530,10) then Mouse(x,y,0,0,false);
if((i=1)or(i=4)or(i=7)or(i=10)) then if FindObj(x,y,'oth',541530,10) then Mouse(x,y,0,0,false);
if((i=2)or(i=5)or(i=8)) then if FindObj(x,y,'Bank b',541530,10) then Mouse(x,y,0,0,false);
i:=i+1;
if(i=10) then begin
Logout;
WriteLn('Took too many tries to find the bank booth');
end;
until(ClickOption('Use-quickly',1)or(not(LoggedIn)));
end;
function DtmBank:boolean;
begin
if(not(FindDtm(BankBooth,x,y,167, 0 ,327, 336))) then
Exit;
MMouse(x,y-3,0,0);
wait(50+random(30));
if(not(IsUpTextMulti('oth','Use','Bank B'))) then Exit;
Mouse(x,y,0,0,false);
if(ClickOption('Use-quickly',1)) then Result:=true;
end;
procedure BankFlax;
begin
if(not(DtmBank)) then FindObjBank;
if(not(LoggedIn)) then Exit;
repeat
wait(50+random(50));
until(BankScreen)or(not(LoggedIn));
if(LoggedIn)then begin
Deposit(1,28,2);
MMouse(480, 35,10,10);
GetMousePos(x,y);
wait(50+random(50));
Mouse(x,y,0,0,true);
wait(100+random(100));
end;
end;
procedure ProgressReport;
var
CheckPlayer:integer;
ActivePlayers:string;
Flax,FlaxPerHour,TimeInHours:extended;
begin
TotalLoads:=TotalLoads+1;
Flax:=TotalLoads*28;
TimeInHours:=TimeFromMark(StartScriptMark)/3600000;
FlaxPerHour:=Flax/TimeInHours;
ActivePlayers:='';
for CheckPlayer:=0 to (HowManyPlayers-1) do begin
if(Players[CheckPlayer].Active=True) then begin
ActivePlayers:=ActivePlayers+(Players[CheckPlayer].Name)+',';
end;
end;
WriteLn('L flax picker');
WriteLn('Worked for: '+inttostr(trunc(TimeInHours))+' hours and '+inttostr(trunc((TimeInHours-(trunc(TimeInHours)))*60))+' minutes');
WriteLn('Loads: '+inttostr(TotalLoads));
WriteLn('Flax: '+inttostr(trunc(Flax)));
WriteLn('Flax Per Hour: '+inttostr(trunc(FlaxPerHour)));
WriteLn('Bee Keepers Solved: '+inttostr(BeeKeepers));
WriteLn('Players in use: '+ActivePlayers);
WriteLn('|||||||||||||||||||||||||||||||||||');
end;
begin
SetupScript;
if(LoggedIn) then Logout;
LoginPlayer;
HighestAngle;
GetTreeSymbolColor
repeat
FinalMinutesPerPlayer:=MinutesPerPlayer+random(RandomMinutesPerPlayer);
MarkTime(PlayerStartMark);
repeat
AlignCompass;
if(LoggedIn) then ToFlax;
MarkTime(LastAntiBan);
NextAntiBan:=random(AntiBanRandTime);
if(LoggedIn) then FillInv;
if(LoggedIn) then ToBank;
if(LoggedIn) then BankFlax;
if(LoggedIn) then ProgressReport;
until(not(LoggedIn)) or (TimeFromMark(PlayerStartMark)>=(FinalMinutesPerPlayer*60000));
NextPlayer(LoggedIn);
until(false);
end.