jebus495 Posted January 9, 2009 Share Posted January 9, 2009 Hi there. I've been getting "Recursion level has been exceeded - AutoIt will quit to prevent stack overflow." but only sometimes. It occurs in this part of my script. Func checkhp () $ranphp = random (-8 , 8) $phpcheck = IniRead("autoslasher.ini","Values","hpcheckYvalue","NONE SET") $php = PixelGetColor( 309 +$ranphp, $phpcheck ) $ranchecksleep = random (1000 , 2000) MouseMove ( 309 +$ranphp, $phpcheck ) If $php = 0xFFFFFF Then Sleep (2000+$ranchecksleep) checkhp () EndIf lootseq () EndFunc What I want this to do is wait for a certain color ($php) to turn into something that isn't white before it proceeds. This can take up to a couple minutes sometimes but I need it to check very often. This works perfect if it doesn't need to wait long for that color to change but it is otherwise causing errors. How could I change things to prevent this error? Link to comment Share on other sites More sharing options...
PsaltyDS Posted January 9, 2009 Share Posted January 9, 2009 Hi there. I've been getting "Recursion level has been exceeded - AutoIt will quit to prevent stack overflow." but only sometimes. It occurs in this part of my script. Func checkhp () $ranphp = random (-8 , 8) $phpcheck = IniRead("autoslasher.ini","Values","hpcheckYvalue","NONE SET") $php = PixelGetColor( 309 +$ranphp, $phpcheck ) $ranchecksleep = random (1000 , 2000) MouseMove ( 309 +$ranphp, $phpcheck ) If $php = 0xFFFFFF Then Sleep (2000+$ranchecksleep) checkhp () EndIf lootseq () EndFunc What I want this to do is wait for a certain color ($php) to turn into something that isn't white before it proceeds. This can take up to a couple minutes sometimes but I need it to check very often. This works perfect if it doesn't need to wait long for that color to change but it is otherwise causing errors. How could I change things to prevent this error? Try more like this: Func checkhp() Local $ranphp, $phpcheck, $php While 1 $ranphp = Random(-8, 8) $phpcheck = IniRead("autoslasher.ini", "Values", "hpcheckYvalue", "NONE SET") $php = PixelGetColor(309 + $ranphp, $phpcheck) MouseMove(309 + $ranphp, $phpcheck) If $php = 0xFFFFFF Then Sleep(Random(3000, 4000, 1)) Else ExitLoop EndIf WEnd lootseq() EndFunc ;==>checkhp 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...
jebus495 Posted January 9, 2009 Author Share Posted January 9, 2009 Thank you very much. That looks perfect The Sleep in there only really needs to be like 100 lol. I just kept increasing it to try to reduce the amount I got the error. I don't know why I made it random. =\While we're here.http://www.autoitscript.com/forum/index.php?showtopic=87324? 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