SRL Archive - First Scripts

Look to this plz .


RightClick

2012-03-29 20:14:13

So this is my first script with Banking and Walking. He is NOT done, and i know that my standart su**, and that I have no failsafe,anti-ban…
i just want some trick, help, or adjust if some1 can help me, :)

program RightScaleClick;
{$DEFINE SMART}
{$i srl/srl.simba}
{$i sps/sps.simba}


procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name :=''; // enter your Rs name
Players[0].Pass :=''; // enter your Rs password
Players[0].Nick :=''; // 3-4 letter of your name
Players[0].Active := True; // let it to true
Players[0].Pin := ''; // Bank Pin
end;



procedure Antiban;
begin
if(not(LoggedIn))then Exit;
begin
case Random(100) of
10: RandomRClick;
30: PickUpMouse;
70: BoredHuman;
89: ExamineInv;
end;
end;
end;



procedure WalkTobank; // walk from statue to the bank with SPS
var
Pathtobank: TPointArray;
begin
SPS_Setup(RUNESCAPE_SURFACE,['9_7']);
Pathtobank := [Point(3691, 3130), Point(3680, 3127), Point(3670, 3126), Point(3663, 3125),
Point(3651, 3126), Point(3643, 3133), Point(3637, 3141), Point(3631, 3150), Point(3621, 3155),
Point(3618, 3165), Point(3617, 3173), Point(3617, 3182)];
SPS_WalkPath(Pathtobank);
Wait(random(500));
end;



procedure Bank; // deposite all at falador west bank
begin
if not LoggedIn then Exit;
repeat
OpenBankFast('fwb');
Wait(Random(700));
until BankScreen or PinScreen;

if PinScreen then
begin
repeat
InPin(Players[0].Pin);
until BankScreen or not (LoggedIn);
end;
DepositAll;
end;



procedure Walktowall;
var
Pathtowall: TPointArray;
begin
SPS_Setup(RUNESCAPE_SURFACE,['9_7','8_7','8_8']);
Pathtowall := [Point(3615, 3175), Point(3594, 3189), Point(3596, 3198), Point(3597, 3210),
Point(3596, 3220), Point(3594, 3230), Point(3582, 3236)];
SPS_WalkPath(Pathtowall);
Wait(random(1000));
end;



procedure cross;
var
x, y, wall: Integer;
begin
MakeCompass('W');
wall := DTMFromString('mKgEAAHic42NgYLgMxMeB+BgQPwPix1B8FIgvQeWfQvF1ID4DVZsDxElAXAjFCUCcCcTZQJwCxPlAnAtlw3AGEO/etojh5JF1DP1tNWC8beM8hs3rZjMsmdXH8PjuEYbVy6YwrF0xlWHD6hkMp4+uB2MQm1zASCZGBQDn2S1y');
if FindDTM(wall, x, y, MSX1, MSY1, MSX2, MSY2) then
begin
Mouse(x, y, 4, 4, True);
end;
end;



procedure Walktoladder;
var
Pathtoladder: TPointArray;
begin
SPS_Setup(RUNESCAPE_SURFACE,['8_8','8_7']);
Pathtoladder := [Point(3569, 3235), Point(3556, 3232), Point(3542, 3224), Point(3535, 3217),
Point(3528, 3209), Point(3518, 3201), Point(3509, 3191), Point(3504, 3186),
Point(3497, 3179), Point(3492, 3172), Point(3483, 3162), Point(3476, 3153),
Point(3467, 3147), Point(3460, 3143), Point(3452, 3135), Point(3443, 3129),Point(3434, 3122),
Point(3426, 3117), Point(3416, 3110), Point(3405, 3102), Point(3399, 3097), Point(3390, 3090),
Point(3380, 3076)];
SPS_WalkPath(Pathtoladder);
end;



