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 ready

This 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

VariableWhat it holdsReads likeBefore reportedHow Merlin learns it
$hpHit points now243unsetthe game tells Merlin directly
$hpMaxHit points maximum243unsetthe game tells Merlin directly
$healthHit points as a percent, 0 to 10087unsetthe game tells Merlin directly
$ftgFatigue now90unsetthe game tells Merlin directly
$ftgMaxFatigue maximum90unsetthe game tells Merlin directly
$staminaFatigue as a percent, 0 to 100100unsetthe game tells Merlin directly
$psiPsi points now0unsetthe game tells Merlin directly
$psiMaxPsi points maximum0unsetthe game tells Merlin directly
$webWeb now0unsetthe game tells Merlin directly
$webMaxWeb maximum0unsetthe game tells Merlin directly
$hungerhungry or ravenous; none when fednonenoneMerlin reads it off the screen
$thirstthirsty, parched or dehydrated; none when quenchednonenoneMerlin reads it off the screen
$hpwordThe health word from the last healthweakenedunsetyour last health
$ftgwordThe fatigue word from the last healthfatiguedunsetyour last health

Your body

VariableWhat it holdsReads likeBefore reportedHow Merlin learns it
$posturestanding, lying, sitting, swimming or deadstandingunsetthe game tells Merlin directly
$standingyes while standing, else noyesunsetthe game tells Merlin directly
$lyingyes while lying down, else nonounsetthe game tells Merlin directly
$sittingyes while sitting, else nonounsetthe game tells Merlin directly
$swimmingyes while standing in water, else nonounsetthe game tells Merlin directly
$hiddenyes while hidden, else nononoMerlin reads it off the screen
$darkyes while too dark to see, else nononoMerlin reads it off the screen
$inWorldyes in the game world, no at the menus and creationyesnoMerlin reads it off the screen
$carryWeight carried, in pounds143.3unsetthe game tells Merlin directly
$carryMaxWeight you can carry, in pounds748unsetthe game tells Merlin directly
$goldGold coins337unsetthe game tells Merlin directly
$silverSilver coins623unsetthe game tells Merlin directly

Your character

VariableWhat it holdsReads likeBefore reportedHow Merlin learns it
$characternameThe full nameBelka Tamunsetthe game tells Merlin directly, at login
$firstnameThe first nameBelkaunsetyour login
$surnameThe surnameTamunsetthe game tells Merlin directly, at login
$raceThe raceOog-raunsetthe game tells Merlin directly, at login
$classThe classBarbarianunsetthe game tells Merlin directly, at login
$alignmentThe alignmentchaosunsetthe game tells Merlin directly, at login

Your hands and gear

VariableWhat it holdsReads likeBefore reportedHow Merlin learns it
$weaponThe readied weapon, as unready takes it, or nonetalon swordnoneMerlin reads it off the screen
$weaponReadiedyes while a weapon is readied, else noyesunsetthe game tells Merlin directly
$shieldThe strapped shield, as unready takes it, or noneparrying shieldnoneMerlin reads it off the screen
$shieldReadiedyes while a shield is readied, else noyesunsetthe game tells Merlin directly
$lighttorch, lantern, candle or lamp while one burns in your hand, else nonetorchnoneMerlin reads it off the screen
$itemsEverything you wear, hold and carry, as a list of nouns. Not what is inside your bags.parrying shield|sleeping cap|ring|bag|sackunsetyour last inventory
$daylightday or nightnightfrom Merlin's clockMerlin reads it off the screen, else Merlin's own clock

The room

VariableWhat it holdsReads likeBefore reportedHow Merlin learns it
$roomnameThe room's nameAcademy Pawnunsetthe game tells Merlin directly, each time you enter a room
$roomnumThe room's number10539unsetthe game tells Merlin directly, each time you enter a room
$roomareaThe area number1unsetthe game tells Merlin directly, each time you enter a room
$roomenvThe terrainPlains/Grasslandsunsetthe game tells Merlin directly, each time you enter a room
$roomexitsThe exits, as a list of full wordsnorth|northeast|east|south|westunset, and unset in a room that lists no exitsthe game tells Merlin directly, each time you enter a room
$roomflagsThe room's flags, comma-separatedindoorunsetthe game tells Merlin directly, each time you enter a room
$roomplayersOther players here, by short name, comma-separatedSilasblankthe game tells Merlin directly, each time you enter a room and as players come and go
$roomplayerlistThe same players as a listSilasblankthe game tells Merlin directly, each time you enter a room and as players come and go
$lootWhat your own kill dropped that is still here, as nounsdagger|helm|coinsblankMerlin reads it off the screen, from your own kills

The fight

VariableWhat it holdsReads likeBefore reportedHow Merlin learns it
$targetThe creature you last attacked or cast at, as a command takes ithound or 2nd houndunsetMerlin reads it off the screen, from your own attacks
$monsterThe first living creature here, as attack takes it; blank when none is alivewarriorblankyour last look
$monstersThe living creatures as a list, each as attack takes itwarrior|acolyte|acolyteblankyour last look
$monsterlistThe living creatures as the game names them; blank when none is alive1st dark clad warrior, 1st unholy acolyte, 2nd unholy acolyteblankyour last look
$monstercountHow many living creatures are here30your last look
$positionYour place in the fight line: UDs from the centre, negative toward the back00Merlin reads it off the screen
$roundtimeSeconds left of the current delay30the game tells Merlin directly
$incombatyes for 35 seconds after fighting was last seen or the game refused something for it; no once the game accepts what it refuses in combatyesnoMerlin reads it off the screen
$combatageSeconds since fighting was last seen12unsetMerlin reads it off the screen

Wounds

VariableWhat it holdsReads likeBefore reportedHow Merlin learns it
$woundedyes when the last health listed a woundyesnoyour last health, then the treat lines
$woundcountHow many wounds it listed10your last health, then the treat lines
$woundsThe wounds as a list: severity, type, parttiny slash headunsetyour last health, then the treat lines
$bleedingyes while a wound bleeds, or hit points fall with no fightnonoyour last health, and the game tells Merlin directly when hit points fall

Skills

VariableWhat it holdsReads likeBefore reportedHow Merlin learns it
$skillcountHow many skills the table lists220your last skills
$skillsreadyThe skills ready to train, by name, comma-separatedBlunt Weapons, Hidingunsetyour last skills
$skillreadycountHow many are ready20your last skills
$remain(skill)A skill's Remain number$remain(Stealth) reads 164unsetyour last skills
$level(skill)A skill's level$level(Stealth) reads 4unsetyour last skills
$ready(skill)yes when the skill is ready to train, else no$ready(Hiding) reads yesunsetyour last skills
$trainnum(skill)The trainer's number for a skill$trainnum(Hiding) reads 22unset until a train list at a hallyour last train list, remembered across sessions
$weaves(rune)Weaves left on a rune$weaves(vigor)unset until info magickyour 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.