SRL Archive - Non-RuneScape Scripts

Mouse won't move.


haxal

2012-08-16 08:55:45

Hi, I'm new in scripting and I can't make simple thing… I feel so dumb. I can't make the left click on desired position to work.:duh: I was trying to google it, I have tried tutorials on this forum but my mouse just won't move. I want my mouse to click in Chrome on a site button, that's it.
program Alinar;
{$i srl\srl.simba}
begin
Mouse(378, 21, 3, 3, True);
end.

1. I have selected desired area.
2. I have picked location (378,21)
3. When I start the script mouse doesn't click where I want and instead of that it moves slowly to the left.

Where is my mistake?

P.S. I have updated everything.

riwu

2012-08-16 08:58:07

Add SetupSRL; before the Mouse procedure.

CephaXz

2012-08-16 08:58:11

You did not do SetupSRL, that is why your mouse speed is very slow. For just clicking something in your browser, you do not need human mouse speed. So you could just use MoveMouse and ClickMouse function. Also, you have to drag the crosshair onto your browser before you start the script.

haxal

2012-08-16 09:11:31

The thing is that I couldn't figure out how to use ClickMouse…

NKN

2012-08-16 09:12:47


MoveMouse(1,1)
ClickMouse2(1)
Something like that?

haxal

2012-08-16 09:20:36

So I need to move the mouse first and then click BUT still you are using ClickMouse2 instead of ClickMouse…

CephaXz

2012-08-16 09:23:35

From: haxal
So I need to move the mouse first and then click BUT still you are using ClickMouse2 instead of ClickMouse…


Its the same. But things filled in there isn't. I believe ClickMouse is faster than ClickMouse2? If you don't wanna go through all those trouble, just do SetupSRL and use Mouse function, it moves and clicks.

ClickMouse(x, y, ClickType);
ClickMouse2(ClickType);

haxal

2012-08-16 09:34:53

Thank you, it works!!! Setup SRL; was easier. =) How do I do infinite loop? Infinite repeat ^^
Repeat
actions...
Until(Flase)
??

riwu

2012-08-16 09:37:24

repeat
actions;
until(false);

OR

While false Do
begin
Actions;
End;

haxal

2012-08-16 09:38:27

Oooohhh thx, crazy quick reply =)))

CephaXz

2012-08-16 09:39:18

repeat
mouse();
until (false);

It will keep clicking like a mad monkey forever. Forgot what's the key to stop, you will need it when you want to stop the script, or you'll have to fight for your mouse.

EDIT: Whops, got ninja-ed ^

haxal

2012-08-16 10:07:30

I have another huge problem. When I run the program it never goes to the same coordinates… It always go lower. Here is my script.
program Alinar;
{$i srl\srl.simba}
begin
Repeat
SetupSRL;
Mouse(377, 101, 0, 0, True);
wait(1655)
Mouse(795, 157, 0, 0, True);
wait(1655)
Mouse(567, 507, 0, 0, True);
wait(1655)
Mouse(817, 245, 0, 0, True);
wait(655)
Mouse(817, 261, 0, 0, True);
wait(655)
Mouse(817, 279, 0, 0, True);
wait(655)
Mouse(817, 395, 0, 0, True);
wait(655)
Mouse(935, 3385, 0, 0, True);
wait(655)
Mouse(977, 271, 0, 0, True);
wait(655)
Until(False)
end.
I did use targeted area, I even used full screen as target area… It never goes to the right position, idk why but it goes lower all the time.

CephaXz

2012-08-16 10:09:53

Your y coords need to -50.

riwu

2012-08-16 10:10:43

From: haxal
I have another huge problem. When I run the program it never goes to the same coordinates… It always go lower. Here is my script.
program Alinar;
{$i srl\srl.simba}
begin
Repeat
SetupSRL;
Mouse(377, 101, 0, 0, True);
wait(1655)
Mouse(795, 157, 0, 0, True);
wait(1655)
Mouse(567, 507, 0, 0, True);
wait(1655)
Mouse(817, 245, 0, 0, True);
wait(655)
Mouse(817, 261, 0, 0, True);
wait(655)
Mouse(817, 279, 0, 0, True);
wait(655)
Mouse(817, 395, 0, 0, True);
wait(655)
Mouse(935, 3385, 0, 0, True);
wait(655)
Mouse(977, 271, 0, 0, True);
wait(655)
Until(False)
end.
I did use targeted area, I even used full screen as target area… It never goes to the right position, idk why but it goes lower all the time.

Oh, because SetupSRL lowers the y-coordinate by 50 to account for the nav bar which apparently doesn't exist in your case. Either add SRL_EnableNavBar; after SetupSRL or replace SetupSRL with MouseSpeed:=15; or subtract 50 off all your y-values.

haxal

2012-08-16 10:12:41

So it goes to the right place along the x but not along the y axis.

cycrosism

2012-08-16 11:03:15

You can also do an infinite loop by doing

for(;;){
DoStuffHere;
}
Except that is for Java. There is probably some easy way to do the same thing for Simba.

haxal

2012-08-17 09:19:52

Thank you for all your replies, my mini script works. =)