|
HariKari Wanderer
Joined: 16 Feb 2001 Posts: 57
|
Posted: Sun Feb 10, 2002 8:44 am
Else IF |
Is there any way to do else if's other than the nested #if commands?
The only other way I can think of is
#if (...) {blah;#ab 1}
#if (...) {...else if...;#ab 1}
...else... |
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Sun Feb 10, 2002 2:01 pm |
Nope, zMUD doesn't have an actual elseif command, so you can only do it by putting another #IF inside the else part of the original #IF.
Kjata |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Mon Feb 11, 2002 1:51 am |
quote:
Is there any way to do else if's other than the nested #if commands?
The only other way I can think of is
#if (...) {blah;#ab 1}
#if (...) {...else if...;#ab 1}
...else...
#CASE is about as close as you can get, if all your conditions hinge around the same comparison (ie, %random(1,3)).
Nested #IFs are as close as you can get if you have multiple conditions or if other conditions rely on the outcome of previous conditions.
#IF (mob = alive) {
#if (mob != human) {
#if (mob = ork|hamster of doom|warlord of Candyland) {attack} {don't attack}
} {don't attack, it's human}
} {don't attack, it's dead}
li'l shmoe of Dragon's Gate MUD |
|
|
|
|
|