procedure LadderAndPipe;
var
x, y, ladder, pipe: Integer;
begin
MakeCompass('N')
ladder := DTMFromString('maQEAAHicE2RgYGgD4gIgXgHES4A4AoibgTgDiLuAeCkQTwHiCiDOA+I6IJ4FxMugOB8qXw7E9VD1i4F4NRBPAuIqqPwqKO4A4mogrgHiXiCeC8TLgZiXl4/Bwd0LTIOwpJQUg52DI4OqpjaDm18gWEzPwJBBVkGRQUlNA64OGVMDMFIBYwAA08MY5Q==');
pipe := DTMFromString('mFQEAAHic42VgYFgCxNOBeCEQrwHijVC8DoiXAvFsIJ4MxBOAeBJUbRcQV0JxHRC3AXEPVB0MdwNxCxDXQ/WWR6sy+NtKMGQHKTKEuOkzJAaaMaT7KzAkeskxZAYoMOTG2DKkBuoyRPkYM7iZioLZ5ABGMjAKAABpVRn5');
if FindDTM(ladder, x, y, MSX1, MSY1, MSX2, MSY2) then
begin
Mouse(x, y, 4, 4, True);
MakeCompass('E');
end;

if FindDTM(pipe, x, y, MSX1, MSY1, MSX2, MSY2) then
Mouse(x, y, 4, 4, True);
end;



procedure Collect;
var
x, y, ladder, scale: Integer;
begin
scale := DTMFromString('mggAAAHicY2NgYEhiZGCIB+IUIE5nRPD/AOW+A/FXIP4LxExAsf9AWt22niE/0pBByTSfQdWynKGivJZB1aqSARdgxIEhAABW6A0C');
if FindDTM(scale, x, y, MSX1, MSY1, MSX2, MSY2) then
Mouse(x, y, 4, 4, True);
end;



procedure Teleport; //teleport with fally teletab if inv is full
var
x, y, Tab: Integer;
begin
if InvFull then
begin
Tab := DTMFromString('mrAAAAHic42BgYMhlYmCoBOIqIE4A4hwmiFg1EMcD8VOgmptA/BGKb0DpZ0D8BIg7585jcLc3ZjBQUADTDAxMDCkJCWAagvEDRgIYBgBcXg+X');
if FindDTM(Tab, x, y, MIX1, MIY1, MIX2, MIY2) then
Mouse(x, y, 4, 4, True);
end;
end;



Procedure Mainloop;
begin
repeat
WalkTobank;
Bank;
Walktowall;
cross;
Walktoladder;
LadderAndPipe;
Collect;
Teleport;
until False;
end;



begin
SetUpSRL;
ClearDebug;
DeclarePlayers;
if not LoggedIn then Exit;
Mainloop;
end.

RightClick

2012-03-29 20:15:13

Plz no flame, and sorry for doublepost it posted two time the first post ..

NKN

2012-03-29 20:49:48

What does it do…?

RightClick

2012-03-29 20:54:37

From: nkn
What does it do…?


it's the basic of a script that walk to the falador dungeon and pickupp bluedragonscale

NKN

2012-03-29 21:02:37

Oh, good job. :D
Standards could be a little better.
Increase Antiban a little,
Put some of the small procedures into the other ones, to make less of them, easier to read and a good practice to get into.

And for the final loop, make a procedure like this:
Procedure Mainloop;
begin
repeat
WalkTobank;
Bank;
Walktowall;
cross;
Walktoladder;
LadderAndPipe;
Collect;
Teleport;
until AllPlayersInactive or -anything else, like perhaps, how many trips?-
end;
Then, make it like this.

begin
SetUpSRL;
ClearDebug;
DeclarePlayers;
LoginPlayer;
repeat
Mainloop;
until AllPlayersInactive
end.

RightClick

2012-03-29 21:45:10

From: nkn
Oh, good job. :D
Standards could be a little better.
Increase Antiban a little,
Put some of the small procedures into the other ones, to make less of them, easier to read and a good practice to get into.

