Skip to content
Azothy edited this page Mar 11, 2023 · 4 revisions

This section lists all the commands that are available to use from the command line, with examples of appropriate syntax. Command arguments listed in [] are optional.

Command Line References

#beep

This command sends a single beep to the windows sound system.

Syntax

#beep

Examples
This will create a trigger that beep when your character get stunned.

#trigger {eval $stunned = 1} {#beep}

Related commands
#flash
#play

#clear

This command clears the window text buffer of the named window.

Syntax

#clear <window>

window - The name of the window to clear.

Examples
This will clear the 'Thoughts' window.

#clear Thoughts

This will clear the 'Game' window.

#clear Main

('Main' is needed to clear the 'Game' Window specifically)

Related commands
#window

#colors

This command provides you a list of available simple name colors.

Syntax

#colors

Related commands
#echo
#highlight

#comment

This command puts a comment in the named window title.

Syntax

#comment <window> <text>

window - The name of the target window.
text - The text to place in the window title.

Examples
This will put "Hello world!" in the 'Game' window title.

#comment Game Hello world!

This trigger will put the current room name in 'Game' window title.

#trigger {eval $roomname} {#comment Game $roomname}

Related commands
#window

#connect

This command connects you to the game.

Syntax

#connect
#connect <profile>
#connect <account> <password> <character> <instance>

profile - The profile name to connect to.
account - Account name.
password - Account password.
character - Character name.
instance - Game instance short name (DR, DRF, DRP, DRT)

Examples
This command will re-connect to the game using the last known login details.

#connect

This command will connect using the GandalfDR profile. You must create the profile in advance.

#connect GandalfDR

This command will connect to 'DR' instance with character 'Gandalf'.

#connect MYACCOUNT mypw Gandalf DR

Related commands
#profile

#echo

This command sends Text to the 'Game' window by default or to other windows, and can also be used to send colors, using hex code, or the simple color name. Triggers will not react on this information.

Syntax

#echo [>window] [color[,bgcolor]] <text>

text - The text you want to echo.
window (optional) - The window you want to echo to. Default is 'Game'.
color (optional) - Foreground color. Either use hex code or simple name. Use #colors for a list of the simple names.
bgcolor (optional) - Background color.

Examples
This command will echo "Hello cruel world!".

#echo Hello cruel world!

This command will echo "Hello cruel world!" in Yellow.

#echo Yellow Hello cruel world!

This command will echo "Hello cruel world!" in a pink shade.

#echo #ff50ff Hello cruel world!

This command will echo "Hello cruel world!" in a White text with Blue background to the 'Log' window.

#echo >Log White,Blue Hello cruel world!

This command will echo a random number between 1 and 10 in Green.

#echo Green {#random 1 10}

This command will echo "101" in Red.

#echo Red {#evalmath 100+1}

Related commands
#colors

#edit

This command is a shortcut to edit a script. You may change the text edit application using #config editor option.

Syntax

#edit <script>

script - The file name of the script you want to edit.

Examples This command will edit or create a script called myscript.cmd.

#edit myscript

Related commands
#config

#eval

This command evaluates an expression. For more see the section on Expressions and their functions in this help file.

Syntax

#eval <expression>

expression - The expression you want to evaluate.

Examples
This command will echo "test".

#echo {#eval {tolower("TEST")}}

This command will echo "2".

#echo {#eval {count("Abba", "b")}}

This command will save "test" to the 'myvar' variable.

#var myvar {#eval {tolower("TEST")}}

Related commands
#evalmath
#if

#evalmath

This command evaluates a math expression. For more see the section on Math Expressions in this help file.

Syntax

#evalmath <expression>

expression - The math expression you want to evaluate.

Examples
This command will echo "101".

#echo {#evalmath 100+1}

This command will echo "11".

#echo {#evalmath round(10.5)}

Related commands
#eval
#if
#var

#event

This command sends a delayed command. Using this command without arguments lists the event queue.

Syntax

#event
#event <delay> <command>

