gainstaa Posted August 22, 2007 Share Posted August 22, 2007 Well heres my code, and thanks to all the people who got me this far. What I want this to do is click, press alt+q, click, repeat The clicks work perfectly fine, but the alt+q only works like 30% of the time. Is there a way to make it 100% accurate? If you have any ideas post the code so I can try them out thanks. HotKeySet("{f10}", "_exit") ;<== F10 to exit while 1 MouseClick ( "left",30,328) Sleep(1500) ;<== 1000 is 1 sec, so 5000 is 5 sec of waiting Send("{Alt down}") Send("{q}") Send("{Alt up}") sleep(500) MouseClick ( "left",790,328) Sleep(1500) ;<== 1000 is 1 sec, so 5000 is 5 sec of waiting Send("{Alt down}") Send("{q}") Send("{Alt up}") sleep(500) WEnd Func _exit() Exit EndFunc Link to comment Share on other sites More sharing options...
GMK Posted August 22, 2007 Share Posted August 22, 2007 HotKeySet("{F10}", "_Exit") While 1 MouseClick ( "left",30,328) Sleep(1500) Send("!q") Sleep(500) MouseClick ( "left",790,328) Sleep(1500) Send("!q") Sleep(500) WEnd Func _Exit() Exit EndFuncMaybe it would be more accurate? Link to comment Share on other sites More sharing options...
gainstaa Posted August 22, 2007 Author Share Posted August 22, 2007 HotKeySet("{F10}", "_Exit") While 1 MouseClick ( "left",30,328) Sleep(1500) Send("!q") Sleep(500) MouseClick ( "left",790,328) Sleep(1500) Send("!q") Sleep(500) WEnd Func _Exit() Exit EndFuncMaybe it would be more accurate? Nope that didn't work it still only works like 30% of the time. Link to comment Share on other sites More sharing options...
GMK Posted August 22, 2007 Share Posted August 22, 2007 (edited) I have no way to test this, but perhaps in the time that you're waiting between keyboard shortcuts, the game or window isn't active? It sounds like the game isn't receiving the command. Maybe a WinActivate and WinWaitActive command between keyboard/mouse commands would help. (Just throwing out ideas to try.) Edited August 22, 2007 by GMK Link to comment Share on other sites More sharing options...
gainstaa Posted August 22, 2007 Author Share Posted August 22, 2007 but the window is always active. and i think its just retarded Link to comment Share on other sites More sharing options...
GMK Posted August 22, 2007 Share Posted August 22, 2007 Maybe adjusting the sleep time would help. Just another idea. Link to comment Share on other sites More sharing options...
gainstaa Posted August 22, 2007 Author Share Posted August 22, 2007 i think what it needs to do is hold alt down for 2 seconds, and during that time press q. I cant use the sleep though because it makes the whole program sleep, which doesnt make the games reaction time between buttons change. So if theres a way to make alt get held down for a length of time without sleeping the entire program than w/e that way is should work. If u know how to do the above then post the code, thanks. Link to comment Share on other sites More sharing options...
gainstaa Posted August 22, 2007 Author Share Posted August 22, 2007 i still havnt fixed it so if anyone can help me plz do Link to comment Share on other sites More sharing options...
qazwsx Posted August 22, 2007 Share Posted August 22, 2007 put a sleep(1) after the first alt down and see if that helps. Link to comment Share on other sites More sharing options...
ssubirias3 Posted August 22, 2007 Share Posted August 22, 2007 i think what it needs to do is hold alt down for 2 seconds, and during that time press q. I cant use the sleep though because it makes the whole program sleep, which doesnt make the games reaction time between buttons change. So if theres a way to make alt get held down for a length of time without sleeping the entire program than w/e that way is should work. If u know how to do the above then post the code, thanks.Give the following a try. The higher the number the longer the delay. The Help file will explain these in more detail. When I had issues with send keys and/or mouseclicks not working consistently adjusting the two values fixed the problem. Opt("MouseClickDownDelay", 200) Opt("SendKeyDelay", 200) 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