PDA

View Full Version : Mouse won't move.



haxal
08-16-2012, 12:55 PM
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
08-16-2012, 12:58 PM
Add SetupSRL; before the Mouse procedure.

CephaXz
08-16-2012, 12:58 PM
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
08-16-2012, 01:11 PM
The thing is that I couldn't figure out how to use ClickMouse...

NKN
08-16-2012, 01:12 PM
MoveMouse(1,1)
ClickMouse2(1)

Something like that?

haxal
08-16-2012, 01:20 PM
So I need to move the mouse first and then click BUT still you are using ClickMouse2 instead of ClickMouse...

CephaXz
08-16-2012, 01:23 PM
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
08-16-2012, 01:34 PM
Thank you, it works!!! Setup SRL; was easier. =) How do I do infinite loop? Infinite repeat ^^
Repeat
actions...
Until(Flase)??

riwu
08-16-2012, 01:37 PM
repeat
actions;
until(false);

OR

While false Do
begin
Actions;
End;

haxal
08-16-2012, 01:38 PM
Oooohhh thx, crazy quick reply =)))

CephaXz
08-16-2012, 01:39 PM
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
08-16-2012, 02:07 PM
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
08-16-2012, 02:09 PM
Your y coords need to -50.

riwu
08-16-2012, 02:10 PM
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
08-16-2012, 02:12 PM
So it goes to the right place along the x but not along the y axis.

cycrosism
08-16-2012, 03:03 PM
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
08-17-2012, 01:19 PM
Thank you for all your replies, my mini script works. =)