SRL Archive - SRL Suggestions

Mouse movement fun


Flight

2011-12-03 13:12:55

So… I notice when(if) I play RS legitimately my mouse movements aren't even close to being a one-shot deal. For example, if I were moving from the bottom of the inventory to the Prayer tab chances are the initial movement would land on one of the neighboring tabs and then to my Prayer tab.

So I whipped something up quick to simulate such humanish mistakes. First off, this will use the standard MMouse to move our mouse to a "mistake box region", and this region's size is determined by both the mouse speed and distance of travel. From there it's just another standard MMouse to the final destination.

So obviously it's nothing fancy or state of the art, but it goes to show how just tiny modifications like this could make our scripts that much more human.

Here's a couple of tests I did. The blue circles are the starting points, the red are the targets.

~
~
~

Edit:
Here's the procedure I used for the above testing:

{*******************************************************************************
Procedure HumanMMouse(eX, eY: Integer);
By: Flight
Description: Human-like miss-and-correct mouse movement
*******************************************************************************}
Procedure HumanMMouse(eX, eY: Integer);
var
randSpeed: extended;
X,Y,A,Dist,MP: integer;
begin
A := MouseSpeed;
GetMousePos(X, Y);
Dist := Distance(X, Y, eX, eY);
MP := Round(Dist/150);
if MP < 0 then
MP := 1;

randSpeed := (random(MouseSpeed) / 2.0 + MouseSpeed) / 10.0;
MMouse(RandomRange(eX-(A*MP), eX+(A*MP)), RandomRange(eY-(A*MP), eY+(A*MP)), 0, 0);
GetMousePos(X, Y);
MMouse(eX, eY, 0, 0);
MouseSpeed := A;
end;

And here's a super version of it directly using WindMouse: (If I remember correctly, it looks like a drunk player)

{*******************************************************************************
Procedure HumanMMouse(eX, eY: Integer);
By: Flight
Description: Human-like miss-and-corect mouse movement
*******************************************************************************}
Procedure HumanMMouse(eX, eY: Integer);
var
randSpeed: extended;
X,Y,A,Dist,MP: integer;
begin
A := MouseSpeed;
GetMousePos(X, Y);
Dist := Distance(X, Y, eX, eY);
MP := Round(Dist/100);
if MP < 0 then
MP := 1;

randSpeed := (random(MouseSpeed) / 2.0 + MouseSpeed) / 10.0;
WindMouse(X, Y, RandomRange(eX-(A*MP), eX+(A*MP)), RandomRange(eY-(A*MP), eY+(A*MP)),
30, 55, 10.0 / randSpeed, 12.0 / randSpeed, 10.0 * randSpeed, 10.0 * randSpeed);
GetMousePos(X, Y);
WindMouse(X, Y, eX, eY, 30, 55, 10.0 / randSpeed, 12.0 / randSpeed, 10.0 * randSpeed, 10.0 * randSpeed);

MouseSpeed := A;
end;

Gu3st...

2011-12-03 13:15:58

From the looks of it, this is a good improvement to our current MMouse :)

RISK

2011-12-03 13:18:40

Please do post the procedure. I'd love to study it and see how exactly you accomplished this improvement.

Great job, by the way!

E: I was thinking, is there any randomization to this? I don't believe a human would always make this little "Mistake".

Flight

2011-12-03 21:51:30

If you wanted to randomize the times it does the mistake'ish mouse just have a random chance of using my mouse or the standard MMouse.

YoHoJo

2011-12-03 22:01:31

I've noticed a lot recently that overshooting and stuff would be a cool thing to do instead of just moving straight to it. Would be cool if MMouse had this built in and just if random(5) = 4 to do it. (I bet this won't get added, but I might add it to my scripts fasho!)

grats

2011-12-03 22:03:22

Awesome! I overshot the buttons and then go back too, especially with high sensitivity

Aftermath

2011-12-04 01:13:54

Something to consider working on while in a mouse-movement mood [see this post and previous]: http://villavu.com/forum/showthread.php?p=850117#post850117

Flight

2011-12-04 01:14:03

I took it a bit further now. Made a quick modified WindMouse to pain my mouse movements on-screen. I'l post some pictures here.

Harry

2011-12-04 01:22:23

That human mouse looks nothing humanlike to me. I never overshoot like that except maybe 1/100 of the time. I play too many FPSes so I almost never overshoot my clicks in RS. Windmouse looks quite similar to how my mouse moves.

Overshooting is good, but looks like you do it too much. Also the "hook" to get back in after overshooting I don't really like.

But neat, keep up the good work.

Flight

2011-12-04 01:30:40

From: Harry
That human mouse looks nothing humanlike to me. I never overshoot like that except maybe 1/100 of the time. I play too many FPSes so I almost never overshoot my clicks in RS. Windmouse looks quite similar to how my mouse moves.

