SRL Archive - OSR Help

How to add Walking and Banking function to my script?


FarmerKyle

2012-05-27 23:19:01

I wanted to make a Magic Tree Cutter at the Mage Arena because nobody else had yet. I had a little knowledge in Java programming, but none in SRL. I was hoping that someone could let me know how…
1) I could make my character walk to the bank and deposit there.
2) How I could make my character walk to the 2nd Magic Tree after they cut down the first one, and vice versa.

Here is the script if you want to look at it (I know it's very bad but it's my first time ever programming in simba)

program MagiCutter;

{$i srl/srl/misc/Smart.simba}
{$i srl/srl.simba}
{$i SRL/SRL/Misc/Reports.simba}
{$i srl/srl/misc/paintsmart.simba}
{$i sps/sps.simba}

CONST
SRLStats_Username = '';// Your SRL Stats Username
SRLStats_Password = '';// Your SRL Stats Password
BreakEvery = '120';//How often would you like to take a break (minutes)
BreakFor = '10';//How long would you like to break for
Version = '1.0';
NumbOfPlayers = 1;//How many players are autoing
StartPlayer = 0;//Player to start autoing with (0 is first player)




procedure DeclarePlayers;
var i: integer;
begin
NumberOfPlayers(NumbofPlayers);
CurrentPlayer := StartPlayer;
for i :=0 to NumbofPlayers-1 do
Players [i]. BoxRewards := ['mote', 'ostume', 'XP', 'Gem', 'ithril', 'oal', 'une', 'oins'];

with Players[0] do
begin
Name := ''; //Player Username
Pass := ''; //Player Password
Nick := ''; //Player nickname (3-4 letters of Username)
Active := True;
end;
end;


Procedure StatsGuise (wat:String);
Begin
Status(wat);
Disguise(wat);
End;

Function CheckAndClick(UpText, Option:String; X,Y:Integer; RClick:Boolean) :Boolean;
Begin
MMouse(x, y, 5, 5);
If WaitUptext(UpText, 1500+Random(500)) Then
Begin
Result:=True;
GetMousePos(x, y);
If RClick Then
Begin
Mouse(x, y, 0, 0, False);
Result:= WaitOption(Option, 2000);
If Result Then FFlag(0);
End Else
Begin
Mouse(x, y, 0, 0,True);
Wait(100+Random(50));
FFlag(0);
End;
End;
End;


Procedure Antiban;
Begin
Case Random(250) Of
0: Begin StatsGuise('AntiBan') GameTab (tab_Stats) HoverSkill ('Woodcutting', False) GameTab(28) End;
1: Begin StatsGuise('AntiBan') SleepAndMoveMouse(7000 + Random(500)); End;
2: Begin StatsGuise('AntiBan') GameTab(tab_Inv) ExamineInv; GameTab(28); End;
3: Begin StatsGuise('AntiBan') RandomAngle(1); End;
4: Begin StatsGuise('AntiBan') GameTab(Tab_Stats); Wait(3000 + Random(500)); GameTab (28); End;
5: Begin StatsGuise('AntiBan') GameTab(Tab_Stats); HoverSkill('random', False); GameTab(28); End;
end;
end;

Procedure FailSafe(Reason:String);
Begin
Players[CurrentPlayer].Loc:=Reason;
Logout;
Stats_Commit;
//ProgressReport;
TerminateScript;
End;

procedure SetCustomAngle(Highest: Boolean);
begin
KeyDown((Integer(not Highest) * 2) + 38);
Sleep(1000 + Random(300));
KeyUp((Integer(not Highest) * 2) + 38);
end;


Function
Chopper:Boolean;
Var
x, y, TreeCounter: Integer;
Begin
If FindObjCustom(x, y, ['Chop', 'down', 'p d'], [5133915, 4673893, 2697515], 15) Then
Begin
StatsGuise('Found Magic Tree');
GetMousePos(x, y);
Case Random(2) Of
0: Mouse(x, y, 5, 5, True);
1: Begin
Mouse(x, y, 5, 5, False);
Wait(100 + Random(100));
ChooseOption('Chop');
end;
end;

Flag;

Repeat
MarkTime(TreeCounter);
Antiban;
Wait(15000);
Until (TimeFromMark(TreeCounter) > 120000 + Random(30000)) OR (InvFull);

end;
end;





















begin
SetupSRL;
DeclarePlayers;
Repeat
Chopper;
Until(False);

end.

Abu

2012-05-28 00:31:28

Take a look at some tutorials on walking:

http://villavu.com/forum/search.php?searchid=2087098


And for Banking functions.

- Open Simba
- Type 'openbank' into your functions list
- Double click one of the functions that come up
- Now you will have a list of banking functions

FarmerKyle

2012-05-28 12:19:17

thanks for the bank function didn't know about that. Also, is there a specific type of walking that is more effective than another? Or are they all essentially the same?

Abu

2012-05-28 12:22:07

From: FarmerKyle
thanks for the bank function didn't know about that. Also, is there a specific type of walking that is more effective than another? Or are they all essentially the same?


They are all essentially the same I guess. But it's best to use the other as a backup walking method.

putonajonny

2012-05-28 12:30:05

From: FarmerKyle
thanks for the bank function didn't know about that. Also, is there a specific type of walking that is more effective than another? Or are they all essentially the same?


I find the best is object dtm or radial with SPS as a backup in either case

Yago

2012-05-28 12:34:05

From: abu_jwka
Take a look at some tutorials on walking:

http://villavu.com/forum/search.php?searchid=2087098


The link seems dead… I'm also looking into new walking methods :)

Abu

2012-05-28 14:19:35

From: Yago
The link seems dead… I'm also looking into new walking methods :)


Yes it's expired but he managed to get the link. It was just a search for walking that's all :p

Yago

2012-05-28 14:54:02

From: abu_jwka
Yes it's expired but he managed to get the link. It was just a search for walking that's all :p


I ended up resorting to good old findcolorstolerancespiral :)