Jump to content

Timer and then execute a command


Recommended Posts

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.

Link to post
Share on other sites
2 hours ago, 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.

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

 

Link to post
Share on other sites
  • Moderators

Dxnny,

Quote

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

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:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to post
Share on other sites

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

    No registered users viewing this page.

×
×
  • Create New...