Bman737 Posted February 25, 2010 Share Posted February 25, 2010 Hello, this is my first day using autoit, but i have read threw some documentation( 1-2-3, autoit help, forum posts) Here is my dilemma, I have never coded or scripted, so please forgive my newbieness. What I am trying to accomplish is this. I am trying to create a script/exe that when it starts, it activates a specific window, then, starts the loop to press one, wait one second, press 1 again wait one second, press 2, wait one second, so on till 3, after three i would like it to wait 100 seconds, and restart the process. I would also like it to be terminated with escape. This is what i have come up with WinActivate ( "RF Online" ) HotKeySet("{ESC}", "Terminate") While 1 ;starts loop send("{1}") sleep(1000) send("{1}") sleep(1000) send("{2}") sleep(1000) send("{2}") sleep(1000) send("{3}") sleep(1000) send("{3}") sleep(1000000) WEnd Link to comment Share on other sites More sharing options...
JohnOne Posted February 25, 2010 Share Posted February 25, 2010 (edited) And do you have a question ? You probably want to send your keys like this send("1") Edited February 25, 2010 by JohnOne AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
jvanegmond Posted February 25, 2010 Share Posted February 25, 2010 Your script looks good. You forgot to add the "Terminate" function. github.com/jvanegmond Link to comment Share on other sites More sharing options...
Bman737 Posted February 25, 2010 Author Share Posted February 25, 2010 Ok, After another hour or so of testing, i came with this. My question is, i tried to add SendKeyDownDelay, but im not too sure on the syntax of it, could anyone help clarify please? Thanks in advanced. HotKeySet("{ESC}", "Terminate") WinActivate ( "RF Online" ) SendKeepActive("RF Online") If WinActive("RF Online") Then While 1 ;starts loop Send("{F1}") Sleep(1000) send("{F1}") Sleep(1000) send("{F2}") Sleep(1000) send("{F2}") Sleep(1000) Send("{F3}") Sleep(1000) Send("{F3}") Sleep(1000) Send("{F4}") Sleep(1000) Send("{F4}") Sleep(1000) send("{F5}") Sleep(1000) send("{F5}") Sleep(10000) ContinueLoop WEnd EndIf Func Terminate() Exit 0 EndFunc Link to comment Share on other sites More sharing options...
JohnOne Posted February 25, 2010 Share Posted February 25, 2010 Opt("SendKeyDownDelay", 10); = ten millisecond delay before the key is released. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. 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