SRL Archive - Help

need help with simple script


westkevin12

2012-11-14 22:11:27

editing post to show what i have now.


Program ANTIFIRE;
{$Define smart}
{$i srl/srl.simba}
Procedure BANK;
begin
MMouse(259,198,3,3);
ClickMouse2(true);
wait(3000+random(1100));
MMouse(372,361,3,3);
ClickMouse2(true);
wait(1000+random(200));
MMouse(54,163,3,3);
ClickMouse2(False);
wait(500+random(220));
MMouse(52,234,5,0);
ClickMouse2(true);
wait(500+random(100));
MMouse(96,160,3,3);
ClickMouse2(false);
wait(500+random(220));
MMouse(103,233,5,0);
ClickMouse2(true);
wait(500+random(190));
MMouse(490,86,1,0);
ClickMouse2(true);
wait(2000+random(450));
MMouse(578,393,3,3);
ClickMouse2(true);
wait(600+random(200));
MMouse(577,427,3,3);
ClickMouse2(true);
wait(600+random(200));
MMouse(258,478,4,4);
ClickMouse2(true);
wait(17000+random(1000));
end;
begin
SetupSRL;
repeat
Bank;
until (false);
end.


now my only problem is that it is trying to open a new window instead of just running in the browser i have opened

westkevin12

2012-11-14 22:14:19

ps i know this type of script is unsafe to run. i intend on watching it at all times only need the script to make me more eficient as i get sidetracked easily

Ian

2012-11-14 22:15:34

What error do you get?

E:
Fixed it for you, I strongly reccomend looking at the beginner tutorials, a lot has changed since scar.

For example:

ClickMouse -> ClickMouse2

MoveMouse -> MMouse

Program ScriptThingy;
{$Define smart}
{$i srl/srl.simba}

Procedure BANK;
begin
MMouse(259,198,0,0);
ClickMouse2(true);
wait(3000+random(1100));
MMouse(372,361,0,0);
ClickMouse2(true);
wait(1000+random(200));
MMouse(54,163,0,0);
ClickMouse2(true);
wait(500+random(220));
MMouse(52,234,0,0);
ClickMouse2(true);
wait(500+random(100));
MMouse(96,160,0,0);
ClickMouse2(false);
wait(500+random(220));
MMouse(103,233,0,0);
ClickMouse2(true);
wait(500+random(190));
MMouse(490,86,0,0);
ClickMouse2(true);
wait(2000+random(450));
MMouse(578,393,0,0);
ClickMouse2(true);
wait(600+random(200));
MMouse(577,427,0,0);
ClickMouse2(true);
wait(600+random(200));
MMouse(258,478,0,0);
ClickMouse2(true);
wait(17000+random(1000));
end;

begin
repeat
Bank;
until (false);
end.

westkevin12

2012-11-14 22:16:55

[Error] (4:1): Identifier expected at line 3
Compiling failed.

Ian

2012-11-14 22:24:38

Edited my post, see above.

westkevin12

2012-11-14 22:26:22

oh wow, thanks alot man:) i'll be sure to check out the tut to. +rep

westkevin12

2012-11-14 22:39:46

nvm on second error got it. ty

Ian

2012-11-14 22:42:11

Whoops sorry about that, remove the semicolons that I accidentally but after the begins. And add one after the name of the script.

np :). Just one more thing: You see how the MMouses end in 0,0? that is 0 X randomization and 0 Y randomization. Those should probably be changed to 3's or 5's depending on how precise you need the clicks to be, so make sure you adjust those to your needs. :)

westkevin12

2012-11-14 22:58:07

ahh nice! randomizations i like that. so there are no ;'s after the begins? that might be why it was moving my mouse soo slow

westkevin12

2012-11-14 23:11:32

ok i fixed the semicolons but for some reason my mouse is moving accross my screen at an alarmingly slow rate. just creeping along… any ideas on how to solve this issue?

riwu

2012-11-14 23:18:39

Add SetupSRL to start of main program. (to set mousespeed to 15)
You shouldn't use blind clicks for RS scripts though, can be quite unreliable.
Use SRL functions like OpenBank, WithdrawEx, CloseBank, mouseItem etc.

Also
MMouse() + ClickMouse2() = Mouse();

westkevin12

2012-11-14 23:43:38

i added SetupSRL to the program and the mouse stopped creeping accross the screen but now it is trying to open another window? i think it is trying to open runescape in a new client. i already have runescape opened and drug the crosshair over rs window. how can i solve this problem and make the script run in my browser?

riwu

2012-11-15 01:24:30

Remove {$Define smart}
Only include it when you want to use Smart.