SRL Archive - Help

Clickmouse2 looks like a banhammer.


rj

2013-02-08 21:36:23

in my script I use

MMouse(RandomRange(X - 4, X + 4), RandomRange(y - 4, y + 4), 0, 0);

To randomize were the mouse mines, but it seems that clickmouse2 moves the mouse after the mouse is already hovered over the rock. That is pretty fishy what is the mouse click that clicks the current position?

Sjoe

2013-02-08 21:37:44

Try this?


{*******************************************************************************
procedure FastClick(button: Integer);
By: Flight
Description: Quickly click the mouse.
*******************************************************************************}
procedure FastClick(button: variant);
var
x, y: integer;
ibutton: Integer;
begin
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;
GetMousePos(x, y);
HoldMouse(x, y, iButton);

Wait(RandomRange(60, 150));

GetMousePos(x, y);
ReleaseMouse(x, y, iButton);
end;

rj

2013-02-08 21:39:01

From: Sjoekeloe
Try this?


{*******************************************************************************
procedure FastClick(button: Integer);
By: Flight
Description: Quickly click the mouse.
*******************************************************************************}
procedure FastClick(button: variant);
var
x, y: integer;
ibutton: Integer;
begin
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;
GetMousePos(x, y);
HoldMouse(x, y, iButton);

Wait(RandomRange(60, 150));

GetMousePos(x, y);
ReleaseMouse(x, y, iButton);
end;


whats the command to click?

Sjoe

2013-02-08 21:41:22

fastclick(true) is left click
fastclick(false) right

rj

2013-02-08 21:46:27

One more queston I get a memory error when I run this:

program new;
{$i srl/srl.simba}
const
TOL = 1;
ONE = 6119777; // each word is 40 14846307


var
CountOne: Integer;

begin
MouseSpeed := 15;
//ClearDebug;
//SetupSRL;
CountOne := CountColorTolerance(ONE, 214, 216, 241, 243, TOL);

Writeln('There are ' + IntToStr(CountOne) + ' Pixels that are ' + IntToStr(ONE) + ' color');

end.

Error: Exception: Out of memory at line 15

rj

2013-02-08 21:55:18

nvmf ixed

riwu

2013-02-08 22:13:57

From: rjj95
in my script I use

MMouse(RandomRange(X - 4, X + 4), RandomRange(y - 4, y + 4), 0, 0);

To randomize were the mouse mines, but it seems that clickmouse2 moves the mouse after the mouse is already hovered over the rock. That is pretty fishy what is the mouse click that clicks the current position?

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().

Press Play

2013-02-08 22:55:30

From: 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.
(*
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;