And for the final loop, make a procedure like this:
Procedure Mainloop;
begin
repeat
WalkTobank;
Bank;
Walktowall;
cross;
Walktoladder;
LadderAndPipe;
Collect;
Teleport;
until AllPlayersInactive or -anything else, like perhaps, how many trips?-
end;
Then, make it like this.

begin
SetUpSRL;
ClearDebug;
DeclarePlayers;
LoginPlayer;
repeat
Mainloop;
until AllPlayersInactive
end.


Thanks for this, ^^

NKN

2012-03-29 23:24:29

No problem, here to help where I can.

RightClick

2012-03-30 10:18:37

It fail to cross the wall, it try one time and if it fail, it pass to the next procedure that is walk to ladder, but the player is stuck on the wall, how can I fix it, with a repeat … until ?

NKN

2012-03-30 10:57:16

Fails to go through the pipe?
Or what wall, take a screenshot.

RightClick

2012-03-30 16:50:30

The Falador agility shortcut, :p at west

Hazzah

2012-03-30 20:02:20

Your DTM may have failed, it is better, as I have been told at least, to not use DTMs for things that are on the main screen. Adding something to search for uptext might solve this, but I'm fairly certain you do not want to use DTM's for things on the screen.

This might be very crappy but something like:

if FindDtm(Wall,x,y,MSX1,MSY1,MSX2,MSY2) then
begin
if UpText('Clim', 'limb', 'ove', 'ver') then {use something from the uptext whatever the actually uptext is}
mouse(x,y,4,4,True)
end;

This is probably elementary and Im sure using TPA's or something would be much better. Also, instead of using FindDtm, you could try using FindDtmRotated so that you do not need to set the compass to exactly west.

RightClick

2012-03-31 08:49:30

thanks, :) and a last question, why when my script stop and I press play, the smart reload ?

Abu

2012-03-31 09:10:34

From: RightClick
thanks, :) and a last question, why when my script stop and I press play, the smart reload ?


Either because you disabled SMART or you never put in fixed constants for your SMART server.

RightClick

2012-03-31 09:11:49

From: abu_jwka
Either because you disabled SMART or you never put in fixed constants for your SMART server.


Ohh thanks :)

Abu

2012-03-31 09:23:30

Here, tried to fix your standards as much as possible - but it wasn't easy as there are alot of unnecessary begins and end:

program RightScaleClick;
{$DEFINE SMART}
{$i srl/srl.simba}
{$i sps/sps.simba}


procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name :=''; // enter your Rs name
Players[0].Pass :=''; // enter your Rs password
Players[0].Nick :=''; // 3-4 letter of your name
Players[0].Active := True; // let it to true
Players[0].Pin := ''; // Bank Pin
end;



procedure Antiban;
begin
if(not(LoggedIn))then Exit;
begin
case Random(100) of
10: RandomRClick;
30: PickUpMouse;
70: BoredHuman;
89: ExamineInv;
end;
end;
end;



procedure WalkTobank; // walk from statue to the bank with SPS
var
Pathtobank: TPointArray;
begin
SPS_Setup(RUNESCAPE_SURFACE,['9_7']);
Pathtobank := [Point(3691, 3130), Point(3680, 3127), Point(3670, 3126), Point(3663, 3125),
Point(3651, 3126), Point(3643, 3133), Point(3637, 3141), Point(3631, 3150), Point(3621, 3155),
Point(3618, 3165), Point(3617, 3173), Point(3617, 3182)];
SPS_WalkPath(Pathtobank);
Wait(random(500));
end;



procedure Bank; // deposite all at falador west bank
begin
if not LoggedIn then Exit;
repeat
OpenBankFast('fwb');
Wait(Random(700));
until BankScreen or PinScreen;

if PinScreen then
begin
repeat
InPin(Players[0].Pin);
until BankScreen or not (LoggedIn);
end;
DepositAll;
end;



