Oldschool Posted November 28, 2007 Share Posted November 28, 2007 (edited) Alright, in this basic example the so to say Session Timer works if $GUISessionTime value stays low... If you make the $GUISessionTime = 180 or something significant, it stops working...meaning the session never ends. I'm totally stomped here... Is there a better way to do this? #include <file.au3> HotKeySet("{ESC}", "Terminate") $GUISessionTime = 10 ;minutes ;IniRead(@ScriptDir & "\myProg.ini", "Options", "SessionTime", "") ;MsgBox(0, "Reading .ini GUI session time", $GUISessionTime) $SessionTime = (($GUISessionTime * 60000) + Random(- 30000, 60000, 1)) _FileWriteLog(@DesktopDir & "\myProg.log", " SessionTime = " & $SessionTime ) $SessionTimer = TimerInit() While 1 Sleep(100) If TimerDiff($SessionTimer) > $SessionTime Then ExitLoop EndIf WEnd _FileWriteLog(@DesktopDir & "\myProg.log", " SessionTimer exceeded desired session time.") EndSession() Func EndSession() Sleep(500) Send("{SPACE}") Terminate() EndFunc ;==>EndSession Func Terminate() _FileWriteLog(@DesktopDir & "\myProg.log", "////////////// Exited Script/////////////////////////////////////////") Exit 0 EndFunc ;==>Terminate Edited November 28, 2007 by Oldschool Link to comment Share on other sites More sharing options...
weaponx Posted November 28, 2007 Share Posted November 28, 2007 Did you actually set it to 180 minutes and wait 180 minutes for it to end? Maybe you should create a gui with a label showing time elapsed and time remaining.I posted an example a while back:http://www.autoitscript.com/forum/index.ph...amp;hl=btnstart Link to comment Share on other sites More sharing options...
Oldschool Posted November 28, 2007 Author Share Posted November 28, 2007 Did you actually set it to 180 minutes and wait 180 minutes for it to end? Maybe you should create a gui with a label showing time elapsed and time remaining.Well, this structure is part of another script, and yes I let the script run, come back after the supposed session end, and it's still running.I can use _NowCalc() I guess instead of this...I'm almost positive that TimerDiff() is limited somehow... Link to comment Share on other sites More sharing options...
Oldschool Posted November 29, 2007 Author Share Posted November 29, 2007 (edited) UP No one else ever had this problem with TimerDiff() ??? What are my other options controlling run time? Plz Edited November 29, 2007 by Oldschool Link to comment Share on other sites More sharing options...
PsaltyDS Posted November 29, 2007 Share Posted November 29, 2007 Try this simplification to see if you have a real problem (which I doubt): $iTimer = TimerInit() $sStart = @HOUR & ":" & @MIN & ":" & @SEC Do Sleep(100) Until TimerDiff($iTimer) > (180 * 60 * 1000) ; 3Hrs MsgBox(64, "Time Test", "Start: " & $sStart & @CRLF & " End: " & @HOUR & ":" & @MIN & ":" & @SEC) Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
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