Jump to content
Sign in to follow this  
blaze

how to make loops

Recommended Posts

blaze

wel i just started with making scripts and i would like know how to make a loop over a period of time in my scripts

here is my script

Opt("SendKeyDownDelay", 1)

Opt("SendKeyDelay", 1)

HotKeySet("{PAUSE}","Escape")

; Settings / Constants

$Health = 0xD69EA5

$CheckHP = 1

$GameWinTitle = "Hero OnLine"

WinActivate($GameWinTitle, "")

WinWaitActive($GameWinTitle, "", 5)

While 1

Send("{v down}")

Sleep("100")

Send("{v up}")

Sleep("100")

Send("{a down}")

Sleep("100")

Send("{a up}")

Sleep("20000")

WEnd

;Func Heal()

;; $GetHealth = PixelGetColor(486, 705)

; If Not $GetHealth = $Health Then

; Send("{1 down}")

; Sleep("100")

; Send("{1 up}")

; Sleep("30000")

; EndIf

;EndFunc

Func Escape()

Exit

EndFunc

thanks btw

Share this post


Link to post
Share on other sites
Klaatu

While True
    DoStuff()
    Sleep(10000) ; wait 10 seconds
WEnd

You mean, like that?


My Projects:DebugIt - Debug your AutoIt scripts with DebugIt!

Share this post


Link to post
Share on other sites
blaze

where shoul i put it or dusent it mater?

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  

×