Snuwy Posted June 18, 2011 Posted June 18, 2011 How to create macro that send F1 Every 2 Sec, And F2 Every 20 Sec ? This Script only execute F1 Every 2 s. Global $Paused HotKeySet("{F10}", "TogglePause") HotKeySet("{F11}", "Terminate") While 1 Send("{F1}") Sleep (2000) WEnd While 1 Send ("{F2}") Sleep (20000) WEnd Func TogglePause() $Paused = NOT $Paused While $Paused sleep(100) ToolTip('Script is "Paused"',0,0) WEnd ToolTip("") EndFunc Func Terminate() Exit 0 EndFunc Sorry My English Bad >.<
sleepydvdr Posted June 18, 2011 Posted June 18, 2011 (edited) $i = 1 Do Send ("{F1}") Sleep(2000) If $i = 10 Then Send("{F2}") ; <--- or Send("{F1}{F2}"), depending on what you want $i = 0 EndIf $i = $i + 1 Until $i = -1 Edited June 18, 2011 by sleepydvdr #include <ByteMe.au3>
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