Beemer101 Posted April 1, 2005 Share Posted April 1, 2005 HotKeySet("^!z", "Begin") HotKeySet("^!x", "Pause") Pause() Func Begin() WinActivate ( "SwgClient" ) Sleep ( "3000" ) Start() EndFunc Func Start() MouseClick ( "right" , 281, 308 , 1 , 1 ) Sleep ( "1000" ) MouseClick ( "left" , 393, 245 , 1 , 1 ) Sleep ( "1200" ) MouseClick ( "right" , 281, 308 , 1 , 1 ) Sleep ( "1000" ) MouseClick ( "left" , 393, 245 , 1 , 1 ) Sleep ( "1200" ) Start() EndFunc Func Pause() Sleep ( "10000" ) Pause() EndFunc Func MyExit() Exit EndFunc here is the error i recieve: line 0 (file path here) Sleep ( "1000" ) Error: Recursion level has been exceeded - AutoIt will quit to prevent stack overflow. can anyone tell what the problem is? this macro is designed to run repeatedly for really long periods of time. thanks, Beemer Link to comment Share on other sites More sharing options...
buzz44 Posted April 1, 2005 Share Posted April 1, 2005 (edited) try this HotKeySet("^!z", "Begin") HotKeySet("^!x", "Pause") Pause() Func Begin() WinActivate ( "SwgClient" ) Sleep ( "3000" ) While 1 MouseClick ( "right" , 281, 308 , 1 , 1 ) Sleep ( "1000" ) MouseClick ( "left" , 393, 245 , 1 , 1 ) Sleep ( "1200" ) Wend EndFunc Func Pause() While 1 Sleep ( "10000" ) Wend EndFunc Func MyExit() Exit EndFunc Edited April 1, 2005 by burrup qq Link to comment Share on other sites More sharing options...
Beemer101 Posted April 1, 2005 Author Share Posted April 1, 2005 ok i will try that immediately, can you give me any more details as to why that is the answer? just trying to understand the language thanks, Beemer Link to comment Share on other sites More sharing options...
sylvanie Posted April 1, 2005 Share Posted April 1, 2005 Hello your problem is that your function Start() never ends : Start() call Start() before ending but Start() call Start() again which call Start again ..... again Link to comment Share on other sites More sharing options...
Beemer101 Posted April 1, 2005 Author Share Posted April 1, 2005 ok i can understand this... now with this new code how does it keep repeating itself? Link to comment Share on other sites More sharing options...
sylvanie Posted April 1, 2005 Share Posted April 1, 2005 ok i can understand this... now with this new code how does it keep repeating itself?If I understand (sorry , I don't speak english ... shame on me) your question is to know why the 2nd code is all right The difference beetwen your code and Burrup's code is that your function call the same function again and again, so the system need memory for each call.Burrup's code stays in the same function, and doesn't need more memoryIs it what you wonder ? Link to comment Share on other sites More sharing options...
Beemer101 Posted April 1, 2005 Author Share Posted April 1, 2005 no, i just want to know how the second code repeats itself Link to comment Share on other sites More sharing options...
Smed Posted April 1, 2005 Share Posted April 1, 2005 (edited) #define AUT_MAXEXECUTERECURSE 384 // Maximum number of times the Execute() function can recurse to itself Hardcoded... This just gets more fun every day. Edited April 1, 2005 by Smed 601DisengageEnd Program Link to comment Share on other sites More sharing options...
buzz44 Posted April 1, 2005 Share Posted April 1, 2005 (edited) hey, sry i coudlnt assist you, if you want ANY code to repeat to itself you use a While..Wend loop like this While 1 ;Insert Code Here Wend That will loop the code an infinite amount of times unless u tell it to exit or close or wateva edit: actaullyt ill put comments in the first code When you put something in a Function it doesnt perform the code until the function is called, in this case your functions are called until you press a designated hotkey, until then they lay dormant HotKeySet("^!z", "Begin") HotKeySet("^!x", "Pause") Pause();This will "pause" your code, actaully it just repeats *nothing* over and over ;to give the imitation Func Begin(); If u press Ctrl+Alt+Z this wil happen WinActivate ( "SwgClient" ) Sleep ( "3000" ) ;---------------------------------------------- While 1; It will repeat the code seperated an infinite amount of times MouseClick ( "right" , 281, 308 , 1 , 1 ) Sleep ( "1000" ) MouseClick ( "left" , 393, 245 , 1 , 1 ) Sleep ( "1200" ) Wend ;---------------------------------------------- EndFunc Func Pause(); When you press Ctrl+Alt+X The script will be pu in an infinite loop ;again While 1 Sleep ( "10000" ) Wend EndFunc Func MyExit() Exit EndFunc Edited April 1, 2005 by burrup qq Link to comment Share on other sites More sharing options...
Valik Posted April 1, 2005 Share Posted April 1, 2005 #define AUT_MAXEXECUTERECURSE 384 // Maximum number of times the Execute() function can recurse to itselfHardcoded... This just gets more fun every day. <{POST_SNAPBACK}>Its hard-coded so AutoIt can give a soft error (Inform the user with a messagebox) instead of a hard error in which the infamous Application Crash dialog appears since if this goes unchecked, it literally crashes AutoIt. Link to comment Share on other sites More sharing options...
Beemer101 Posted April 3, 2005 Author Share Posted April 3, 2005 ok off topic question... i need to make a seperate script that opens an exe file, how do i do that in v3? like an exmaple would be good. 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