Overshooting is good, but looks like you do it too much. Also the "hook" to get back in after overshooting I don't really like.

But neat, keep up the good work.


Yeah that's what Risk was talking about, it having a random chance to use HumanMMouse or the standard MMouse.

As promised, here's some pictures of it using a modified WindMouse:


TomTuff

2011-12-04 02:07:05

From: Flight
Yeah that's what Risk was talking about, it having a random chance to use HumanMMouse or the standard MMouse.

As promised, here's some pictures of it using a modified WindMouse:

images ommited


I never move my mouse like that.

Harry

2011-12-04 03:32:46

Yeah, that spline is very bad looking :/

YoHoJo

2011-12-04 03:41:01

We don't move in a perfect spline do weh?!Some of the latest images are a bit too whachy though :p but others look nice! First posts I like, hook is ok to have sometimes randomly I'd say.

Flight

2011-12-04 04:01:02

That's with some highly adjust Wind/Gravity. ;)

Nava2

2011-12-04 13:00:48

I think the parameters could probably use some tweaking. We need to find an appropriate set, though.

Simba is not drunk. :<

Stark

2011-12-04 13:25:06

Is the final coordinate set or recalculated? What I mean is, if you need speed and precision for instance in a fighting script, you could potentially misclick unless it calculates the desired path after the "mistake box" not before? On top of that I guess the next question is how often is too often?

Nava2

2011-12-04 15:07:30

Flight, could you do these pics with this branch of SRL5:
https://github.com/SRL/SRL-5/tree/gauss

If I can get my stuff together with git, this will not break anything.. :/

Tickyy

2011-12-04 17:26:24

From: Nava2

Simba is not drunk. :<


made me lol irl.

On topic: i think that's a little bit… too much i guess, if it happens once in every 25~ mouse movements then yes.

Flight

2011-12-04 20:55:31

From: Nava2
Flight, could you do these pics with this branch of SRL5:
https://github.com/SRL/SRL-5/tree/gauss

If I can get my stuff together with git, this will not break anything.. :/


You're talking about running the script with SRL5 and redoing the pictures? I'd be happy to, but the last time (first day of release) I tried converting to SRL5 I had a truck load of compile problems. I tried doing what Wizzup? said and I still couldn't get any where. Believe me I'd love to update my scripts to SRL5, had I the option.

@Tickyy:
Yeah those last pictures were taken with huge gravity and wind mods. I've settled them back down to a little higher than normal, but with the same miss-and-correct movement format.

Coh3n

2011-12-12 17:58:22

Flight, PM me the issues you're having with SRL5 and I can help you out.

I like the looks if this though. :)

E: Moved to SRL Suggestions.

Flight

2011-12-12 20:30:40

The final version of HumanMMouse is in Astralz if you'd like to take a look at it.

Edit:
I PM'd you earlier this morning, Coh3n. I hope you can give me some good advice, I'm looking forward to getting my scripts running on SRL5. :)

Coh3n

2011-12-13 00:41:55

From: Flight
The final version of HumanMMouse is in Astralz if you'd like to take a look at it.

Edit:
I PM'd you earlier this morning, Coh3n. I hope you can give me some good advice, I'm looking forward to getting my scripts running on SRL5. :)
Would be easier if you just posted here. :p I think I'll add it to mouse.simba.

Flight

2011-12-13 00:59:08


{*******************************************************************************
Procedure HumanMMouse(eX, eY: Integer);
By: Flight
Description: Human-like miss-and-correct mouse movement
*******************************************************************************}
Procedure HumanMMouse(eX, eY, ranX, ranY: Integer);
var
randSpeed: extended;
X,Y,X2,Y2,A,Dist,MP: integer;
begin
A := MouseSpeed;
GetMousePos(X, Y);
Dist := Distance(X, Y, eX, eY);
MP := Round(Dist/150);
if MP < 0 then
MP := 1;

randSpeed := (random(MouseSpeed) / 2.0 + MouseSpeed) / 10.0;
X2 := RandomRange(eX-(A*MP), eX+(A*MP));
Y2 := RandomRange(eY-(A*MP), eY+(A*MP));
WindMouse(X, Y, X2, Y2, 11, 8, 10.0 / randSpeed, 12.0 / randSpeed, 10.0 * randSpeed, 10.0 * randSpeed);
GetMousePos(X, Y);
MMouse(eX, eY, ranX, ranY);
MouseSpeed := A;
end;

Hobbit

2011-12-13 01:00:16

If it still functions like it did in the pictures in the original post I am a bit weary of it. That sharp change in direction at the end is very unrealistic to me IMO. I went from blue to red with my mouse manually multiple times and if I did miss, the correction was never so sharp. The rest of the movements seem to be on a good track though :)

Coh3n

2011-12-13 01:34:42

Maybe make the "miss area" smaller?

[XoL]

2011-12-13 01:46:56

