Jump to content

Recommended Posts

Posted

I need to wait X milliseconds before preforming the next action, but the sleep command will interfere with my tray menu... None of the buttons do anything, and I am guessing because the script is "Paused" with the sleep function.

Is there a function for waiting X milliseconds, without pausing the script (so my tray menu items can do something)?

Posted (edited)

I need to wait X milliseconds before preforming the next action, but the sleep command will interfere with my tray menu... None of the buttons do anything, and I am guessing because the script is "Paused" with the sleep function.

Is there a function for waiting X milliseconds, without pausing the script (so my tray menu items can do something)?

Try with TimerInit() and TimerDiff().

Edited by Andreik
Posted

No, it worked.

Func wait($milliseconds)
    $begin = TimerInit()
    While 1
        checkTray()
        if(timerDiff($begin) >= $milliseconds) Then
            ExitLoop
        EndIf
    WEnd
EndFunc

The checkTray() is the routine checking if any buttons were pressed in the tray menu.

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
×
×
  • Create New...