procedure Walktowall;
var
Pathtowall: TPointArray;
begin
SPS_Setup(RUNESCAPE_SURFACE,['9_7','8_7','8_8']);
Pathtowall := [Point(3615, 3175), Point(3594, 3189), Point(3596, 3198), Point(3597, 3210),
Point(3596, 3220), Point(3594, 3230), Point(3582, 3236)];
SPS_WalkPath(Pathtowall);
Wait(random(1000));
end;



procedure cross;
var
x, y, wall: Integer;
begin
MakeCompass('W');
wall := DTMFromString('mKgEAAHic42NgYLgMxMeB+BgQPwPix1B8FIgvQeWfQvF1ID4DVZsDxElAXAjFCUCcCcTZQJwCxPlAnAtlw3AGEO/etojh5JF1DP1tNWC8beM8hs3rZjMsmdXH8PjuEYbVy6YwrF0xlWHD6hkMp4+uB2MQm1zASCZGBQDn2S1y');
if FindDTM(wall, x, y, MSX1, MSY1, MSX2, MSY2) then
begin
Mouse(x, y, 4, 4, True);
end;
end;



procedure Walktoladder;
var
Pathtoladder: TPointArray;
begin
SPS_Setup(RUNESCAPE_SURFACE,['8_8','8_7']);
Pathtoladder := [Point(3569, 3235), Point(3556, 3232), Point(3542, 3224), Point(3535, 3217),
Point(3528, 3209), Point(3518, 3201), Point(3509, 3191), Point(3504, 3186),
Point(3497, 3179), Point(3492, 3172), Point(3483, 3162), Point(3476, 3153),
Point(3467, 3147), Point(3460, 3143), Point(3452, 3135), Point(3443, 3129),Point(3434, 3122),
Point(3426, 3117), Point(3416, 3110), Point(3405, 3102), Point(3399, 3097), Point(3390, 3090),
Point(3380, 3076)];
SPS_WalkPath(Pathtoladder);
end;



procedure LadderAndPipe;
var
x, y, ladder, pipe: Integer;
begin
MakeCompass('N')
ladder := DTMFromString('maQEAAHicE2RgYGgD4gIgXgHES4A4AoibgTgDiLuAeCkQTwHiCiDOA+I6IJ4FxMugOB8qXw7E9VD1i4F4NRBPAuIqqPwqKO4A4mogrgHiXiCeC8TLgZiXl4/Bwd0LTIOwpJQUg52DI4OqpjaDm18gWEzPwJBBVkGRQUlNA64OGVMDMFIBYwAA08MY5Q==');
pipe := DTMFromString('mFQEAAHic42VgYFgCxNOBeCEQrwHijVC8DoiXAvFsIJ4MxBOAeBJUbRcQV0JxHRC3AXEPVB0MdwNxCxDXQ/WWR6sy+NtKMGQHKTKEuOkzJAaaMaT7KzAkeskxZAYoMOTG2DKkBuoyRPkYM7iZioLZ5ABGMjAKAABpVRn5');
if FindDTM(ladder, x, y, MSX1, MSY1, MSX2, MSY2) then
begin
Mouse(x, y, 4, 4, True);
MakeCompass('E');
end;

if FindDTM(pipe, x, y, MSX1, MSY1, MSX2, MSY2) then
Mouse(x, y, 4, 4, True);
end;



procedure Collect;
var
x, y, ladder, scale: Integer;
begin
scale := DTMFromString('mggAAAHicY2NgYEhiZGCIB+IUIE5nRPD/AOW+A/FXIP4LxExAsf9AWt22niE/0pBByTSfQdWynKGivJZB1aqSARdgxIEhAABW6A0C');
if FindDTM(scale, x, y, MSX1, MSY1, MSX2, MSY2) then
Mouse(x, y, 4, 4, True);
end;



