-
Notifications
You must be signed in to change notification settings - Fork 1
Scripting
Genie 5 runs Genie 4 .cmd scripts. The engine is a faithful port of Genie 4's Wizard-derived script language — if you've written scripts for Genie 4, Wizard, or StormFront, the syntax is identical and your scripts should just run. New to scripting? This page is a friendly tour; the complete vocabulary is on Scripting Reference.
If a script worked in Genie 4 and doesn't work here, that's a bug we want to hear about — file an issue. Script compatibility is treated as non-negotiable.
Drop .cmd files into your Scripts folder:
- Per character:
Profiles/<Character>-<Account>/Scripts/ - Shared (before you've logged in):
Scripts/
See Application Folders for the exact path on your OS. No restart needed — Genie picks up new files immediately.
Create Scripts/hello.cmd:
echo Hello, %1!
Run it from the command bar (scripts are prefixed with .):
.hello world
Output: Hello, world! — %1 was filled in by the argument you passed.
# A comment is a # followed by whitespace or end-of-line.
# Lines starting with #command are meta-commands (#echo, #put, #stop, ...).
# Variables:
# $name reads a global / live game-state value
# %1, %2 are the arguments passed to the script (%0 is all of them)
# var foo = bar sets a local variable; read it back as %foo
# Send a command to the game:
put look
# Wait for game text matching a label (literal) or regex:
match Done You finish searching.
matchwait
# Or block until a substring appears:
waitfor You can move again
# Pause for seconds:
pause 2.5
waitpause # sleep until the current roundtime expires
# Conditionals on live game state:
if_health < 50 then put cast 1101
if def(weapon) then echo I have a weapon set
# Loops via labels + goto:
LOOP:
put assess
pause 1
goto LOOP
Scripts are roundtime-aware. By default, a put issued while you're in roundtime queues, waits, and respects the type-ahead budget — you don't have to write waitpause; put north everywhere. Use waitpause explicitly only when you need to gate on roundtime expiring before the script proceeds (for example, before computing a value that depends on being able to act).
Because DragonRealms doesn't announce when roundtime ends, the engine schedules its own wake-up from the live roundtime clock — so RT-gated scripts resume correctly. The mechanics are in Scripting Reference.
Every live game-state field is exposed as a $variable, so scripts can read your character's condition directly. Common ones:
| Variable | Holds |
|---|---|
$health, $mana, $spirit, $concentration, $stamina
|
Current vital percentages (0–100). |
$roomname, $roomdesc, $roomexits
|
Current room info. |
$righthand, $lefthand
|
What you're holding. |
$preparedspell |
Prepared spell (or empty). |
$stance |
off / adv / fwd / neu / grd / def. |
$kneeling, $prone, $sitting, $stunned, $hidden, $webbed, … |
Status booleans. |
$roundtime |
Seconds of roundtime remaining. |
Type #vars at the command bar to see the full live list. The complete table is on Scripting Reference.
.myscript arg1 arg2 # run Scripts/myscript.cmd with %1=arg1 %2=arg2
#scripts # list running scripts
#stop myscript # stop one script
#stopall # stop everything
#edit myscript # open it in your editor (set via Display Settings)
A Script Bar above the command bar shows what's running, with stop/edit controls; it hides itself when nothing is running.
A few intentional divergences:
-
Per-character script folders — scripts saved while playing one character live separately from another's. The first-launch migration copies your existing Genie 4
Scripts/across once. -
Undefined
$varaborts the script — rather than silently expanding to empty (a classic Genie 4 bug source), Genie 5 stops with a clear reason. Useif def(name)to test first. -
Comments —
#is a comment only when followed by whitespace or end-of-line.#put northis a meta-command, not a comment. -
gosubfor reusable routines — jumping into a nested/indented block isn't reliable; usegosubfor sub-routines.
The community DR-Genie-Scripts repo has ~55 real scripts, from one-liners to 500+-line hunt loops. Start with the simpler ones (foraging, alchemy, simple buffers) before combat scripts.
- Scripting Reference — the complete language: every statement, variable scoping, the roundtime gate, type-ahead.
- Configuration & Rules — triggers and variables that scripts build on.
-
Lich 5 Integration — running Ruby scripts alongside
.cmd.
Genie 5 — a cross-platform DragonRealms client · Repository · Discord · GPL-3.0
Alpha software. Pages describe current behavior; 🚧 marks roadmap items that aren't shipped yet.
🐤 Start here
🚶 Everyday use
- Connecting & Profiles
- The Interface
- Configuration & Rules
- Scripting
- The Mapper
- Updating Maps & Scripts
- Lich 5 Integration
🏃 Going deeper
- Scripting Reference
- Cross-Zone Travel
- Plugins
- Keeping Up to Date
- AI Advisor (planned)
- Policy Compliance
- Architecture
- Building from Source
- Troubleshooting & FAQ