t0ddie Posted January 9, 2005 Author Posted January 9, 2005 im looking at it, i may understand i think what you are trying to say, but its the first time i have tried this concept, i think im going to need to use the paramater 2 to exit the if statement (since exitloop would need to be placed in the if statement) then to exit the nested while loop, and the while loop that was nested IN would pick up the nested while loop from the beginning. i think im thinking.......... ill get another beer and wait for valiks flame... and yeah, im not a dumbass. but i suppose thats a matter of opinion , and to some people, such as the previously mentioned character,... everyone is a dumbass. or, just the people that it doesnt agree are as smart as it thinks it is....i think lol Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.
Insolence Posted January 9, 2005 Posted January 9, 2005 K, don't even try to flame. I'm trying not to flame you, but you keep IGNORING what I say, here's an EASIER solution: While 1 While 1 $var = JoinGame() If $var = 0 Then ExitLoop(1) WEnd WEnd Func JoinGame() ;do stuff If successful Then Return 1 Else Return 0 EndIf EndFunc That is insanely simple, if you don't understand it go back to the help file and start all over. "I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar.
t0ddie Posted January 9, 2005 Author Posted January 9, 2005 (edited) im not flaming anyone lol, i am looking at it some more. thanks i understand the concept, it was just the best means of going about it. ok ok ok... thanks. i have never used the exitloop command before. lol does ignorance make me a dumbass? naw, id say it makes me smarter, since i just learned something. yep, i dont spend 100% of my time scripting.. and i have never had a need to exit a loop before. and i look up commands as i need them, i must have overlooked that one. thanks guys, i think i was overexplaining that problem. Edited January 9, 2005 by t0ddie Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.
t0ddie Posted January 9, 2005 Author Posted January 9, 2005 i get an error saying that exitloop is only valid from inside a for/do/while loop how do i use it conditionally? while 1 while 1 call ("cool) wend wend func cool() if $plr = 0 then leftclick here leftclick there leftclick everywhere exitloop (2) endif ;note i dont want to exitloop here because if $plr <> 0 it should do other stuff before ;the end of the function. do a bunch of stuff that i would only want to do if $plr <> 0 $test = pixelgetcolor(100,100) until $test = 12345 endfunc Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.
Somerset Posted January 9, 2005 Posted January 9, 2005 im not flaming anyone lol, i am looking at it some more. thanksi understand the concept, it was just the best means of going about it.ok ok ok... thanks. i have never used the exitloop command before.loldoes ignorance make me a dumbass?naw, id say it makes me smarter, since i just learned something.yep, i dont spend 100% of my time scripting.. and i have never had a need to exit a loop before.and i look up commands as i need them, i must have overlooked that one.thanks guys, i think i was overexplaining that problem.<{POST_SNAPBACK}> t0ddie if you ever have played poker you gotta be terrible at bluffing. you give away to much info. if you do something stupid, act like you knew what you were doing and carry on.
t0ddie Posted January 9, 2005 Author Posted January 9, 2005 (edited) its only stupid though.... if you knew it before hand.. and made a mistake. this isnt poker, but if it was, maybe then i would lie. its not stupid to admit you learned something new.. anything less.. would be arrogance now i can say "I MEANT TO DO THAT" and you will beleive me. now, how do i uh... arghhh!!! mmm beer. uhm, what do i do about this??? while 1 while 1 call ("cool") wend wend if $plr = 0 then leftclick here leftclick there leftclick everywhere exitloop (2) endif ;note i dont want to exitloop here because if $plr <> 0 it should do other stuff before ;the end of the function. do a bunch of stuff that i would only want to do if $plr <> 0 $test = pixelgetcolor(100,100) until $test = 12345 endfunc Edited January 9, 2005 by t0ddie Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.
t0ddie Posted January 9, 2005 Author Posted January 9, 2005 (edited) so, what can i do to be the equivillant of this example im about to show you, BUT INSTEAD USING ONLY ONE SCRIPT. super basic example here guys..... i mean, this is what im trying to do with the exitloop command, but instead of running script 2 and exiting, it should just exit what its doing, and go to the beginning of the while loop. im going to bed, this is frustrating. ;script 1 while 1 if $plr = 0 then run script 2 exit endif sleep(100) wend ;script 2 click some stuff run script 1 exit Edited January 9, 2005 by t0ddie Valik Note Added 19 October 2006 - 08:38 AMAdded to warn level I just plain don't like you.
Insolence Posted January 9, 2005 Posted January 9, 2005 STOP calling functions like that. Call them like I said at the beginning of the script, USE the returns I said, you cannot do ExitLoop inside the function to effect the while loop OUTSIDE the function. "I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him." - Mark TwainPatient: "It hurts when I do $var_"Doctor: "Don't do $var_" - Lar.
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