SRL Archive - Research & Development Lounge

MMouse Box


mat_de_b

2007-08-21 14:33:19

{*******************************************************************************
procedure MMouseBox(xs, ys, xe, ye: Integer;);
By: mat_de_b edited from XxKanexX's MouseBox
Description: Moves mouse into a random position in the box.
*******************************************************************************}

procedure MMouseBox(xs, ys, xe, ye: Integer);
var
a, b: Integer;
begin
a := Max(xs, xe) - Min(xs, xe);
b := Max(ys, ye) - Min(ys, ye);
a := Random(a);
b := Random(b);
MMouse(xs + a, ys + b, 0, 0);
end;

Really i dont wnat any credit for this i only took out two lines… but i saw some people asking for it, so here it is

LordGregGreg

2007-08-21 14:37:31

werid.. i supose that works though..

but i normally jsut use the random setting that are built in.

like, if i want to move my mouse to 30,40
or rather, the box around it going from
25-35,35-45

then u just do
MMouse(30,40,10,10); where the last two are the randomness for x, and then y.

i find this much easier to use, because it takes much less cordinants.

good work though.

mat_de_b

2007-08-21 14:41:25

Some people prefer this cause for a box like the main screen you dont ahve to work out how wide it is, you just put the edges….

LordGregGreg

2007-08-22 16:15:46

From: mat_de_b
Some people prefer this cause for a box like the main screen you dont ahve to work out how wide it is, you just put the edges….


mmm, i supose so then..

I just quese i have never really had an actual box to work with. Most srl function return a point, instead of a box…

Yeah, i can't really think of a good aplication of it,. there already is a good login method to take core of the main screen for ya, and really..

meh, i supose it would be good for converting old scripts.

and who am i to say, mabey you work best with boxes, i supose it just how u think about stuff when u auto.

In my scripts, I very realy tell it to click a random area that i type in manually… almost all of my clics are based on the retun of some srl functi0on , like find bitmap.

nielsie95

2007-08-22 17:22:10

MMouse(RandomRange(xs, xe), RandomRange(ys, ye), 2, 2)

will also do the trick :)

@greg: Could be usefull for the new InvBox function :)

dvdcrayola

2007-08-22 19:24:18

or, you can use it for like.. clicking anywhere on an item.. because you dont know the size of the items box… good procedure

Starblaster100

2007-08-23 04:54:29

you could make it even shorter:

[php]
{*******************************************************************************
procedure MMouseBox(xs, ys, xe, ye: Integer;);
By: mat_de_b edited from XxKanexX's MouseBox
Description: Moves mouse into a random position in the box.
*******************************************************************************}

procedure MMouseBox(xs, ys, xe, ye: Integer);
var
a, b: Integer;
begin
a := Max(xs, xe) - Min(xs, xe);
b := Max(ys, ye) - Min(ys, ye);
MMouse(xs, ys, a, b);
end;
[/php]

Santa_Clause

2007-08-23 05:45:33

He edited a function without knowing the MMouse parameters?

mat_de_b

2007-08-23 07:51:38

I know how to do a MMouse :D, its just thats the way the original Mousebox was in SRL so i thought id keep MMousebox the same….