delay - The delay defined in seconds.
command - The command to execute.

Examples
This command will echo "Hello world!" in 10 seconds.

#event 3 {#echo Hello world!}

This command will echo "PIZZA IS READY!" in 10 minutes.

#event 600 {#echo PIZZA IS READY!}

Related commands
#send
#queue

#flash

This command flashes the current Genie 4 application in the windows task bar.

Syntax

#flash

Examples

#trigger {eval $stunned = 1} {#flash}

Related commands
#beep

#help

This command displays text-documents from your Genie 4 Help/ folder.

Syntax

#help
#help <section>
#help edit <section>

section - The section keyword you want to display.

Examples
This command will show the index, if it exists.

#help

This command will show the section "echo", if it exists.

#help echo

#if

This command evaluates an expression for a true or false result value. For more see the section on Expressions.

Syntax

#if <expression> <true command> [false command]

expression - The expression you want to evaluate. true command - The command to execute if the expression evaluates to true. false command (optional) - The command to execute if the expression evaluates to false.

Examples
This command will echo "true".

#if {1 = 1} {#echo true} {#echo false}

This command will echo "false"

#if {1 = 0} {#echo true} {#echo false}

This command will send "stow right" if your right hand is not empty.

#if {"$righthand" != "Empty} {#send stow right}

Related commands
#eval

#keys

This command lists the available key names used for macros.

Syntax

#keys

Related commands
#macro

#link

This command creates a clickable link in the 'Game' window by default. It can also be used to show links in other windows. Triggers will not react on this information.

Syntax

#link [>window] <text> <link command>

text - The text you want to show.
link command – The command to execute when user clicks on the text.
window (optional) - The window you want to show link in. Default is 'Game'.

Examples
This will send 'north' when the link 'NORTH' is clicked.

#link NORTH north

This command will echo 'Hello World!' when link is clicked.

#link CLICKME #echo Hello World!

Related commands
#echo

#log

Syntax

#log [>name] <text>

name (optional) - The log name to write to. Default is 'CharacternameInstance_Date.log'.
text - The text you want to write to the log file.

Examples
This command will save "Hello world!" to the current log file.

#log Hello world!

This command will save "Remember to remember." to the 'Notes_Date.log' log file.

#log >Notes Remember to remember.

Related commands
#echo

#math

This command does simple math operations on a variable. For more complex math operations use #evalmath command.

Syntax

#math <variable> add/substract/set/multiply/divide/modulus <number>

variable - The variable name you want to use.
number - The decimal number to alter it with.

Examples
This command will add 1 to the variable 'myvar'.

#math myvar add 1

This command will add the value of 'myothervar' to 'myvar'.

#math myvar add $myothervar

Related commands
#evalmath

#parse

This command sends output data to the main windows as if it came from the GAME. This is a good way to test triggers.

Syntax

#parse <text>

text - The text to simulate.

Examples
This command will parse "You've gained a new rank in first aid.".

#parse You've gained a new rank in first aid.

Related commands
#trigger

#play

This command plays a sound file with the .wav extension.

Syntax

#play stop
#play <filename>

filename - The filename you want to play.

Examples
This command will play the alert.wav sound file from the Genie 4 Sounds/ folder, if it exists.

#play alert

This command will stop any sound currently playing.

#play stop

Related commands
#beep
#playsystem

#playsystem

This command plays any of the built in sounds in your Microsoft Windows Operating System. Advanced users may look up available options in their Windows Registry.

Syntax

#playsystem <alias>

alias - SystemAsterisk, SystemDefault, SystemExclamation, SystemExit, SystemHand, SystemQuestion, SystemStart, SystemWelcome, and more ...

Examples
This command will play the Microsoft Windows Exit sound.

#playsystem SystemExit

Related commands
#play

#put

This command sends commands directly to the game without waiting for Roundtime.

Syntax

#put <command>

Examples
This command will send 'look' to the game.

#put look

Related commands
#send

#queue

This command sends a delayed command. Same as #event command, but it will automatically wait for any roundtime to end.

