STAEDTLER Posted January 21, 2009 Share Posted January 21, 2009 (edited) AutoItSetOption("MouseCoordMode",0) #include <Misc.au3> $dll = DllOpen("user32.dll") While 1 If _IsPressed("01", $dll) Then MouseMove( 0,10, 20) EndIf WEnd DllClose($dll) It doesn't Mouse Move using relative mode for some reason? Script purpose: When I hold left mouse click, it will move my mouse from the current location. Error:MouseCoordMode not working. Edited January 21, 2009 by STAEDTLER Link to comment Share on other sites More sharing options...
bo8ster Posted January 21, 2009 Share Posted January 21, 2009 I notice the help has "Sleep ( 250 )" in the while loop, have you tried putting that in? Post your code because code says more then your words can. SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y. Use Opt("MustDeclareVars", 1)[topic="84960"]Brett F's Learning To Script with AutoIt V3[/topic][topic="21048"]Valuater's AutoIt 1-2-3, Class... is now in Session[/topic]Contribution: [topic="87994"]Get SVN Rev Number[/topic], [topic="93527"]Control Handle under mouse[/topic], [topic="91966"]A Presentation using AutoIt[/topic], [topic="112756"]Log ConsoleWrite output in Scite[/topic] Link to comment Share on other sites More sharing options...
STAEDTLER Posted January 21, 2009 Author Share Posted January 21, 2009 I notice the help has "Sleep ( 250 )" in the while loop, have you tried putting that in?I don't see how that can help. Thank you for trying though. Link to comment Share on other sites More sharing options...
Valuater Posted January 21, 2009 Share Posted January 21, 2009 Maybe you want?? Opt("GUICoordMode", 0) ;1=absolute, 0=relative, 2=cell 8) Link to comment Share on other sites More sharing options...
STAEDTLER Posted January 21, 2009 Author Share Posted January 21, 2009 Maybe you want??Opt("GUICoordMode", 0) ;1=absolute, 0=relative, 2=cell8)No, basically I want my mouse cursor to more in a certain direction when i hold a key(in this case the left mouse button). Link to comment Share on other sites More sharing options...
monoceres Posted January 21, 2009 Share Posted January 21, 2009 No, basically I want my mouse cursor to more in a certain direction when i hold a key(in this case the left mouse button).Use MouseGetPos() and then add/subtract to the values and pass them to MouseMove. Broken link? PM me and I'll send you the file! Link to comment Share on other sites More sharing options...
Richard Robertson Posted January 22, 2009 Share Posted January 22, 2009 AutoIt used to support relative motion... didn't it? Link to comment Share on other sites More sharing options...
STAEDTLER Posted January 22, 2009 Author Share Posted January 22, 2009 (edited) #include <Misc.au3> $dll = DllOpen("user32.dll") While 1 If _IsPressed("01", $dll) Then $array= MouseGetPos() MouseMove( $array[0],$array[1]+10, 2) EndIf WEnd DllClose($dll) This worked but can I make it so that if a key is held down, this script wont run. LShift key? Edited January 22, 2009 by STAEDTLER Link to comment Share on other sites More sharing options...
BrettF Posted January 22, 2009 Share Posted January 22, 2009 Basically its the same as what you've already got with _IsPressed. I'm sure you can work it out Cheers, Brett Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
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