Variables in Dragon's Gate
These are the names Merlin keeps while you play Dragon's Gate. The game reports a value, Merlin stores it under the name, and you read it with a $ in front: $health, $roomnum, $target. Settings > Variables shows the same list with each one's current value.
How a value is read, where a variable works and the names Merlin itself keeps are in the Variables Manual. The Scripting Manual has set, keep, lists and conditions.
Until the game has reported a value, the variable is not set. A condition that reads it stops and says why. Ask is set first, or wait for the report:
send skills
waitfor Remain
waitreply
if $sharpready = yes then echo Sharp Weapons is readyThis reads as: ask for the skills list, wait for its header line, wait for the game to finish, then say so if Sharp Weapons is ready to train.
Each table says what a variable holds, what it reads like, what it reads before the game has reported it, and how Merlin learns it. A name ignores case: $hpMax and $hpmax are one variable.
The last column says how Merlin learns the value. Some the game sends Merlin directly. Some Merlin reads off the lines on your screen, so if the line never prints, the value does not move. Some change only when you or a script ask for a listing, such as skills; until the next one, the value is what the last listing said.
Your vitals
| Variable | What it holds | Reads like | Before reported | How Merlin learns it |
|---|---|---|---|---|
$hp | Hit points now | 243 | unset | the game tells Merlin directly |
$hpMax | Hit points maximum | 243 | unset | the game tells Merlin directly |
$health | Hit points as a percent, 0 to 100 | 87 | unset | the game tells Merlin directly |
$ftg | Fatigue now | 90 | unset | the game tells Merlin directly |
$ftgMax | Fatigue maximum | 90 | unset | the game tells Merlin directly |
$stamina | Fatigue as a percent, 0 to 100 | 100 | unset | the game tells Merlin directly |
$psi | Psi points now | 0 | unset | the game tells Merlin directly |
$psiMax | Psi points maximum | 0 | unset | the game tells Merlin directly |
$web | Web now | 0 | unset | the game tells Merlin directly |
$webMax | Web maximum | 0 | unset | the game tells Merlin directly |
$hunger | hungry or ravenous; none when fed | none | none | Merlin reads it off the screen |
$thirst | thirsty, parched or dehydrated; none when quenched | none | none | Merlin reads it off the screen |
$hpword | The health word from the last health | weakened | unset | your last health |
$ftgword | The fatigue word from the last health | fatigued | unset | your last health |
Your body
| Variable | What it holds | Reads like | Before reported | How Merlin learns it |
|---|---|---|---|---|
$posture | standing, lying, sitting, swimming or dead | standing | unset | the game tells Merlin directly |
$standing | yes while standing, else no | yes | unset | the game tells Merlin directly |
$lying | yes while lying down, else no | no | unset | the game tells Merlin directly |
$sitting | yes while sitting, else no | no | unset | the game tells Merlin directly |
$swimming | yes while standing in water, else no | no | unset | the game tells Merlin directly |
$hidden | yes while hidden, else no | no | no | Merlin reads it off the screen |
$dark | yes while too dark to see, else no | no | no | Merlin reads it off the screen |
$inWorld | yes in the game world, no at the menus and creation | yes | no | Merlin reads it off the screen |
$carry | Weight carried, in pounds | 143.3 | unset | the game tells Merlin directly |
$carryMax | Weight you can carry, in pounds | 748 | unset | the game tells Merlin directly |
$gold | Gold coins | 337 | unset | the game tells Merlin directly |
$silver | Silver coins | 623 | unset | the game tells Merlin directly |
Your character
| Variable | What it holds | Reads like | Before reported | How Merlin learns it |
|---|---|---|---|---|
$charactername | The full name | Belka Tam | unset | the game tells Merlin directly, at login |
$firstname | The first name | Belka | unset | your login |
$surname | The surname | Tam | unset | the game tells Merlin directly, at login |
$race | The race | Oog-ra | unset | the game tells Merlin directly, at login |
$class | The class | Barbarian | unset | the game tells Merlin directly, at login |
$alignment | The alignment | chaos | unset | the game tells Merlin directly, at login |
Your hands and gear
| Variable | What it holds | Reads like | Before reported | How Merlin learns it |
|---|---|---|---|---|
$weapon | The readied weapon, as unready takes it, or none | talon sword | none | Merlin reads it off the screen |
$weaponReadied | yes while a weapon is readied, else no | yes | unset | the game tells Merlin directly |
$shield | The strapped shield, as unready takes it, or none | parrying shield | none | Merlin reads it off the screen |
$shieldReadied | yes while a shield is readied, else no | yes | unset | the game tells Merlin directly |
$light | torch, lantern, candle or lamp while one burns in your hand, else none | torch | none | Merlin reads it off the screen |
$items | Everything you wear, hold and carry, as a list of nouns. Not what is inside your bags. | parrying shield|sleeping cap|ring|bag|sack | unset | your last inventory |
$daylight | day or night | night | from Merlin's clock | Merlin reads it off the screen, else Merlin's own clock |
The room
| Variable | What it holds | Reads like | Before reported | How Merlin learns it |
|---|---|---|---|---|
$roomname | The room's name | Academy Pawn | unset | the game tells Merlin directly, each time you enter a room |
$roomnum | The room's number | 10539 | unset | the game tells Merlin directly, each time you enter a room |
$roomarea | The area number | 1 | unset | the game tells Merlin directly, each time you enter a room |
$roomenv | The terrain | Plains/Grasslands | unset | the game tells Merlin directly, each time you enter a room |
$roomexits | The exits, as a list of full words | north|northeast|east|south|west | unset, and unset in a room that lists no exits | the game tells Merlin directly, each time you enter a room |
$roomflags | The room's flags, comma-separated | indoor | unset | the game tells Merlin directly, each time you enter a room |
$roomplayers | Other players here, by short name, comma-separated | Silas | blank | the game tells Merlin directly, each time you enter a room and as players come and go |
$roomplayerlist | The same players as a list | Silas | blank | the game tells Merlin directly, each time you enter a room and as players come and go |
$loot | What your own kill dropped that is still here, as nouns | dagger|helm|coins | blank | Merlin reads it off the screen, from your own kills |
The fight
| Variable | What it holds | Reads like | Before reported | How Merlin learns it |
|---|---|---|---|---|
$target | The creature you last attacked or cast at, as a command takes it | hound or 2nd hound | unset | Merlin reads it off the screen, from your own attacks |
$monster | The first living creature here, as attack takes it; blank when none is alive | warrior | blank | your last look |
$monsters | The living creatures as a list, each as attack takes it | warrior|acolyte|acolyte | blank | your last look |
$monsterlist | The living creatures as the game names them; blank when none is alive | 1st dark clad warrior, 1st unholy acolyte, 2nd unholy acolyte | blank | your last look |
$monstercount | How many living creatures are here | 3 | 0 | your last look |
$position | Your place in the fight line: UDs from the centre, negative toward the back | 0 | 0 | Merlin reads it off the screen |
$roundtime | Seconds left of the current delay | 3 | 0 | the game tells Merlin directly |
$incombat | yes for 35 seconds after fighting was last seen or the game refused something for it; no once the game accepts what it refuses in combat | yes | no | Merlin reads it off the screen |
$combatage | Seconds since fighting was last seen | 12 | unset | Merlin reads it off the screen |
Wounds
| Variable | What it holds | Reads like | Before reported | How Merlin learns it |
|---|---|---|---|---|
$wounded | yes when the last health listed a wound | yes | no | your last health, then the treat lines |
$woundcount | How many wounds it listed | 1 | 0 | your last health, then the treat lines |
$wounds | The wounds as a list: severity, type, part | tiny slash head | unset | your last health, then the treat lines |
$bleeding | yes while a wound bleeds, or hit points fall with no fight | no | no | your last health, and the game tells Merlin directly when hit points fall |
Skills
| Variable | What it holds | Reads like | Before reported | How Merlin learns it |
|---|---|---|---|---|
$skillcount | How many skills the table lists | 22 | 0 | your last skills |
$skillsready | The skills ready to train, by name, comma-separated | Blunt Weapons, Hiding | unset | your last skills |
$skillreadycount | How many are ready | 2 | 0 | your last skills |
$remain(skill) | A skill's Remain number | $remain(Stealth) reads 164 | unset | your last skills |
$level(skill) | A skill's level | $level(Stealth) reads 4 | unset | your last skills |
$ready(skill) | yes when the skill is ready to train, else no | $ready(Hiding) reads yes | unset | your last skills |
$trainnum(skill) | The trainer's number for a skill | $trainnum(Hiding) reads 22 | unset until a train list at a hall | your last train list, remembered across sessions |
$weaves(rune) | Weaves left on a rune | $weaves(vigor) | unset until info magick | your last info magick |
One name per skill
Each of these reads yes when that skill is ready to train, else no. They move whenever a skills list arrives, whether you typed skills, a script sent it, or Merlin asked at login, and the moment the game says a skill is full. Before the first skills list they read no.
$sharpready, $bluntready, $piercingready, $thrownready, $missileready, $brawlingready, $clawingready, $bitingready, $webbingready, $breathweaponready, $berserkready, $martialartsready, $shieldready, $dodgingready, $hidingready, $stealthready, $quickdrawready, $disarmingready, $detecttrapsready, $picklocksready, $pickingpocketsready, $firstaidready, $swimmingready, $ridingready, $bargainingready, $playinstrumentsready, $singingready, $identifyarmorready, $identifyweaponready, $identifygemsready, $identifymagickready, $spellcastingready, $channelingready, $psionicsready, $turnundeadready
Names held for later
These names are taken but hold nothing yet: $roomitems, $roomlit, $container, $casting, $effects. The game does not send that information as data yet. A saved variable cannot use one of these names.