Guiltyr Posted August 10, 2013 Posted August 10, 2013 Hi everyone. I am an AutoIt newbie and just a general coding noob. I am trying to code something in Autoit to help me automate some tasks online a simple mouseclick and keyboard command type of program. Currently with what I have coded, it seems that it has issues when it reaches the send("{SPACE}") command. Sometimes it will press Space once, but most of the time it totally just doesn't register the two send commands and goes through the rest of the program. Any help would be appreciated. Thanks! Global $Paused HotKeySet("=","togglepause") ;script started by pressing = HotKeySet("x", "terminate") ;script stopped by pressing x While 1 Sleep(500) ToolTip("Not Running Hit '=' to start/pause 'x' to force end!", 0, 0) WEnd Func TogglePause() $Paused = NOT $Paused While $Paused ToolTip("Running!", 0, 0) MouseClick("left",1063,546,1) Sleep(6000) Send("{SPACE}") Sleep(4000) Send("{SPACE}") Sleep(10000) MouseClick("left", 773,718,1) Sleep(5000) MouseClick("left", 1022,603,1) Sleep(2000) WEnd EndFunc Func Terminate() Exit 0 EndFunc
jaberwacky Posted August 10, 2013 Posted August 10, 2013 (edited) Try putting BlockInput in there, don't forget to call it again to allow input. That's only if there is a possibility of a user or another program moving the mouse or pressing keys. IF there is not that possibility then I don't know. It worked for me. Also, the While $paused means that it will run when it is paused. While Not $paused might offer more expected behavior. It works either way though. Edited August 10, 2013 by jaberwocky6669 Helpful Posts and Websites: AutoIt Wiki | Can't find what you're looking for on the Forum? My scripts: Guiscape | Baroque AU3 Code Formatter | MouseHoverCalltips | SciTe Customization GUI | ActiveWindowTrack Toy | Monitor Configuration UDF
Guiltyr Posted August 10, 2013 Author Posted August 10, 2013 Thanks for the quick reply Jaberwocky. I tried adding BlockInput and changed it to Not $paused and I am still getting the same results. First time I ran the program, it would just hit space once. I stopped the program and then restarted it, and it didn't hit space at all. Lol this is driving me crazy, because it seems like i did everything correctly but for some reason its not working for me.
jaberwacky Posted August 10, 2013 Posted August 10, 2013 So what online thing are you trying to automate? Helpful Posts and Websites: AutoIt Wiki | Can't find what you're looking for on the Forum? My scripts: Guiscape | Baroque AU3 Code Formatter | MouseHoverCalltips | SciTe Customization GUI | ActiveWindowTrack Toy | Monitor Configuration UDF
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