Sign in to follow this  
Followers 0
Ginseng

Multi-Key Presses in 1 Script?

4 posts in this topic

Im looking to write a script to press 7 number keys at different times and then repeat them at different intervals.

For Example:

Press: 4, 5, 6, 7, 8, 9, 0 at begining of script

Then

Press Key 4, 5, 6 after 434 seconds.

Press Key 7 after 578 seconds.

Press Key 8 after 602 seconds.

Press Key 9 after 458 seconds.

Press Key 0 after 25 seconds.

Would it be possible to fit these into 1 script and function how i expect.

I DO NOT WANT THIS WRITING FOR ME THATS NOT WHAT IM ASKING, however if someone feels like doing it i would be grateful, if not then simple point me to the commands/functions i would need to use and i'll figure it out myself.

Thanks for any advice.

Share this post


Link to post
Share on other sites



Something like this?

HotKeySet("{Esc}", "ExitScript")

Send("4567890")

$timer456 = TimerInit()
$timer7 = TimerInit()
$timer8 = TimerInit()
$timer9 = TimerInit()
$timer0 = TimerInit()

While 1
    If TimerDiff($timer456) > 434000 Then
        Send("456")
        $timer456 = TimerInit()
    EndIf
    If TimerDiff($timer7) > 578000 Then
        Send("7")
        $timer7 = TimerInit()
    EndIf
    If TimerDiff($timer8) > 602000 Then
        Send("8")
        $timer8 = TimerInit()
    EndIf
    If TimerDiff($timer9) > 458000 Then
        Send("9")
        $timer9 = TimerInit()
    EndIf
    If TimerDiff($timer0) > 25000 Then
        Send("0")
        $timer0 = TimerInit()
    EndIf
WEnd

Func ExitScript()
    Exit
EndFunc

Pressing Esc will exit the script.

Share this post


Link to post
Share on other sites

Yeah i was just looking at the TimerInIt command in the help files, but i'd never have come up with this. Goddamn HTML and CSS Coding, you really cant remember more than 2 languages at once :s

Thanks alot, i will give it a try, it looks like it will work.

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