stackover Posted February 3, 2007 Share Posted February 3, 2007 If I set a variable for example $time = TimerInit(). This will be a counter. Is there a comand to stop this counter? Not restart counter. It will be wonderfull that I can stop this timer and set it too to timer = 0. Thanks Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted February 3, 2007 Moderators Share Posted February 3, 2007 $time = TimerInit() Sleep(2000) $diff = TimerDiff($time) MsgBox(0, 'info', $diff & @CR & $time) $time = 0 ;Reset MsgBox(0, 'info', $time) 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 More sharing options...
stackover Posted February 3, 2007 Author Share Posted February 3, 2007 Doesnt work. Timmer still running and when I restart function he starts calling job that was to do after 20 secs Link to comment Share on other sites More sharing options...
Developers Jos Posted February 3, 2007 Developers Share Posted February 3, 2007 Doesnt work. Timmer still running and when I restart function he starts calling job that was to do after 20 secsshow the code you use so we can see what you are doing .... SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
stackover Posted February 3, 2007 Author Share Posted February 3, 2007 (edited) expandcollapse popup;Auto Party Global $AutoParty = False Global $AutoPartyOnOff = False Global $Time4Party = 20000 Global $ChangingAutoParty = 0 HotkeySet ("{F9}", "OnOff") HotkeySet ("{END}", "OnOff") Func OnOff() If @HotKeyPressed = '{F9}' Then $ChangingAutoParty = $ChangingAutoParty +1 If $AutoParty = False Then $AutoParty = True Else $AutoPartyOnOff = False Endif EndIf If @HotKeyPressed = '{END}' Then If $AutoParty = True Then $AutoParty = False $ContAutoParty = 0 $ChangingAutoParty = 0 EndIf EndIf EndFunc While 1 If $AutoParty Then Switch $ChangingAutoParty Case 1 If Not $AutoPartyOnOff Then $AutoPartyOnOff = True $ContAutoParty = TimerInit() ElseIf TimerDiff($ContAutoParty) >= $Time4Party Then MouseClick("Right") $AutoPartyOnOff = False EndIf Case 2 $ChangingAutoParty = 0 EndSwitch EndIf WEnd Im trying to stop $ContAutoParty and restart to 0 and only starts again when I hit F9 PS: Code now no errors Edited February 3, 2007 by stackover Link to comment Share on other sites More sharing options...
/dev/null Posted February 3, 2007 Share Posted February 3, 2007 Im trying to stop $ContAutoParty and restart to 0 and only starts again when I hit F9it's very hard to follow your "logic", based on that code. I do have a strong feeling, that 80% of your code can be eliminated, if ONLY we knew what you want to do.....CheersKurt __________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf * Link to comment Share on other sites More sharing options...
Developers Jos Posted February 3, 2007 Developers Share Posted February 3, 2007 .. and this code never works because it contains errors ..... missing endif .... SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
stackover Posted February 3, 2007 Author Share Posted February 3, 2007 (edited) Are confused my code ? PS; I posted only function that dont counter dont stop.. Sorry I dont post all code coz it have more than 2k lines... Edited February 3, 2007 by stackover Link to comment Share on other sites More sharing options...
/dev/null Posted February 3, 2007 Share Posted February 3, 2007 Are confused my code ?PS; I posted only function that dont counter dont stop.. Sorry I dont post all code coz it have more than 2k lines... yes, confused, and please DON'T post the whole code. Just explain what you want to do. I don't get it .... __________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf * Link to comment Share on other sites More sharing options...
Developers Jos Posted February 3, 2007 Developers Share Posted February 3, 2007 (edited) Are confused my code ?PS; I posted only function that dont counter dont stop.. Sorry I dont post all code coz it have more than 2k lines... we don;t need to see the 2k lines of code.. just a working scriptlet that works and shows your problem .... Edited February 3, 2007 by JdeB SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
stackover Posted February 3, 2007 Author Share Posted February 3, 2007 @ JdeB .. I made changes in code .. now its works .. @/dev/null ... I have a single while for script run all time and one fucntion.. in this function has a counter ... inside while has 2 conditions ... one to stop script ans other to do a thing 20 segs in 20 segs ... when i stop script I want counter stop and got value 0 ... but if I wait 40 sec for exemplo to start script again .. when I press it start doing job that was to be done after 20 segs .. so I know that counter are > than 20 segs .. its thats.. more clear now I hope .. sry for confusion 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