SRL Archive - Help and Support

My lame attempt at an auto flax0r


Buckleyindahouse

2007-01-18 19:18:34

Well, I was bored and I decided to try to make an autoflax0r. I finished up the basics and just wanted to test. Didn't add randoms or antiban yet just wanted to see if it would atleast pick and bank. But when i start it , it just skips the walking and immediatly tries to find the flax. here is script any suggestions?


Program BuckleysFl0xor;



{.include srl/srl.scar}
{.include srl/srl/extended/xmapwalk.scar}

Const InvFlax = 0;//color of flax in inventory...leave at 0 for autopick
Const GroundFlax = 0;//color of flax on the ground
Const TripsToDo = 45;//trips to do
Const BankSymbol = 0;//color of bank symbol....leave at 0 for autopick
Const TreeSymbol = 0;//color of tree symbol....leave at 0 for autopick
Const HowMuchFlax = 500;



Var
TreeColor,BankColor1,FlaxInvColor : Integer;
Flax,Xp,Cash : Integer;

Procedure SetFlax0r;
Begin
If Not (LoggedIn) Then
LoginPlayer;
LowestAngle;
SetChat('On',1);
SetChat('Off',2);
SetChat('Off',3);
SetRun(True);
End;


Procedure GetBankSymbolColor;
Begin
If(BankSymbol > 0) Then
Begin
BankColor1 := BankSymbol;
End;
If(BankSymbol = 0) Then
Begin
BankColor1 := GetSymbolColor(x,y,'bank');
WriteLn('Bank symbol color is '+IntToStr(BankColor));
End;
End;



Procedure GetTreeSymbolColor;
Begin
If(TreeSymbol > 0) Then
Begin
TreeColor := TreeSymbol;
End;
If(BankSymbol = 0) Then
Begin
TreeColor := TreeSymbol;
WriteLn('Tree Symbol color is '+IntToStr(TreeSymbol));
End;
End;


Procedure GetFlaxInvColor;
Begin
If(InvFlax > 0) Then
Begin
FlaxInvColor := InvFlax;
End;
If(InvFlax = 0) Then
Begin
FlaxInvColor := GetColor(597,268);
WriteLn('Flax color in the inventory is '+IntToStr(FlaxInvColor));
End;
End;



Procedure WalkToFlax1;
Begin
AddToReport('Path 1');
If Not (FindSymbol(x,y,'bank')) Then
Begin
WriteLn('Bank is too crowded...find world with less people please');
LogOut;
TerminateScript;
If(FindSymbol(x,y,'bank')) Then
Begin
SetRun(True);
LowestAngle;
PerfectNorth;
wait(25+random(15));
RadialRoadWalk(RoadColor,185,545,34,0,1);
Flag;
RadialWalk(RoadColor,195,555,55,0,1);
Flag;
RadialWalk(RoadColor,189,549,51,0,1);
Flag;
RadialWalk(RoadColor,160,520,45,0,1);
Flag;
RadialWalk(RoadColor,164,524,47,0,1);
Flag;
RadialWalk(RoadColor,141,501,24,0,1);
Flag;
End;
End;
End;


Procedure WalkToFlax2;
Begin
AddToReport('Path 2');
If Not (FindSymbol(x,y,'bank')) Then
Begin
WriteLn('Bank is too crowded...find world with less people please');
LogOut;
TerminateScript;
If(FindSymbol(x,y,'bank')) Then
Begin
SetRun(True);
LowestAngle;
PerfectNorth;
RadialWalk(RoadColor,173,533,64,0,1);
Flag;
RadialWalk(RoadColor,192,552,64,0,1);
Flag;
RadialWalk(RoadColor,118,478,66,0,1);
Flag;
RadialWalk(RoadColor,129,489,40,0,1);
Flag;
End;
End;
End;




Procedure RandomFlax0r;
Begin
Case Random(2) Of

0 : Begin
Mouse(x,y,1,1,True);
Flag;
End;

1 : Begin
Mouse(x,y,1,1,False);
wait(15+random(35));
ChooseOption(x,y,'Pick');
Flag;
End;
End;
End;




Procedure PickFlax;
begin
WriteLn('Now picking flax');
wait(25+random(15));
repeat
If(FindObj3(x,y,'Pick',GroundFlax,10)) Then
RandomFlax0r;
//DamnRandoms;
until(InvCount = 28) Or (IsChatMessage('carry'))
End;


