Sign in to follow this  
Followers 0
Snuwy

Send Key with Interval ?

2 posts in this topic

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 >.<

Share this post


Link to post
Share on other sites



#2 ·  Posted (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 by sleepydvdr

#include <ByteMe.au3>

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