Jump to content

ToolTip(Sleep(30000)) How to Display a Counting SleepTime ToolTip..?


Recommended Posts

If you want to display actual seconds, then something like this might do you:

Dim $x
$Timer = TimerInit()
While $x < 30
    $x = Int(TimerDiff($Timer)/1000)
    Tooltip($x,100,100)
Wend
Edited by Spiff59
Link to comment
Share on other sites

  • Moderators

Sorry, try adding a sleep()...

$x =0
$Timer = TimerInit()
While $x < 30
    Sleep(1)
    $x = Int(TimerDiff($Timer)/1000)
    Tooltip($x,100,100)
Wend

Better?

Just a FYI, the minimum sleep with AutoIt's Standard Sleep() function is 10ms, so Using Sleep(1) through Sleep(9) is the same as Sleep(10). (Just in case you weren't aware)

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

how could i turn all that code into a Function so i could call it like _SleepTimerToolTip(#) and instead of putting the # of seconds in the While $x < 30 put it inside the _SleepTimerToolTip(#)

get what im sayin..??

how would ya do this..??

Link to comment
Share on other sites

how could i turn all that code into a Function so i could call it like _SleepTimerToolTip(#) and instead of putting the # of seconds in the While $x < 30 put it inside the _SleepTimerToolTip(#)

get what im sayin..??

how would ya do this..??

I would prefer it in a countdown manner. Then you know, how long it takes to the end. :D

Here a sample:

_SleepTimerToolTip(5)

Func _SleepTimerToolTip($iSeconds)
    While $iSeconds
        ToolTip($iSeconds)
        $iSeconds -= 1
        Sleep(1000)
    WEnd
    ToolTip("")
EndFunc   ;==>_SleepTimerToolTip

App: Au3toCmd              UDF: _SingleScript()                             

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