Procedure BankFlax1;
Begin
If Not(InvCount = 28) Then
Begin
PickFlax;
End
Else
If(InvCount = 28) Then
Begin
WriteLn('Full load of flax done');
RadialWalk(RoadColor,342,702,57,0,1);
Flag;
RadialWalk(RoadColor,319,679,50,0,1);
Flag;
RadialWalk(RoadColor,5,365,68,0,1);
Flag;
RadialRoadWalk(RoadColor,12,372,55,0,1);
Flag;
If Not (FindSymbol(x,y,'bank')) Then
LogOut;
Wait(15000+random(10000));
LoginPlayer;
If(FindSymbol(x,y,'bank')) Then
Mouse(x,y,2,2,True);
Flag;
End
Else
If(FindSymbol(x,y,'bank')) Then
Mouse(x,y,3,3,True);
Flag;
End;

Procedure BankFlax2;
Begin
If Not(InvCount = 28) Then
Begin
PickFlax;
End
Else
If(InvCount = 28) Then
Begin
WriteLn('Full load of flax done');
RadialWalk(RoadColor,290,650,47,0,1);
Flag;
RadialWalk(RoadColor,329,689,66,0,1);
Flag;
RadialWalk(RoadColor,333,693,51,0,1);
Flag;
RadialWalk(RoadColor,17,377,54,0,1);
Flag;
If Not (FindSymbol(x,y,'bank')) Then
LogOut;
Wait(15000+random(10000));
LoginPlayer;
If(FindSymbol(x,y,'bank')) Then
Mouse(x,y,2,2,True);
Flag;
End
Else
If(FindSymbol(x,y,'bank')) Then
Mouse(x,y,3,3,True);
Flag;
End;




Procedure BankFlax;
Begin
Repeat
If(FindObj(x,y,'booth',542559,10)) Then
Mouse(x,y,2,2,False);
ChooseOption(x,y,'quickly');
Until(BankScreen)
DepositAll;
Flax := 28;
Xp := 420;
Cash := 4760;
End;



Procedure SetColors;
Begin
Wait(150+random(150));
WriteLn('Getting inventory flax colors');
GetFlaxInvColor;
wait(150+random(150));
WriteLn('Getting bank color');
GetBankSymbolColor;
Wait(150+random(150));
GetTreeSymbolColor;
End;


Procedure Guesser;
Begin
Case Random(2) of

0 : Begin
WalkToFlax1;
PickFlax;
BankFlax1;
End;


1 : Begin
WalkToFlax2;
PickFlax;
BankFlax2;
End;
End;
End;


Procedure MainLoop;
Begin
SetUpSRL;
//DeclarePlayers;
SetFlax0r;
SetColors;
repeat
repeat
Guesser;
Until(Flax > HowMuchFlax)
LogOut;
NextPlayer(True);
until(False)
TerminateScript;
End;

Begin
MainLoop;
End.

As i said before i didnt add randoms or antiban just wanted to see if it worked.

XcanadamanX

2007-01-18 20:02:23

for this
Procedure WalkToFlax2;
Begin
AddToReport('Path 2');
If Not (FindSymbol(x,y,'bank')) Then
Begin
WriteLn('Bank is too crowded...find world with less people please');
LogOut;
TerminateScript;
If(FindSymbol(x,y,'bank')) Then
Begin
SetRun(True);
LowestAngle;
PerfectNorth;
RadialWalk(RoadColor,173,533,64,0,1);
Flag;
RadialWalk(RoadColor,192,552,64,0,1);
Flag;
RadialWalk(RoadColor,118,478,66,0,1);
Flag;
RadialWalk(RoadColor,129,489,40,0,1);
Flag;
End;
End;
End;
you dont need to put flag;
and arn't you sopposed to use rrw for road walking?
another thing:
Procedure WalkToFlax2;
Begin
AddToReport('Path 2');
If Not (FindSymbol(x,y,'bank')) Then
Begin
WriteLn('Bank is too crowded...find world with less people please');
LogOut;
TerminateScript;
End; //put end here
If(FindSymbol(x,y,'bank')) Then
Begin
SetRun(True);
LowestAngle;
PerfectNorth;
RadialRoadWalk(RoadColor,173,533,64,0,1);
//Flag;
RadialRoadWalk(RoadColor,192,552,64,0,1);
//Flag;
RadialRoadWalk(RoadColor,118,478,66,0,1);
//Flag;
RadialRoadWalk(RoadColor,129,489,40,0,1);
//Flag;
End;
End;
i think you only had to put that end in there. try it now but change the other walktoflax too.

Buckleyindahouse

2007-01-18 20:14:12

Do u know why it skips the walking and goes straight to picking flax inside the bank?

YoHoJo

2007-01-19 16:20:49

you should make a DTM for this

Const InvFlax = 0;//color of flax in inventory…leave at 0 for autopick

and use findsymbol procedures instread of colors for this (more accurate)
Const BankSymbol = 0;//color of bank symbol….leave at 0 for autopick
Const TreeSymbol = 0;//color of tree symbol….leave at 0 for autopick