Sign in to follow this  
Followers 0
Bman737

Simple coding questions

5 posts in this topic

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

Share this post


Link to post
Share on other sites



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

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0