Negative1 Posted July 7, 2010 Posted July 7, 2010 (edited) Hi all, Is it possible to move the mouse more like a human does. Basically I would like to be able to move the mouse by giving it a direction, velocity, and duration of movement. Also I do NOT wish to use the mousemove() function to simulate this, as I am trying to avoid coordinates. Any ideas? Thanks, -1 Edited July 7, 2010 by Negative1 What are we going to do tonight Brain?Same thing we do every night Pinky try to automate the world.
kaotkbliss Posted July 7, 2010 Posted July 7, 2010 You could set all the Mousemove options as variables defined by math functions then put in a loop to recalculate each time through the loop. 010101000110100001101001011100110010000001101001011100110010000 001101101011110010010000001110011011010010110011100100001 My Android cat and mouse gamehttps://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek We're gonna need another Timmy!
Negative1 Posted July 7, 2010 Author Posted July 7, 2010 You could set all the Mousemove options as variables defined by math functions then put in a loop to recalculate each time through the loop.Thanks, but not really what I'm looking for as I'm trying to avoid using coordinates. What are we going to do tonight Brain?Same thing we do every night Pinky try to automate the world.
AdmiralAlkex Posted July 7, 2010 Posted July 7, 2010 (edited) Thanks, but not really what I'm looking for as I'm trying to avoid using coordinates.But MouseMove() uses coordinates so you have to use math, just like kaotkbliss said.Edit: It has been done previously though, search the forum and you may find it. Edited July 7, 2010 by AdmiralAlkex .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface
JohnOne Posted July 7, 2010 Posted July 7, 2010 Where do you plan on moving the mouse to if you dont need co-ordinates? If you dont mind me asking. AutoIt Absolute Beginners  Require a serial  Pause Script  Video Tutorials by Morthawt  ipify Monkey's are, like, natures humans.
Negative1 Posted July 7, 2010 Author Posted July 7, 2010 But MouseMove() uses coordinates so you have to use math, just like kaotkbliss said.Edit: It has been done previously though, search the forum and you may find it.I'm trying to avoid using mousemove() as the original post says. Where do you plan on moving the mouse to if you dont need co-ordinates? If you dont mind me asking.The code I have written knows the direction the mouse must move in. I have attempted using Mousemove() with coordinates relative to the current mouse position with no success. Thus I wish to avoid using any coordinate driving mouse commands if its possible. What are we going to do tonight Brain?Same thing we do every night Pinky try to automate the world.
AdmiralAlkex Posted July 7, 2010 Posted July 7, 2010 What you have said earlier is irrelevant, you're going to use MouseMove() whether you like it or not. .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface
Negative1 Posted July 7, 2010 Author Posted July 7, 2010 What you have said earlier is irrelevant, you're going to use MouseMove() whether you like it or not.You're telling me this entire community of brilliant minds has no way to move the mouse other then MouseMove()?I'm just looking for a starting point and some idea of how much I would have to go through but to simply say it's not possible seams improbable, right? What are we going to do tonight Brain?Same thing we do every night Pinky try to automate the world.
somdcomputerguy Posted July 7, 2010 Posted July 7, 2010 MouseMove() must be used to move the mouse. Coordinates must be used with MouseMove(). You can move the mouse 'up, a little bit', or, 'down and to the left', but you have to use math to convert these statements to numbers that MouseMove understands.This function, MouseGetPos, and some simple math, along with maybe something like the Random function, could do this.. - Bruce /*somdcomputerguy */Â If you change the way you look at things, the things you look at change.
AdmiralAlkex Posted July 7, 2010 Posted July 7, 2010 You're telling me this entire community of brilliant minds has no way to move the mouse other then MouseMove()?I'm just looking for a starting point and some idea of how much I would have to go through but to simply say it's not possible seams improbable, right?Mouses work on x-y coordinates, so there's no way you're gonna avoid that, so you may as well use MouseMove() wince that a native function.To make it look more natural you're gonna need some (a lot?) of math, but as that isn't my strong point I can't help you. But people have done this before, and there are examples on the forum. Someone just need to find them. .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface
JohnOne Posted July 7, 2010 Posted July 7, 2010 I tend to agree with AdmiralAlkex Somewhere down the line a call will be made to the Windows API $MOUSEEVENTF_MOVE (mousemove) Or you will be using another language. AutoIt Absolute Beginners  Require a serial  Pause Script  Video Tutorials by Morthawt  ipify Monkey's are, like, natures humans.
Negative1 Posted July 7, 2010 Author Posted July 7, 2010 Somewhere down the line a call will be made to the Windows API $MOUSEEVENTF_MOVE (mousemove)Would it be any different if I use _winapi_mouse_event "move" rather than mousemove()? What are we going to do tonight Brain?Same thing we do every night Pinky try to automate the world.
Negative1 Posted July 7, 2010 Author Posted July 7, 2010 Thank you all for your help! Special thanks to JohnOne for dropping a hint that led me to my answer: #Include <WinAPI.au3> #include <Constants.au3> _WinAPI_Mouse_Event($MOUSEEVENTF_MOVE,100,100) The above code sends the mouse down and to the right (100)units. The units are relative to the mouses current position and (drum roll) windows mouse speed settings!!!! -1 What are we going to do tonight Brain?Same thing we do every night Pinky try to automate the world.
queensoft Posted September 27, 2011 Posted September 27, 2011 (edited) Great, it worked for me too !!Dead Island game, smooth keyboard and mouse move.Also, relative mouse move.Standard MouseGetPos is always 0, 0 !! Look at me, I'm an idiot and post game automation code even though it's very clearly against the rules and stuff. Edited September 27, 2011 by Valik Removed code, added message.
kaotkbliss Posted September 27, 2011 Posted September 27, 2011 (edited) How would that be any different than $pos = MouseGetPos() MouseMove($pos[0]+100,$pos[1]+100) *edit* Just for fun HotKeySet("{ESC}", "Terminate") While 1 Sleep(10) $ran = Random(-100,100,1) $ran2 = Random(-100,100,1) $pos = MouseGetPos() MouseMove($pos[0]+$ran,$pos[1]+$ran2) WEnd Func Terminate() Exit 0 EndFunc Edited September 27, 2011 by kaotkbliss 010101000110100001101001011100110010000001101001011100110010000 001101101011110010010000001110011011010010110011100100001 My Android cat and mouse gamehttps://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek We're gonna need another Timmy!
Valik Posted September 27, 2011 Posted September 27, 2011 I read this thread because it was reported and i died a little inside. The OP screams they don't want to use coordinates... and then use coordinates. There's a certain bald captain of a starship facepalming right now. Anyway, this thread is probably about game automation but I don't see evidence the OP is trying to do so. I do, however, see an idiot by the name of queensoft posting code that works with Dead Island. The last time I checked Dead Island was a game (I should know, I own it). I've adjusted the post accordingly. I'm tempted to lock the thread for it's complete stupidity (apparently velocity was all the OP was after but coordinates were the big no no, whatever). I'm not, though.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now