Jump to content

Simple loop function


 Share

Recommended Posts

Hi

I tried making my own script basically just pressing 4 once (then sleep for around 8 seconds) then press 2 for like 5 times (with 1 second sleep) then do the function again and again and again til i stop it...

but unfortnately i have no idea how to loop back to te function.. so usually i only end up doing the sequence one

here's what i have:

_________________________________________________________________________________________

Hotkeyset("{HOME}","start")

Hotkeyset("{END}","stop")

Func start()

Sleep(500)

Send("{NUMPAD4}")

Sleep(Random(8000))

Send("{NUMPAD2 5}")

Sleep(Random(1000,1500))

EndFunc

Func stop()

Exit

EndFunc

While 1

sleep(500)

Wend

_______________________________________________________________-

thank you in advance

Link to comment
Share on other sites

Global $Runner

HotKeySet("{HOME}", "start")
HotKeySet("{END}", "stop")

While 1
    Sleep(500)
WEnd

; -------- Functions -------------------

Func start()
    $Runner = Not $Runner
    
    While $Runner
        Sleep(500)
        Send("{NUMPAD4}")
        Sleep(Random(8000))
        Send("{NUMPAD2 5}")
        Sleep(Random(1000, 1500))
    WEnd
EndFunc   ;==>start


Func stop()
    Exit
EndFunc   ;==>stop

8)

Edited by Valuater

NEWHeader1.png

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