
Originally Posted by
riwu
ClickMouse2() does not alter your current mouse pos.
You were probably already hovering over the object when the uptext check is done (if you use SRL obj finding such as FindObjxxxx() etc), and it moved again since you called MMouse().
+1,
ClickMouse2() does not alter mouse position - it just clicks.
Simba Code:
(*
ClickMouse2
~~~~~~~~~~~
.. code-block:: pascal
procedure ClickMouse2(button: variant);
Clicks the mouse in a human way on the current mouse spot.
.. note::
by SRL Community
Example:
.. code-block:: pascal
*)
procedure ClickMouse2(button: variant);
var
a,b,c : integer;
iButton: Integer;
begin
{ Eventually, should be made to just use Integers }
if VariantIsBoolean(button) then
begin
if (button) then
iButton := mouse_left
else
iButton := mouse_right;
end else
iButton := button;
if (iButton = mouse_move) then Exit; { we aren't actually clicking! }
GetMousePos(b, c);
HoldMouse(b, c, iButton);
repeat
Wait(20 + Random(30));
a := a + 1;
until (a > 4);
GetMousePos(b, c);
ReleaseMouse(b, c, iButton);
Wait(50+Random(50));
end;