procedure Teleport; //teleport with fally teletab if inv is full
var
x, y, Tab: Integer;
begin
if InvFull then
begin
Tab := DTMFromString('mrAAAAHic42BgYMhlYmCoBOIqIE4A4hwmiFg1EMcD8VOgmptA/BGKb0DpZ0D8BIg7585jcLc3ZjBQUADTDAxMDCkJCWAagvEDRgIYBgBcXg+X');
if FindDTM(Tab, x, y, MIX1, MIY1, MIX2, MIY2) then
Mouse(x, y, 4, 4, True);
end;
end;



Procedure Mainloop;
begin
repeat
WalkTobank;
Bank;
Walktowall;
cross;
Walktoladder;
LadderAndPipe;
Collect;
Teleport;
until False;
end;



begin
SetUpSRL;
ClearDebug;
DeclarePlayers;
if not LoggedIn then Exit;
Mainloop;
end.

I also added in that Mainloop procedure that nkn mentioned

RightClick

2012-03-31 10:15:51

From: abu_jwka
Here, tried to fix your standards as much as possible - but it wasn't easy as there are alot of unnecessary begins and end:

program RightScaleClick;
{$DEFINE SMART}
{$i srl/srl.simba}
{$i sps/sps.simba}


procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name :=''; // enter your Rs name
Players[0].Pass :=''; // enter your Rs password
Players[0].Nick :=''; // 3-4 letter of your name
Players[0].Active := True; // let it to true
Players[0].Pin := ''; // Bank Pin
end;



procedure Antiban;
begin
if(not(LoggedIn))then Exit;
begin
case Random(100) of
10: RandomRClick;
30: PickUpMouse;
70: BoredHuman;
89: ExamineInv;
end;
end;
end;



procedure WalkTobank; // walk from statue to the bank with SPS
var
Pathtobank: TPointArray;
begin
SPS_Setup(RUNESCAPE_SURFACE,['9_7']);
Pathtobank := [Point(3691, 3130), Point(3680, 3127), Point(3670, 3126), Point(3663, 3125),
Point(3651, 3126), Point(3643, 3133), Point(3637, 3141), Point(3631, 3150), Point(3621, 3155),
Point(3618, 3165), Point(3617, 3173), Point(3617, 3182)];
SPS_WalkPath(Pathtobank);
Wait(random(500));
end;



procedure Bank; // deposite all at falador west bank
begin
if not LoggedIn then Exit;
repeat
OpenBankFast('fwb');
Wait(Random(700));
until BankScreen or PinScreen;

if PinScreen then
begin
repeat
InPin(Players[0].Pin);
until BankScreen or not (LoggedIn);
end;
DepositAll;
end;



procedure Walktowall;
var
Pathtowall: TPointArray;
begin
SPS_Setup(RUNESCAPE_SURFACE,['9_7','8_7','8_8']);
Pathtowall := [Point(3615, 3175), Point(3594, 3189), Point(3596, 3198), Point(3597, 3210),
Point(3596, 3220), Point(3594, 3230), Point(3582, 3236)];
SPS_WalkPath(Pathtowall);
Wait(random(1000));
end;



procedure cross;
var
x, y, wall: Integer;
begin
MakeCompass('W');
wall := DTMFromString('mKgEAAHic42NgYLgMxMeB+BgQPwPix1B8FIgvQeWfQvF1ID4DVZsDxElAXAjFCUCcCcTZQJwCxPlAnAtlw3AGEO/etojh5JF1DP1tNWC8beM8hs3rZjMsmdXH8PjuEYbVy6YwrF0xlWHD6hkMp4+uB2MQm1zASCZGBQDn2S1y');
if FindDTM(wall, x, y, MSX1, MSY1, MSX2, MSY2) then
begin
Mouse(x, y, 4, 4, True);
end;
end;



