cypher175 Posted April 3, 2009 Posted April 3, 2009 ToolTip(Sleep(30000)) How can I make a ToolTip function work with a Sleep function so it counts up from 0->30 showing the counting in a tooltip..??
Spiff59 Posted April 3, 2009 Posted April 3, 2009 (edited) 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 April 3, 2009 by Spiff59
cypher175 Posted April 3, 2009 Author Posted April 3, 2009 thanks, it works, but it seems a lil too CPU intensive..?? is there any other ways that doesnt make the CPU go up 40% when running that code.??
Spiff59 Posted April 3, 2009 Posted April 3, 2009 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?
Moderators SmOke_N Posted April 3, 2009 Moderators Posted April 3, 2009 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.
cypher175 Posted April 4, 2009 Author Posted April 4, 2009 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..??
Exit Posted April 4, 2009 Posted April 4, 2009 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. Here a sample: _SleepTimerToolTip(5) Func _SleepTimerToolTip($iSeconds) While $iSeconds ToolTip($iSeconds) $iSeconds -= 1 Sleep(1000) WEnd ToolTip("") EndFunc ;==>_SleepTimerToolTip App: Au3toCmd UDF: _SingleScript()
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now