PDA

View Full Version : MMouse Box



mat_de_b
08-21-2007, 06:33 PM
{************************************************* ******************************
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
08-21-2007, 06:37 PM
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
08-21-2007, 06:41 PM
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
08-22-2007, 08:15 PM
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
08-22-2007, 09:22 PM
MMouse(RandomRange(xs, xe), RandomRange(ys, ye), 2, 2)

will also do the trick :)

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

dvdcrayola
08-22-2007, 11:24 PM
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
08-23-2007, 08:54 AM
you could make it even shorter:



{************************************************* ******************************
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;

Santa_Clause
08-23-2007, 09:45 AM
He edited a function without knowing the MMouse parameters?

mat_de_b
08-23-2007, 11:51 AM
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....