Jump to content

Send Key with Interval ?


Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...