Jump to content

How to limit my script by time


Recommended Posts

Hi all. My script contains alot of func., so if I just do:

$starttime=TimerInit()
do
until TimerDiff($starttime)>15000oÝ÷ Ú+pYp¢¹²Z'«v÷öÚî©ò~éܪޭéZµçm¢-ì¬!ò+ºv§Êíçîɲ¶)vÇ+l¢[­Ý¡ë'ßÛp¢¹+.¬¶*'°èZÜjhÁƧ"j'Ú+¶­¶)Â+ajè·¬±¶«:¹É¸×©emçhëâjè·¬±¶«jëh×6AdlibEnable("myadlib")
Func myadlib()
If GUICtrlRead($progressbar) = 100 Then
exit
endif
EndFunc

But again, how to make a progress bar go to 100% within 15sec without stopping it when I launch one of the existing func?

Link to comment
Share on other sites

AdlibEnable("myadlib")

Func myadlib()
   If TimerDiff($starttime)>15000 Then Exit
   $i = $starttime \ 15000 * 100
   ProgressSet( $i, $i & " percent")
EndFunc

$starttime=TimerInit()
ProgressOn("Progress Meter", "Shutdown", "0 percent")

While 1
   Sleep(100)
WEnd

Edited by Shevilie

Start here if you are new Valuater's AutoIT 1-2-3Looking for an UDF - Look hereDo you need to do it twice - Autoit

Link to comment
Share on other sites

I need just a little more help. I decided not to include progress bar, but to set TraySetToolTip with time lefted till end. I have:

AdlibEnable("myadlib", 60000)
$starttime5=TimerInit()

Func myadlib()
;>>>$timelefted=##NOW WHAT?###<<<
;>>>> I gues here goes: TraySetToolTip($timelefted), but I can't figure how to set $timelefted to read the lefted time till end of the program<<<
If TimerDiff($starttime5)>3600000 Then
msgbox(262144, "end", "the program ended as expected!")
exit
endif
endfunc
Link to comment
Share on other sites

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