SRL Archive - FAQ

ClickMouse not clicking


Bug5532

2010-11-28 07:35:15

Hi, I have a game that I have been scripting for and sometimes the mouse just will click and sometimes it wont (it will always move the mouse to the correct position). Is there an alternative way of clicking the mouse?

TomTuff

2010-11-28 07:46:20

If it's RS then you can do something like

Program Example;
{$i SRL\SRL.scar}


begin
Mouse(200, 200, 4, 4, true);
if not DidClick(True, 600) then
ClickMouse2(True);
end;

Bug5532

2010-11-28 07:47:36

Its not runescape, is there anything like that for other games? (its a flash game)

TomTuff

2010-11-28 07:58:30

Hmmm is there any sort of feedback when you click?

The way DidClick works is it checks for the red/yellow color (determined in the function parameters) based on where it clicked. So, for example, if there was a yellow flash after you click in the flash game you could do something like

program new;
{$i SRL\SRL.scar}


function CustomDidClick(TimeOut: Integer);
var
x, y: integer;
begin
MarkTime(T);
repeat
GetMousePos(x, y);
Result := FindColor(x + 2, y + 2, 27390, 0, 0, 100, 100);
until(TimeFromMark(T) >= TimeOut);
end;


begin
Mouse(150, 150, 10, 10, true);
if not CustomDidClick(600) then
ClickMouse2(True);
end;

EDIT: I used the params for FindColors wrong, but the concept is still the same.

Bug5532

2010-11-28 08:10:04

yer, i was doing something similar where I checked for a color changing. It did work but it also slowed down the script alot. I just wondered if there was any other way of sending a mouse click?

TomTuff

2010-11-28 08:47:51

ClickMouse2(Left: Boolean);

in SRL.

EGM

2010-11-28 09:45:55

I'm scripting for a flash game as well, and have been having luck with moving then clicking.

MoveMouse(x, y);
ClickMouse(x, y, mouse_Left);
wait(200);

~EGM

Bug5532

2010-11-28 10:25:32

From: TomTuff
ClickMouse2(Left: Boolean);

in SRL.


will try that :)

From: EGM
I'm scripting for a flash game as well, and have been having luck with moving then clicking.

MoveMouse(x, y);
ClickMouse(x, y, mouse_Left);
wait(200);

~EGM


I've been using that method too it usually works :s