Syntax

#queue clear
#queue <delay> <command>

Examples
This command will clear any commands currently in the queue.

#queue clear

This command will send unhide after 3 seconds (or 3 seconds plus the size of any roundtime at that time)

#queue 3 unhide

Related commands
#event
#send

#script

This command allows you to directly control scripts. This is also where you can set a debug level for troubleshooting your script.

Syntax

#script abort/pause/pauseorresume/resume/trace/vars <script>
#script abort/pause/pauseorresume/resume/trace/vars all
#script abort/pause/pauseorresume/resume all except <script>
#script debug <level> [script]
#script explorer

script - The name of the script you want to target.
level - Available debug levels:
0 = off
1 = goto, gosub, return, labels
2 = pause, wait, waitfor, waitformove
3 = if evaluations
4 = variables, math, evalmath, counter
5 = actions
10 = shows all script rows

Examples
This command will abort all scripts.

#script abort all

This command will pause all scripts except for 'myscript'.

#script pause all except myscript

This command will show a trace of script 'myscript'.

#script trace myscript

This command will set debug level 2 for script 'myscript'.

#script debug 2 myscript

This command will show all script variables for 'myscript'.

#script vars myscript

This command will create a macro that brings up the script explorer window when you press 'F5'.

#macro {F5} {#script explorer}

Related commands
#edit

#send

This command sends text/commands to the game, first putting the text/command in the queue. You may also use the #send shortcut '-'.

Syntax

#send [delay] <command>
-[delay]<command>

Examples
This command will send 'hide' to the game.

#send hide

This command will send 'unhide' to the game.

-unhide

This command will send 'hide' to the game, then 'unhide' after 3 seconds (plus the size of any roundtime left after the 3 seconds.)

#send hide;#send 3 unhide

Related commands
#queue

#statusbar

This command allows you to display text at the bottom of the Genie 4 window in the status bar.

Syntax

#statusbar <index> <text>

index - There are 10 available text slots.
text - The text you want to display.

Examples
This command will display "Hello world!" in the status bar.

#statusbar Hello world!

This command will display "Hello world!" in the 5th slot of the status bar.

#statusbar 5 Hello world!

This trigger will show current monster count in status bar.

#trigger {eval $monstercount} {#statusbar Monster count: $monstercount}

Related commands
#comment

Configuration Commands

#alias

This command is to create/update an 'ALIAS'. An alias is a shorthand for a set of commands. Use $0 $1 $2 ... for user arguments in the command.

Syntax

#alias
#alias <alias> <command>
#alias clear/load/save/edit

Examples
This command will display currently loaded aliases.

#alias

When using this alias the command "sscim" would send "sheath scimitar in harness" to the game.

#alias {sscim} {sheath scimitar in harness}

With this alias the command "af Gandalf head" would send "aim Gandalf" and "fire Gandalf head" to the game.

#alias {af} {aim $1;fire $0}

#class

Class determines if a setting is active or inactive. The class command is used to create/update and activate/inactivate classes.

Syntax

#class
#class <name> on/off
#class all on/off
#class +<name> -<name> ...
#class clear/load/save/edit

Examples
This command will list current classes and their status.

#class

This command activates the class "Swimming".

#class Swimming on

This command activates "Swimming", "Climbing" and inactivates "Hunting".

#class +Swimming +Climbing -Hunting

#config

This command updates the configuration settings. Warning: Do not alter these unless you know what you are doing.

Syntax

#config
#config <setting> <value>
#config load/save/edit

Examples
This command will list all settings and their current value.

#config

This command will mute all sounds.

#config {mute} {1}

This command will change the default editor to UltraEdit (if the given path is correct)

#config {editor} {C:\Program Files\IDM Computer Solutions\UltraEdit\uedit32.exe}

#gag

This command sets text In Game to be ignored thus not sent to your Game Screen. Please note that the pattern is ALWAYS in RegEx format. Warning: Using this feature in the wrong way may render lag and cause Genie 4 to be unusable.