procedure Walktoladder;
var
Pathtoladder: TPointArray;
begin
SPS_Setup(RUNESCAPE_SURFACE,['8_8','8_7']);
Pathtoladder := [Point(3569, 3235), Point(3556, 3232), Point(3542, 3224), Point(3535, 3217),
Point(3528, 3209), Point(3518, 3201), Point(3509, 3191), Point(3504, 3186),
Point(3497, 3179), Point(3492, 3172), Point(3483, 3162), Point(3476, 3153),
Point(3467, 3147), Point(3460, 3143), Point(3452, 3135), Point(3443, 3129),Point(3434, 3122),
Point(3426, 3117), Point(3416, 3110), Point(3405, 3102), Point(3399, 3097), Point(3390, 3090),
Point(3380, 3076)];
SPS_WalkPath(Pathtoladder);
end;



procedure LadderAndPipe;
var
x, y, ladder, pipe: Integer;
begin
MakeCompass('N')
ladder := DTMFromString('maQEAAHicE2RgYGgD4gIgXgHES4A4AoibgTgDiLuAeCkQTwHiCiDOA+I6IJ4FxMugOB8qXw7E9VD1i4F4NRBPAuIqqPwqKO4A4mogrgHiXiCeC8TLgZiXl4/Bwd0LTIOwpJQUg52DI4OqpjaDm18gWEzPwJBBVkGRQUlNA64OGVMDMFIBYwAA08MY5Q==');
pipe := DTMFromString('mFQEAAHic42VgYFgCxNOBeCEQrwHijVC8DoiXAvFsIJ4MxBOAeBJUbRcQV0JxHRC3AXEPVB0MdwNxCxDXQ/WWR6sy+NtKMGQHKTKEuOkzJAaaMaT7KzAkeskxZAYoMOTG2DKkBuoyRPkYM7iZioLZ5ABGMjAKAABpVRn5');
if FindDTM(ladder, x, y, MSX1, MSY1, MSX2, MSY2) then
begin
Mouse(x, y, 4, 4, True);
MakeCompass('E');
end;

if FindDTM(pipe, x, y, MSX1, MSY1, MSX2, MSY2) then
Mouse(x, y, 4, 4, True);
end;



procedure Collect;
var
x, y, ladder, scale: Integer;
begin
scale := DTMFromString('mggAAAHicY2NgYEhiZGCIB+IUIE5nRPD/AOW+A/FXIP4LxExAsf9AWt22niE/0pBByTSfQdWynKGivJZB1aqSARdgxIEhAABW6A0C');
if FindDTM(scale, x, y, MSX1, MSY1, MSX2, MSY2) then
Mouse(x, y, 4, 4, True);
end;



procedure Teleport; //teleport with fally teletab if inv is full
var
x, y, Tab: Integer;
begin
if InvFull then
begin
Tab := DTMFromString('mrAAAAHic42BgYMhlYmCoBOIqIE4A4hwmiFg1EMcD8VOgmptA/BGKb0DpZ0D8BIg7585jcLc3ZjBQUADTDAxMDCkJCWAagvEDRgIYBgBcXg+X');
if FindDTM(Tab, x, y, MIX1, MIY1, MIX2, MIY2) then
Mouse(x, y, 4, 4, True);
end;
end;



Procedure Mainloop;
begin
repeat
WalkTobank;
Bank;
Walktowall;
cross;
Walktoladder;
LadderAndPipe;
Collect;
Teleport;
until False;
end;



begin
SetUpSRL;
ClearDebug;
DeclarePlayers;
if not LoggedIn then Exit;
Mainloop;
end.

I also added in that Mainloop procedure that nkn mentioned



Thanks very much, its my first script so i just want to it work and then after i will fix everything and make it faster :)

EDIT : changed to it on my first post :)

Olly

2012-03-31 13:04:29

For on screen DTMS try using finddtmrotated.

RightClick

2012-03-31 13:07:34

How can I use it ?
and Do i need to makecompass ?

Abu

2012-03-31 13:16:41

From: RightClick
How can I use it ?
and Do i need to makecompass ?


You can use this tutorial: http://villavu.com/forum/showthread.php?t=10321&highlight=FindDTMRotated

Do not post on that thread - it is many years old

RightClick

2012-03-31 13:20:15

ok tyvm everybody for your help, :D