Oh right this is what I Asked you to use :P thanks for allowing me :)
I was wondering though do you use HumanMouse (x, y, 5, 5) instead of mouse (x, y, 5, 5)?
That doesn't seem to work when i put it into practice.

Coh3n

2011-12-13 01:53:32

From: R4nd0m
Oh right this is what I Asked you to use :P thanks for allowing me :)
I was wondering though do you use HumanMouse (x, y, 5, 5) instead of mouse (x, y, 5, 5)?
That doesn't seem to work when i put it into practice.
HumanMMouse. HumanMouse is already a function in SRL. ;)

Gu3st...

2011-12-13 05:37:02

Call it MissMouse or something, it's a bit more describing name imo :)

Coh3n

2011-12-30 23:24:46

Added to my repo. will be add to SRL5 shortly. I added it as MissMouse in antiban.simba. I watched it work and I quite like it. I think I'll use it in my scripts. :)

E: It would be nice if we could use this function/a custom function instead of Mouse throughout the include if the scripter chose to.

[Nathan]

2011-12-30 23:30:21

This looks great, sooooo much more human like, I will be using this for sure!

Master BAW

2012-06-29 08:42:03

very nice, and much more human like. I'm going to add this to my script :D Is this inside the SRL yet? If it isn't, it should!

Flight

2012-06-29 08:57:23

From: MasterCrimez
very nice, and much more human like. I'm going to add this to my script :D Is this inside the SRL yet? If it isn't, it should!


From what I've read it's already in SRL at this point; somewhere in antiban.Simba if I'm not mistaken?

Kyle Undefined

2012-06-29 10:32:13

I don't think it is, I can't find it anywhere in the include.

Caotom

2012-06-29 11:10:06

That was quite the gravedig MasterCrimez but with fair enough reason. If this is not in the SRL include (fairly sure it's not) it should at least get a bit of returned publicity to people can start adding it to their scripts. Thanks heaps Flight, it looks amazing.

~Caotom

litoris

2012-06-29 11:18:07

It is there, called MissMouse.

Kyle Undefined

2012-06-29 11:32:03

Ah, yes, the name changed :p I was going off the first post.

Master BAW

2012-06-29 18:05:39

From: litoris
It is there, called MissMouse.

KEWL :D I think i'll use this for all my mouse movements

f1fanatic

2012-06-29 18:36:32

It's great how this one does a little loop for fun! Loving it Flight

Kyle Undefined

2012-06-29 19:14:53

Hey! That looks like my script :p

Hazzah

2012-06-29 19:37:17

I use my mouse with higher sensitivity than most (makes it easier to transition from a mouse to a mouse pad IMO) and I do miss my target a lot of the time, and the transition is almost always sharp, however, that last transition from when it starts to go back to the target should be a slower mouse speed rather than a consistent mouse speed.

Flight

2012-06-29 22:12:48

From: Kyle Undefined
Hey! That looks like my script :p


It was F-Miner in the making:
http://villavu.com/forum/showthread.php?t=68701

From: Hazzah
I use my mouse with higher sensitivity than most (makes it easier to transition from a mouse to a mouse pad IMO) and I do miss my target a lot of the time, and the transition is almost always sharp, however, that last transition from when it starts to go back to the target should be a slower mouse speed rather than a consistent mouse speed.


A good observation, you should check out my BrakeMMouse:
http://villavu.com/forum/showthread.php?t=80386

Footy

2012-09-14 20:31:11

Kind of a grave-dig, but this is a really useful function. I mean, seriously, how often do you move your mouse and land exactly on the target? Every time? I didnt think so. I think it should be used in more scripts, with maybe a 1/5 chance of occuring as opposed to normal mmouse.

djborec

2012-09-18 15:46:12

I use HumanMMouse with SuperWindMouse in all of my private scripts.

Is there any program which will record mouse movement ,so I can play legit for few hours and see how I move mouse to copy it with script then

Footy

2012-09-18 15:50:31

There are some where you can prss play, then it will draw out all your mouse paths between the start and stop of the program onto an image, if thats what you want. Just google it, shouldnt be too hard to find one. You should compare the drawing from you playing legit to your bot, and try to get them to look somewhat the same.

Mat

2012-09-18 16:56:28

I use one and have posted a topic in members showing about the Mice and how I move my Mouse to how Simba's bots do.
And there is a Dramatic difference.
Mat

Footy

2012-09-18 17:02:48

God, mmouse looks awful. Brakemmouse looks much better, but I think we can still improve. Why is your control(first one) so shaky? It looks like you were shivering or something when you made this! When I move my mouse, it moves in a relatively straight line. One second, Ill post me dropping 3 items as well. Thanks for that post, it really shows how much of a difference there is.

E: Nvm, it ended up looking nothing like yours. :p Sometime tonight, I'll post one of my script botting for 10 minutes, and one of me legitting for 10 minutes.