Jump to content

Recommended Posts

Posted

I'm trying to figure out a way to perform a 60 minute +10ms countdown timer and once it hits 0, then it will execute a command. I'm just not sure how I would do the timer.

Posted
  On 4/10/2021 at 3:14 PM, Nine said:

image.png.f83efe7ec6e348f177b0da3e4e70f8de.png

image.png.8065d3d11969dc45497ff3129adb13e0.png

Look in help file for those topics, you should be able to perform what your are intending to do with those functions.

Expand  

I cant find a way to make it display a timer though so I can visually see it counting down before it executes the command

 

  • Moderators
Posted

Dxnny,

  Quote

I cant find a way to make it display a timer though so I can visually see it counting down

Expand  

There is a logical contradiction in those 2 statements - how can you see it if you cannot make it display?

Why not post the code you are using - see here how to do it - then we can perhaps offer you some sensible advice.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

  Reveal hidden contents

 

Posted (edited)

Here is a way I use time, it would be more effective to use the clock on pc if you need accuracy. 
Hotkeys - ESC quits, PAUSE will pause.

HotKeySet("{ESC}", "quit")
HotKeySet("{PAUSE}", "pause")
$clock = 0
$minutes = 0
$seconds = 0
$pause = True

Func quit()
    Exit
EndFunc   ;==>quit

Func pause()
    If ($pause) Then
        $pause = False
    Else
        $pause = True
    EndIf
EndFunc   ;==>pause

While $minutes < 60
    If ($pause) Then
        If ($clock == 1000) Then
            $clock = 0
            $seconds = $seconds + 1
        EndIf
        If ($seconds == 60) Then
            $seconds = 0
            $minutes = $minutes + 1
        EndIf
            $clock = $clock + 1
        ToolTip($minutes & "." & $seconds)
    EndIf

WEnd
ToolTip("timeUp")
Sleep(10000)

 

Edited by major_lee

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
  • Recently Browsing   0 members

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