xCobra15x Posted April 8, 2016 Share Posted April 8, 2016 Hi all, I am looking for a quick tip on why my autoit script crashes when I run a timer. Currently I have this code: ....(more code above this).... Case $button2 function1() Case $butTimer _Timer_setTimer($hGUI, 3200, "_timedout") ...... Func _timedout() Msgbox(0, "Timed out", "Time is up!") Endfunc When the button is pressed, my timer starts, correct? It doesnt seem to matter if I have it on button activation or not, after the time goes by for a bit, it crashes. Seemingly when the time is up, my script crashes. Thanks for your help! Link to comment Share on other sites More sharing options...
markyrocks Posted April 8, 2016 Share Posted April 8, 2016 Can we see the rest of the code? Spoiler "I Believe array math to be potentially fatal, I may be dying from array math poisoning" Link to comment Share on other sites More sharing options...
xCobra15x Posted April 8, 2016 Author Share Posted April 8, 2016 While I know seeing the rest of my code can be beneficial, it's a group effort and I don't want to share everyone's work. Everything works perfectly until the button press that in my mind is starting the timer. Is that correct? I have tested the functioning program that doesn't include the timer and it works fine. It is ONLY when the button for the timer is pressed that the program freezes. I have never used timers with autoit before, and am new to the whole timer process. I need a timer I can vary the amount of time for to countdown, when the countdown is complete, the timer will then activate a function. This was just a test timer to see if the idea would work. Can I get general help with trying to make a timer work? Link to comment Share on other sites More sharing options...
markyrocks Posted April 8, 2016 Share Posted April 8, 2016 Idk man I hear the help file is useful good luck Spoiler "I Believe array math to be potentially fatal, I may be dying from array math poisoning" Link to comment Share on other sites More sharing options...
xCobra15x Posted April 8, 2016 Author Share Posted April 8, 2016 I've tried the help file and followed it to the point that the program crashes. I assume the program crashes because it's not meant to be when a button is pressed, but I just wanted to verify this and see if there were ideas out there. No need to be rude. Link to comment Share on other sites More sharing options...
alien4u Posted April 8, 2016 Share Posted April 8, 2016 Hi @xCobra15x Example 2 on Help file for _Timer_SetTimer() will help you. I did not play with this yet, but your code does not look even near to that example. Happy coding. Kind Regards Alien, Link to comment Share on other sites More sharing options...
markyrocks Posted April 8, 2016 Share Posted April 8, 2016 rude? Its hard to speculate what is happening in your script if you don't post other parts of it..... Idk what the problem is... you press a button .. time goes by a msgbox pops up. script is over. theres not crash just the end. Again without seeing other parts can't really say much else. your saying an amout of time goes by button press or no and it crashes anyway. Doubtful this has anything to do with the timer portion but who knows bc we can't see. using the timer functions are well documented in the help file. and .... good luck.... Spoiler "I Believe array math to be potentially fatal, I may be dying from array math poisoning" Link to comment Share on other sites More sharing options...
AutoBert Posted April 8, 2016 Share Posted April 8, 2016 (edited) The snippet TE posted don't throw's the error. The crash is a result of the code he hasn't posted maybe the real callback func. And nobody can, without seeing code showing the issue, do more then saying helpfile is your friend, all other is wasted time. Reading in tea leaves and analyzing will give better result => a good cup of tea. Edited April 9, 2016 by AutoBert markyrocks 1 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