Home

Information
About DR
FAQ
Help Files
- General
- Commands
- Communication
- Rules
- Eternal
Quests
Guilds
- Alchemists
- Barbarians
- Cybertechs
- Dragons
- Paladins
- Mages
- Shape Shifters
Games
Maps
Screenshots

Resources
Connect
- Telnet
Who's On (11:19)
Finger
News (Apr 04, 24)
Notices (Jul 03, 07)
Top Players (11:00)
Logs
Mail Admin

Players
Pictures/Pages
DR Inquirer (Fall 99)

Web Site
Changes (Apr 29, 03)
Other Links
Mail Webmaster

Help Files


command: if <condition> then <command>
         if <condition> then <command> else <other command>
         until <condition> then <command>
         while <condition> then <command>

Do something if a condition is true. If you supply an 'else' clause, do
something else if the condition is untrue. Conditions currently supported
are:

true,
false,
not <condition>,
<condition1> or <condition2> or ...
<condition1> and <condition2> and ...
hp > value, hp < value, hp >= value, hp <= value,
sp > value, sp < value, sp >= value, sp <= value,
money > value, money < value, money >= value, money <= value,
exp > value, exp < value, exp >= value, exp <= value,
intoxicated, intox, drunk,
carrying <object>, carrying <object> in <other object>,
wielding, wielding <weapon>,
wearing <armor>,
present <object>,
on <player>,
fighting, fighting <monster>,
exit <direction>,
%<variable>.

If you use the 'until' verb instead of the 'if' one, this command
will repeat until the condition is true.

If you use the 'while' verb instead of the 'if' one, this command
will repeat until the condition is untrue.

Examples:

if sp >= 20 then fireball else if sp >= 15 then shock else missile
if not carrying bag then do take bag;tag bag
if %fish or %fowl then parse say Either %fish or %fowl is non-zero.
if present orc and hp > 50 then kill orc
if money > 10000000 then say I am Bill Gates!
until exit south then flee
while fighting and sp >= 20 then fireball

Note:

The 'and' condition is prioritized ahead of the 'or' condition, which
means that 'if a or b and c or d' will be true:
 if either a or b is true and also either c or d is true.
not:
 if a or d is true, or if b and c are both true.

Also note that abuse of these commands to annoy players or break game
rules may be considered grounds for banishment.

See also: abort, do, dotimes, parse, pending, restart, suspend, var, walk.


These pages can be made dark, light, or plain.
This page last modified Thursday, 28-Mar-2024 16:09:20 CDT.
Copyright © 1998-2024 Darker Realms LPMud.