Log in

View Full Version : need help with simple script



westkevin12
11-15-2012, 03:11 AM
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
11-15-2012, 03:14 AM
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
11-15-2012, 03:15 AM
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
11-15-2012, 03:16 AM
[Error] (4:1): Identifier expected at line 3
Compiling failed.

Ian
11-15-2012, 03:24 AM
Edited my post, see above.

westkevin12
11-15-2012, 03:26 AM
oh wow, thanks alot man:) i'll be sure to check out the tut to. +rep

westkevin12
11-15-2012, 03:39 AM
nvm on second error got it. ty

Ian
11-15-2012, 03:42 AM
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
11-15-2012, 03:58 AM
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
11-15-2012, 04:11 AM
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
11-15-2012, 04:18 AM
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
11-15-2012, 04:43 AM
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
11-15-2012, 06:24 AM
Remove {$Define smart}
Only include it when you want to use Smart.