ulti Posted February 11, 2011 Share Posted February 11, 2011 (edited) Hello Autoit team has been a while since i posted on these here forums since i have not been useing Autoit.but recently i have i am trying to make mouse click an area and then move back to whare mouse was before it clicked that new area and is working fine.now i want to make it so the script pauses or dosent click the area defined if the mose is doing something mainly currently clicking down on an item "click drag" i cant seam to find out whare i would find that option to monitor a mouse event and then how i would use that information to stop the script and start it again on release of the mouse button. any one have any idears?keep in mind i am still heavly learning. here is my code as it stands atmHotKeySet("^{F9}","Quit") HotKeySet("^{F8}","Start") HotKeySet("^{F7}","Stop") Global $RUN = False $pos = MouseGetPos() While 1 If $RUN Then ClickPoint() Sleep(900) WEnd Func Start() $RUN = True EndFunc Func Stop() $RUN = False EndFunc Func ClickPoint() $pos = MouseGetPos() MouseClick("left",246,589,1,0) MouseMove($pos[0], $pos[1],0) EndFunc Func Quit() Exit EndFunc Edited February 11, 2011 by ulti Link to comment Share on other sites More sharing options...
Rogue5099 Posted February 11, 2011 Share Posted February 11, 2011 (edited) Check out: MouseClick ;Perform a mouse click operation. MouseClickDrag ;Perform a mouse click and drag operation. MouseDown ;Perform a mouse down event at the current mouse position. MouseGetCursor ;Returns the cursor ID Number for the current Mouse Cursor. MouseGetPos ;Retrieves the current position of the mouse cursor. MouseMove ;Moves the mouse pointer. MouseUp ;Perform a mouse up event at the current mouse position. MouseWheel ;Moves the mouse wheel up or down. NT/2000/XP ONLY. OR: #Include <Misc.au3> _IsPressed($sHexKey [, $vDLL = 'user32.dll']) Edited February 11, 2011 by rogue5099 My projects: Inventory / Mp3 Inventory, Computer Stats Link to comment Share on other sites More sharing options...
JoHanatCent Posted February 11, 2011 Share Posted February 11, 2011 start it again on release of the mouse button. any one have any idears?Have you tried _IsPressed ? Link to comment Share on other sites More sharing options...
Newb Posted February 11, 2011 Share Posted February 11, 2011 now i want to make it so the script pauses or dosent click the area defined if the mose is doing something mainly currently clicking down on an item "click drag" i cant seam to find out whare i would find that option to monitor a mouse event and then how i would use that information to stop the script and start it again on release of the mouse button. any one have any idears? I'm a compulsive poster. When I post something, come to read it at least 5 minutes later after the posting, because I will edit it. I edited even this signature a few minutes later after I wrote it. Link to comment Share on other sites More sharing options...
ulti Posted February 11, 2011 Author Share Posted February 11, 2011 yes i uderstand this is not great english but this is not 4chan gtfo of my thread. Link to comment Share on other sites More sharing options...
ulti Posted February 11, 2011 Author Share Posted February 11, 2011 (edited) well to the people that helped thanks a bundle, here is what i came up with. HotKeySet("^{F9}","Quit") ;press CTRL+F9 to exit HotKeySet("^{F8}","Start") HotKeySet("^{F7}","Stop") #Include <Misc.au3> $dll = DllOpen("user32.dll") $lmb = 01 Global $RUN = False $pos = MouseGetPos() While 1 If $RUN Then ClickPoint() Sleep(900) WEnd Func Start() $RUN = True EndFunc Func Stop() $RUN = False EndFunc Func ClickPoint() $pos = MouseGetPos() if _IsPressed($lmb ,$dll)= 0 then MouseClick("left",240,562,1,0) MouseMove($pos[0], $pos[1],0) EndIf EndFunc Func Quit() Exit EndFunc Edited February 11, 2011 by ulti 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