what Repeat Until Rules.... You never need { or } with repeat until
Repeat
Msg Repeat Until Rules
Until The_Disbelivers_Believe
You need them if there's more then one line. I know you can use
while without {} also, as long as the following code is just one line long. Anything longer you need to use {}.
If you just want to check for something that is a one liner,
while sure works great.
set #targCurs 1
while #tarcCurs = 1
wait 0
set #targCurs 1
repeat
{
wait 0
until #targCurs <> 1
}
FindItem or something that is a one line thing, or even a counter or clock would work fine with a
while. A
repeat has to execute the code inside it to determine it's condition, a
while can use whatever is currently in the script.
if C in #charStatus
{
wait 10
gosub cure
}
.....
sub cure
while C in #charStatus
{
cast arch cure, drink cure pots, cleanse by fire
}
return
The gosub is called if the char gets poisoned, but
While will only function if the char is still poisoned. It's like an extra check to see if the char is poisoned.
if C in #charStatus
{
wait 10
gosub cure
}
.....
sub cure
repeat
{
cast arch cure, drink cure pots, cleanse by fire
}
until C notin #charStatus
return
Again, the sub is called if the char is poisoned. Then it will start casting and drinking without verifying the char is still poisoned or not. It must do it at least one time.
In this case you *might* not need to go through the cure process of the sub. Lets say you get poisoned, #charStatus goes to C and the script goes to execute the sub, perhaps you were only poisoned for an instant, like when you are in Vamp Embrace.
While won't even execute it's portion because #charStatus is no longer C.
Repeat will start casting or drinking regardless.
To make
Repeat safe, you would actually have to check #charStatus AGAIN inside it to save it from casting, where
While wouldn't need that check.
I agree that
while *could* cause problems in poorly structured scripts. Same as ANY misused command.