Syntax

#gag
#gag <pattern> [class]
#gag clear

pattern - The pattern to ignore. clear - remove all gags

Examples
This command will list all loaded gags.

#gag

This gag would hide all origami exhales.

#gag {^\w+ exhales into (his|her) .+, then with a tremendous "BANNGG!" smacks it flat between (his|her) hands before tossing away the .+ tattered remains\.$}

This gag would hide this scavenger troll message.

#gag {^The scavenger troll examines its equipment, gauging its value\.$}

#highlight

This command sets the text you want highlighted. When using RegEx you may include () to only highlight what is inside.

Syntax

#highlight
#highlight line/string/beginswith/regex <color> <pattern> [class]
#highlight clear/load/save/edit

Examples
This command will list all loaded highlights.

#highlight

This highlight would make the text matched inside the () Purple.

#highlight {regex} {Purple} {^You reach out with your senses and see (.+) available for (.+)\.$}

This is same as the example above except it belongs to the "Magic" class.

#highlight {regex} {Purple} {^You reach out with your senses and see (.+) available for (.+)\.$} {Magic}

#layout

This command load and save window layout.

Syntax

#layout load/save <filename>

Examples
This command would save the current window layout as "Config/Layout/laptop.layout".

#layout save laptop

This command would load the file "Config/Layout/laptop.layout".

#layout load laptop

#load

This command is simply a short-cut to using each of configuration settings to load from disk.

Syntax

#load all
#load type type type ...

type - vars, aliases, classes, triggers, config, macros, subs, gags, highlights, names, presets, layout, profile

Examples
This command would load all settings.

#load all

This command would load variables, aliases, macros and presets

#load vars aliases macros presets

#macro

This command allows you to set combination keys to send commands.

Syntax

#macro
#macro <keys> <command>
#macro clear/load/save/edit

keys - Type #keys to see a list of available key names. Combine them with the ',' character.
command - The command you want to execute when the keys are pressed.

Examples This command will list all macros and their commands.

#macro

With this macro, pressing 'F4' key would send "sheath" to the game.

#macro {F4} {#send sheath}

With this macro, pressing 'F5' will bring up the script explorer window.

#macro {F5} {#script explorer}

With this macro, pressing 'Shift' + 'Escape' keys would pause all scripts.

#macro {Shift, Escape} {#script pause}

With this this macro, pressing '0' on the numpad would send "sneak down" if hidden, and "down" if not hidden.

#macro {NumPad0} {#if {$hidden = 1} {#send sneak down} {#send down}}

#name

This command sets your list of names to be highlighted.

Syntax

#name
#name <color> <name>
#name clear/load/save/edit

Examples
This command will list all names and their colors.

#name

This would highlight "Gandalf" as Red whenever you see the name in the game.

#name {Red} {Gandalf}

#preset

This command configures the built in Colors.

Syntax

#preset
#preset <setting> <color>
#preset clear/load/save/edit

Examples
This command will list all available presets.

#preset

This command will make your health bar SpringGreen with Black background.

#preset {health} {SpringGreen,Black}

#profile

This command will load or save a profile. For more see the section on Profiles in this help file. You must be connected to the game to be able to save a new profile.

Syntax

#profile load/save

Examples
If you are connected to the game this will save your character unique profile.

#profile save

#save

This command is simply a short-cut to using each of configuration settings to save to disk.

Syntax

#save all
#save type type type ...

type - vars, aliases, classes, triggers, config, macros, subs, gags, highlights, names, presets, layout,profile

Examples
This command would save all settings.

#save all

This command would save variables, aliases, macros and presets

#save vars aliases macros presets

#subs, #substitute

This command configures what you want substituted. Please note that the pattern is ALWAYS in RegEx format. Warning: Using this feature in the wrong way may render lag and cause Genie 4 to be unusable. Use $0 $1 $2 ... to capture match groups.

Syntax

#subs <pattern> <replace with> [class]

pattern - The pattern to match.
replace with - What you want to replace it with.

