Veilrunner Help · Scripting

Variables & lists

Variables

#var {name} {value}

#variable also works. This sets a variable on the current character. Variables are saved with the character.

  • Use $name or ${name} anywhere in a later command, alias, trigger or button.
  • The value can do simple math: {$hp-5}.
  • #var {name} shows one variable. #var lists all of them.
  • #unvar {name} deletes one.

Passwords are never stored in variables. They stay in the Keychain.

#var {hp} {100}
#var {hp} {$hp-5}
#var {target} {guard}
#var hp                          show hp
#var                             list variables
#showme HP is $hp
#showme target is ${target}
#if {$hp < 50} {drink potion}
#unvar {target}

Lists

TinTin-style lists of text items on the current character. Positions start at 1.

#list {name} {create|add|get|size|set|insert|delete|clear} ...
  • #list lists every list.
  • #list {name} shows the items in one list.
#list {inv} {create}
#list {inv} {add} {sword}
#list {inv} {add} {shield}
#list {inv} {get} {1} {item}       puts item 1 into $item
#list {inv} {size} {n}             puts the size into $n
#list {inv} {set} {1} {blade}
#list {inv} {insert} {1} {potion}
#list {inv} {delete} {2}
#list {inv} {clear}
#list {inv}                        show items

Flow control

  • #if {condition} {then} or #if {condition} {then} {else}.
  • #elseif {condition} {body} and #else {body} add branches on the same line.
  • #while {condition} {body} repeats the body while the condition is true, up to 1,000 passes.
  • Comparisons such as $hp < 50 work. Other values count as true when they're not empty and not 0.
#if {$hp < 50} {drink potion} {#showme ok}
#if {$target} {kill $target} {#showme no target}
#var {n} {0}
#while {$n < 3} {#var {n} {$n+1};#showme $n}

Still stuck? Email contact@pwr.industries with your Veilrunner version (Veilrunner › About Veilrunner), your macOS version and the MUD you were connected to, or report a bug.