ID:145869
 
Code:
                                            if(usr.reps)
while(usr.reps)
usr.lock = 1
flick("blah",src)
flick("blah", usr)
usr.Blah()
usr.reps--
sleep(10)
usr.lock = 0


Problem description: Need to stop this if the user passes out, but have had no luck. I've tried using break and I've also tried to reset the usr.reps.

while(usr.reps&&!usr.passout)
might work
In response to Rky_nick (#1)
I doubt it. I'll give it a try though. I don't think it will because the user inputs how many reps they would like to do and then it repeats the process that many times. I need to stop that process.
In response to Plagu3r (#2)
while(src.reps&&src.hp>0)


How about that, or whatever variable you are subtracting from.
In response to Kalzar (#3)
Now that my friend will probably work. Thanks. :D
In response to Plagu3r (#4)
Try looking up break.
In response to Blakdragon77 (#5)
He already said he tried that, though I'm not sure why it wouldn't work. break stops the innermost loop it's located in, in this case, only the while() loop.
In response to Lightstream Productions (#6)
Loop up 'break'.
Ummm... Why not use for()?
In response to Jp (#8)
There really isn't much point doing it one way over the other. A while() loop will work just as well as for() here, and in some ways will make more sense.

The extra if() isn't needed, though; it's redundant. These two pieces of code do the exact same thing:

if (blah)
while (blah)
// Do stuff...



while (blah)
// Do stuff...
In response to Blakdragon77 (#5)
Did you even read the first post... God... =/
In response to Xeal (#7)
Read the first post people... And the problem is fixed.. No need to comment more.
In response to Plagu3r (#10)
Thing is, though, break should have worked. If it didn't, then something is wrong that extends past that snippet of code.

Lummox JR