Examples
This command will list the loaded substitutes.

#subs

This substitute would replace "Roundtime: 10 seconds." with "RT: 10s".

#subs {^Roundtime: (\d+) seconds\.$} {RT: $1s}

#trigger

This command will configure your triggers. A trigger is a command you want to perform when a RegEx pattern is matched. Please note that the pattern is ALWAYS in RegEx format. You may also use 'Evaluate' patterns to trigger on variable changes.

Syntax

#trigger
#trigger <pattern> <command> [class]
#trigger eval <evaluation> <command> [class]
#trigger clear/load/save/edit

Examples
This command will list the current triggers.

#trigger

This will echo "Gandalf attempted to steal from you." if you catch Gandalf stealing from you.

#trigger {^You catch (\w+) making a grab for your pockets\!$} {#echo >Log $1 attempted to steal from you.}

This will echo "Battled dance ended." when your Barbarian dance ends.

#trigger {^You feel your inner fire cool, as the adrenaline pumping effect of your battle dance ends} {#echo >Log $1 Battled dance ended.}

This will create an evaluate trigger that beep when your character get stunned.

#trigger {eval $stunned = 1} {#beep}

#un*

These commands are used to remove settings from memory.

Syntax

#unalias <name>
#unclass <name>
#ungag <pattern>
#unmacro <keys>
#unname <name>
#unsubs <pattern>
#untrigger <pattern>
#unvar <name>

Examples
This command would remove your "Gandalf" name highlight.

#unname Gandalf

#var, #variable

This command creates/updates a 'VARIABLE'

Syntax

#var
#var <name> <value>
#var clear/load/save/edit

Examples
This command will list the current global variables.

#var

This will create a variable named "container" and place the value of "backpack".

#var container backpack

#window

This command is used to control the Genie 4 windows. Use #layout save command to commit changes to the disk.

Syntax

#window add/remove/show/hide <name>

name - The window name you want to target or create.

Examples
This will show the Thoughts window.

#window show Thoughts

AutoMapper Commands

#goto

This command will find the closest path to room id or label and launch the automapper.cmd script to travel to it. The current room must be known.

Syntax

#goto <label or room id>

Examples

#goto bank

Related commands
#mapper

#mapper

This command is used to control the AutoMapper.

Syntax

#mapper
#mapper delete [room id]
#mapper find <room name[|room description]>
#mapper label <text>
#mapper load/save/clear/record/lock/snap/allowdupes/show/hide
#mapper save [filename]
#mapper roomid <id>
#mapper select <room name>
#mapper timeout <milliseconds>
#mapper zoneid [id]
#mapper zonename [name]
#config automapper on/off

Examples
This command will bring up the Auto Mapper Window.

#mapper

This command will set the current map zone id to "7b".

#mapper zoneid 7b

This command will set the current map zone name to "Arthe Dale".

#mapper zonename Arthe Dale

Evaluate

This is relevant for #if, #eval, and the script commands if and eval.

Keywords

and
or
not
true
false
<

Less then

>

More then

=

Equal

!=

Not equal to

<>

Not equal to

Functions

contains(source text, search text)
count(source text, search text)
element(source text, index)
endswith(match text)
indexof(source text, search text)
instr - see contains()
instring - see contains()
lastindexof(source text, search text)
len(source text)
length - see len()
match(source text, match text)
matchre(source text, pattern)
replace(source text, replace text)
replacere(source text, pattern, replacement text)
startswith(match text)
substr(source text, start index, end index)
substring - see substr()
tolower(source text)
toupper(source text)
trim(source text)

Evaluate Math

This is relevant for #evalmath and script evalmath command.

Keywords

e
pi

Functions

cos(number)
sin(number)
tan(number)
floor(number)
ceiling(number)
max(number1, number2)
min(number1, number2)
arcsin(number)
arccos(number)
arctan(number)
sqrt(number)
log(number)
log10(number)
abs(number)
round(number[,decimals])
ln(number)
neg(number)
pos(number)

Clone this wiki locally