Program Variables
| EXPLANATION | VARIABLE | MOBILE | ACTOR | VICTIM | RANDOM | OBJECT | 2ND OBJECT | HOLDER | WEARER | FOE |
| for if checks and for a targeting attacks/commands | Name | $i | $n | $t | $r | $o | $p | $h | $w | $f |
| These normally only used for mpechos | short descr | $I | $N | $T | $R | $O | $P | $H | $W | $F |
| he/she/it | $j | $e | $E | $J | -- | -- | -- | -- | -- | |
| him/her/it | $k | $m | $M | $K | -- | -- | -- | -- | -- | |
| his/her/its | $l | $s | $S | $L | -- | -- | -- | -- | -- |
Terms
Note: The term "character" refers to a player or a mob.
| TERM | Explanation and Example(s) |
|---|---|
| MOBILE | Mobile running the program.
EXAMPLE: The mob "Yarkore" has a rand_prog. Inside that program, $i would refer to Yarkore. |
| ACTOR | Character who triggered the program.
EXAMPLE: Mob "Jornold" has an all_greet_prog. When character "Krisneel" walk in the room and the program is triggered, in that program $n would refer to Krisneel. ($i would refer to Jornold) |
| VICTIM | In an "act" program, the character on the other side of the trigger phrase.
EXAMPLE: If your trigger phrase of an act_prog is "p gives", and the phrase that triggers it is: "Majil gives a helmet to Gathuly.", then $t is Gathuly. ($o would be the helmet and $n would be Majil.) |
| RANDOM | A random player in the room. Will never refer to a mob.
EXAMPLE: A room has a simple rand_prog of "mpdamage $r 100" (Perhaps it's a furnace room with tendril of fire raoing the room at random). In the room are players Vandar, Nublan, and Rejay. Also in the room is Vandar's pet dog Ruufie, Nublan's charmie (a hoxan flayer spawn), Rejay's trusty steed Poolgra. Also, there is a fire imp standing there in the room cautiously observing the party of adventurers. At the tick, if the random program triggers, the only possible targets of the "mpdamage" will be Vandar, Nublan, or Rejay. NOTE: The player referred to by $r does not change over the course of the program. |
| OBJECT | In an program called by an object, it refers to the object running the program. Otherwise, it refers to any objects detected in the trigger phrase.
EXAMPLE: Object "sword of destiny" has a get_prog that checks the character-who-picks-it-up's age. $o would refer to the sword of destiny. EXAMPLE: The mob Mentrir is very protective of his bright shiny bauble. If anyone picks it up he will attack them. Therefore he has an act_prog with the trigger phrase "p gets a bright shiny bauble." Inside this program, $o will refer to the bauble. ($n would refer to whoever it was picked it up, and $i would refer to Mentrir.) |
| 2ND OBJECT | Refers to the secondary or "target" object of an action. This one is a little tricky so see the two examples below.
EXAMPLE: The pit of treasure has an act_prog with trigger phrase "p gets", to detect if someone gets anything from any of the chests. Lets assume hapless adventurer Cerv gets a necklace from an iron-bound chest. This would result in "Cerv gets a necklace from an iron-bound chest." Therefore, in the rooms program, the $p would refer to the iron-bound chest. (And $o would be the necklace.) EXAMPLE: A donation box has a program to detect what is put in it. Ok so thats a use_prog. When Erileron puts a diamond ring in the donation box, the program for the box is triggered. In this program, $p will refer to the ring. ($o will refer to the box itself.) |
| HOLDER | Character holding the object. This means they are wearing/wielding/holding it, or it is in their inventory.
EXAMPLE: When the mysterious earth jewel is picked up, it randomly drains the mana of however is holding it. It's rand_prog might have "mpdrain $h 1 mana". Krorn, seeing it on the ground, picks it up. Now, when the rand_prog triggers, $h will refer to Krorn. If the jewel is laying on the ground it is innocuous and $h in the rand prog will refer to nobody. |
| WEARER | Character wearing the item.
EXAMPLE: The pendant of health restores some hitpoints to its "owner" periodically, but only if it is worn. Therefore, in its rand_prog, $w will refer to Plonk, the lucky wizard currently wearing it. If its on the ground, or just in someone's inventory, $w will refer to nobody. This variable is especially useful when combined with "isworn" ifcheck. |
| FOE | Whomever is currently fighting the person who has posession of the object.
EXAMPLE: Uttly is wearing the Ring of Spite. This has a rand_prog with the line "mpdamage $f 300". This will damage the foe of Uttly by 300. If Uttly is not fighting, and the program is triggered, $f will refer to nobody. |