Developers Jos Posted December 17, 2006 Developers Share Posted December 17, 2006 This code is really wrong in many many ways. You are using CAll. You are "calling" Restart from within itself .... will cause a stack overflow. Run Tidy and it will tell you are missing an EndIF.. First try to make some code that works .. then add the nice to haves ... 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...
Dieuz Posted December 17, 2006 Author Share Posted December 17, 2006 (edited) This code is really wrong in many many ways.You are using CAll.You are "calling" Restart from within itself .... will cause a stack overflow.Run Tidy and it will tell you are missing an EndIF..First try to make some code that works .. then add the nice to haves ... Yes your right with the stack overflow. Ho yeah, and sorry if this code is wrong in many many many many ways but it's my first one and it's why I'm here to ask...How could I correct this stack overflow because I think it's the priority.Run Tidy and it will tell you are missing an EndIF..I just forgot it when I copied/pasted it on the forum. My script can run fine during 4-5 hours but it close due to this stack overflow. Edited December 17, 2006 by Dieuz Link to comment Share on other sites More sharing options...
mikehunt114 Posted December 18, 2006 Share Posted December 18, 2006 How could I correct this stack overflow because I think it's the priority.Rework your code so that functions are not calling themselves. Most likely you can use a loop to do what you desire. IE Dev ToolbarMSDN: InternetExplorer ObjectMSDN: HTML/DHTML Reference Guide[quote]It is surprising what a man can do when he has to, and how little most men will do when they don't have to. - Walter Linn[/quote]--------------------[font="Franklin Gothic Medium"]Post a reproducer with less than 100 lines of code.[/font] Link to comment Share on other sites More sharing options...
Dieuz Posted December 18, 2006 Author Share Posted December 18, 2006 (edited) Rework your code so that functions are not calling themselves. Most likely you can use a loop to do what you desire. Do you think that those modificiations will correct the stack overflow? I changed the call for a While/Wend so the function is not calling itself. expandcollapse popup;Hotkeys HotKeySet("{HOME}", "Terminate") ; HotKeySet("{F2}", "Start") ; HotKeySet("{F4}", "Pause") ; ;Variables Global $Paused $ColorAttack = Pixelgetcolor(837,464) $ColorVictory = Pixelgetcolor(402,169) $Color5wins = Pixelgetcolor(595,387) $Trophyswon = 0 $ColorBug = Pixelgetcolor(840,467) While 1 sleep(100) Wend Func Start() ; happen only one time ;Stuff here Restart() EndFunc Func Restart() While ;Stuff here ;5 WINS If Else ;stuff here EndIf Wend EndFunc Func Pause() ;stuff here EndFunc Func Terminate() Exit(0) EndFunc I incorporated the winner function in the Restart function. Edited December 18, 2006 by Dieuz Link to comment Share on other sites More sharing options...
mikehunt114 Posted December 18, 2006 Share Posted December 18, 2006 Do you think that those modificiations will correct the stack overflow? Yes, I do. IE Dev ToolbarMSDN: InternetExplorer ObjectMSDN: HTML/DHTML Reference Guide[quote]It is surprising what a man can do when he has to, and how little most men will do when they don't have to. - Walter Linn[/quote]--------------------[font="Franklin Gothic Medium"]Post a reproducer with less than 100 lines of code.[/font] Link to comment Share on other sites More sharing options...
Dieuz Posted December 18, 2006 Author Share Posted December 18, 2006 Yes, I do.Cheers! 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