You are on page 1of 260

EasyUO Documentation

EasyUO Documentation
Table of Contents
Preface ............................................................................................................................................... i
Introduction............................................................................................................................... i
Revision History ....................................................................................................................... i
Credits..................................................................................................................................... iv
1. Getting Started .............................................................................................................................1
Introduction...............................................................................................................................1
A simple tutorial .......................................................................................................................1
Installation ................................................................................................................................3
2. Language Reference .....................................................................................................................5
Variables ...................................................................................................................................5
Expressions ...............................................................................................................................6
Operators...................................................................................................................................7
Control Structures...................................................................................................................11
I. Command Reference ..................................................................................................................15
I. Control-flow commands ......................................................................................................17
II. Client commands................................................................................................................29
III. Event commands...............................................................................................................51
IV. Shop Commands...............................................................................................................73
V. Menu Commands...............................................................................................................77
VI. Namespace commands .....................................................................................................99
VII. Miscellaneous commands .............................................................................................107
II. System Variable Reference .....................................................................................................119
VIII. Character Info System Variables..................................................................................121
IX. Status Bar System Variables...........................................................................................129
X. Container Info System Variables .....................................................................................147
XI. Last Action System Variables.........................................................................................157
XII. FindItem System Variables ...........................................................................................173
XIII. Shop Info System Variables.........................................................................................183
XIV. Extended Info System Variables..................................................................................189
XV. Client Info System Variables ........................................................................................199
XVI. Combat Info System Variables ....................................................................................207
XVII. Namespace System Variables.....................................................................................215
XVIII. Miscellaneous System Variables...............................................................................219
XIX. Constants System Variables.........................................................................................237

iii
A. Design Hotkey Manager..........................................................................................................243
B. GNU Free Documentation License.........................................................................................245
PREAMBLE .........................................................................................................................245
APPLICABILITY AND DEFINITIONS .............................................................................245
VERBATIM COPYING .......................................................................................................247
COPYING IN QUANTITY..................................................................................................247
MODIFICATIONS ...............................................................................................................247
COMBINING DOCUMENTS .............................................................................................249
COLLECTIONS OF DOCUMENTS ...................................................................................250
AGGREGATION WITH INDEPENDENT WORKS ..........................................................250
TRANSLATION...................................................................................................................250
TERMINATION ...................................................................................................................251
FUTURE REVISIONS OF THIS LICENSE .......................................................................251

iv
Preface

Introduction
Copyright (C) 2003-2004 Codename Alexandria Project. Permission is granted to copy, distribute
and/or modify this document under the terms of the GNU Free Documentation License, Version
1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no
Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section
entitled "GNU Free Documentation License".
This document was created to have an easy-to-update multiple format document solution for
EasyUO.
The document itself was written in DocBook XML and have been converted to several formats
using xsltproc, OpenJade and docbook-utils.
The information contained in this manual is intended for people who develop scripts using EasyUO
This manual consists primarily of a Command Reference and a System Variable Reference, but
also contains a Language Reference.
You can download this manual in several formats. The download page can be found at Codename
Alexandria (http://codename-alex.sourceforge.net/easyuo-docs)

Revision History
Table 1. EasyUO Documentation Revision History

Version Date Description


1.0.0 RC1 June 4th, 2003. First public release.
1.0.0 RC2 June 6th, 2003. Includes fixes from Spewy and
Cheffe.
1.0.0 RC3 June 7th, 2003. More fixes from Spewy. Added
Roadkill’s findEnemyArray
sub to the #enemyID
description. Explained the
format of #time and #date.
1.0.0 June 9th, 2003. Added str and #strRes.
1.0.1 June 25th, 2003. Added getUOTitle and sound.

i
Preface

Version Date Description


1.0.2 July 15th, 2003. Added event Property and
#property.
1.0.3 July 17th, 2003. Added Code Formatting
Operators. Fixed event
Property and #property to
include version number.
1.0.4 July 24th, 2003. Added namespace variables
chapter, nameSpace,
#nsName, #nsType and #dot.
Updated sound.
1.0.5 July 28th, 2003. Some typos were corrected.
The Variables section was
revisited. Description of #true
and #false now lists their
numerical value.
1.0.6 July 30th, 2003. Some system variables read
and write state were corrected:
#contPosX, #contPosY and
#strRes. Default state for
nameSpace and linesPerCycle
commads has been clarified.
1.0.7 August 16th, 2003. Updated #lHandID and
#rHandID. Updated event
Macro so that Dispel is correct.
Updated #findRep to include
the value for invulnerable
reputation (yellow). Added
option G_{dist} to findItem.
Fixed a typo in getUOTitle.
Removed some unnecessary
text in shutDown. Added
Imtcb’s examples and fixes to
many commands.

ii
Preface

Version Date Description


1.0.8 September 30th, 2003. Updated nameSpace. Updated
#lHandID and #rHandID
example to show the correct
usage. Updated return to
include an expression. Added
#result, #opts, and #euoVer
system variables.
1.0.9 October 1st, 2003. Updated return and event
PathFind.
1.0.10 November 12th, 2003. Added event ExMsg.
1.0.11 January 27th, 2004. Added #FR, #CR, #PR, #ER,
#maxMana, #maxStam,
#maxFol, #luck, #minDmg,
#maxDmg, #sysTime, #lpc,
#contName, #cliLogged,
#lLiftedType, #lLiftedKind,
menu Combo, menu Font
Transparent, menu Shape.
Updated event Macro to reflect
reality.
1.0.12 February 21st, 2004. Inserted missing initEvents in
Something useful. Fixed a
typo in deleteJournal. Fixed
the syntax of menu Edit
1.0.13 March 8th, 2004. Clarified examples within the
Namespace commands
section. Added a note to
deleteVar about it being
deprecated. Updated the
description of menu Get to
reflect it working for both
combo boxes and edit boxes.
1.0.14 April, 16th, 2004. Fixed #opts from #opt. Added
tile, menu List, menu Set,
menu Check, #tileType,
#tileZ, #tileCnt. Updated
onHotKey, ignoreItem, click.
Fixed a typo in Subs.
1.0.15 June, 10th, 2004. Added #jIndex.

iii
Preface

Version Date Description


1.0.16 October, 31st, 2004. Added new event Macro
values for Samurai Empire.
Updated the example for
#jIndex.

Credits
This documentation was written by ScriptFellow with the assistance of the.WZA. Parts were
copied and inspired by previous EasyUO manuals, like the online reference and the old PDF
manual.
Examples created by ScriptFellow, the.WZA, Cheffe, Roadkill, Imtcb, CEO, and UncleDave.
Spewy, Cheffe and Imtcb helped fix typos, misconceptions, bugs, problems and the likes.
daemonknight provided an explaination for the fonts of event ExMsg.
Kal In Ex provided the event Macro values for Samurai Empire.

iv
Chapter 1. Getting Started

Introduction

What is EasyUO?
EasyUO is a FREE piece of software, that enables you to write scripts that makes your characters
in Ultima Online do, pretty much, anything possible.
Simple answer, but what does that mean? An example:

msg #smc Hello Sosaria$


halt

This is a very simple example. The possibilities are endless and are really only limited by your
imagination. Read on, and see more in the What can EasyUO do? section.

What can EasyUO do?


The posibilities in EasyUO are, pretty much, only limited by your own imagination. Here are a
couple of ideas:

• Skill training
• Crafting
• Purchasing
• and anything else you might come up with

A simple tutorial

What do I need?
In this tutorial we assume that you are running the latest Ultima Online client and that you have
installed the latest EasyUO update.
To get started, follow these simple guidelines:

1
Chapter 1. Getting Started

1. Make sure you have the correct EasyUO version for the current client version.
2. Start your Ultima Online client (Remeber it only works with the 2D client).
3. Start the EasyUO program.
4. Log in with a character.

Your first EasyUO script


Copy and Paste, or type in the following program:
msg #smc Hello there!$
halt

Now press the Run icon or press F9 inside the EasyUO program. Your character will now whisper:
"Hello there!".

Something useful
Now we are going to try and do something more useful. We will move the character using the
move command:
; calculate a new x coordinate based on our current position
set %newX #charPosX + 2
; calculate a new y coordinate based on our current position
set %newY #charPosY + 2
; move the character to the new position
move %newX %newY 0 10s
halt

Now we are going to open a pack using some of the event commands. First, we need to identify the
ID of your pack:

1. Make sure you have the variable view open. Press Ctrl-R or choose View|Variables|Show.
2. Open the mainpack by double clicking it in your paperdoll.
3. Find the #LOBJECTID variable in the list.
4. Write down the value that’s next to #LOBJECTID. It consists of 6-8 letters. That’s your packs
ID.
Then copy and paste this script into EasyUO, be sure to edit it where noted:
initEvents

2
Chapter 1. Getting Started

; the id of your pack. change it to the value you wrote down


set %pack XYZ
; assign your pack’s ID to the last object id system variable
set #lObjectID %pack
; run UO’s client macro for "Use Last Object"
event Macro 17
halt

What’s next?
With what you know now you should be able to understand most of the manual and also the
various example scripts available in the example archives. You can also find other examples on the
easyuo.com (http://www.easyuo.com) website.

Installation
Installation of EasyUO is extremely simple.
Download the zipped file from the EasyUO site (http://www.easyuo.com) and unzip it to whatever
directory you prefer.
Then simply run the EasyUO.exe file.
REMEMBER! EasyUO only works with the 2D client.

3
Chapter 1. Getting Started

4
Chapter 2. Language Reference

Variables

Basics
Variables in Easy UO come in four types; Standard, Namespace, Persistent and System. The type
of a variable is defined by its first character. Repectively Standard variables start with a percent
sign, Namespace variables with an exclamation mark, Persistant variables with an asteriks sign and
System variables with an hash sign.
Variable names follow the same rules as other labels in EasyUO. A valid variable name starts with
a letter or underscore, followed by any number of letters, numbers, or underscores.
set %var Bob
set %Var Joe
msg %var %Var ; outputs "JOE JOE"

set %4bank not_yet ; invalid; starts with a number


set %_4bank not_yet ; valid; starts with an underscore

Standard Variables
Standard variables in EasyUO are represented by a percent sign (%) followed by the name of the
variable. The variable name is case insensitive.

Namespace Variables and Scope


Namespace variables in EasyUO are represented by an exclamation mark (!) followed by the name
of the variable. Namespace variable name is case insensitive.
Namespace variables visibility is affected by the nameSpace command.
Namespace variables within a local namespace can only be accessed by the current script.
Namespace variables within a global namespace can be accessed by all scripts running in the same
instance of EasyUO (not yet available).

Persistent Variables
Persistent variables in EasyUO are represented by a asteriks sign (*) followed by a number
between 1 and 1000 (both inclusive).

5
Chapter 2. Language Reference

Persistent variables are shared between all instances of EasyUO running on the computer.
Persistent variables are stored in the registry under the key
HKEY_CURRENT_USER\Software\EasyUO.

System Variables
System variables in EasyUO are represented by an hash sign (#) followed by a descriptive text.
System variable name is case insensitive.
System variables are all described in detail in the System Variable Reference.

Variable Scope
The different variable types have different scope depending on different things. Here is an
explaination of how it works:

Table 2-1. EasyUO Variables

Type Scope
Standard Scope is limited to the current script running.
Standard Variables are cleared when EasyUO
exits.
Namespace Scope is defined by using the nameSpace
command. A Local namespace is accessible to
the current script running only. A Global
namespace is accessible to all scripts running
in the same EasyUO instance (not yet
available). Namespace Variables are cleared
when EasyUO exits.
Persistent Scope is limited to all scripts running on the
same computer. Persistent Variables are stored
in the registry and not cleared when EasyUO
exits.
System Scope is typically defined by the current
Ultima Online instance for the current script
running. System Variables are not saved by
EasyUO upon exit.

6
Chapter 2. Language Reference

Expressions
Expressions are important building blocks in an EasyUO script. They can be used to create
relatively advanced integer mathematics.
An expression can be a simple constant value or it can be a more advanced mathematical
expression.
set %var 2 + 2

Operators

Arithmetic Operators
Remember basic arithmetic from school? These work just like those.

Table 2-2. Arithmetic Operators

Example Name Result


%a + %b Addition Sum of %a and %b.
%a - %b Subtraction Difference of %a and %b.
%a * %b Multiplication Product of %a and %b.
%a / %b Division Quotient of %a and %b.
%a % %b Modulo Remainder of %a divided by
%b.

Comparison Operators
Comparison operators, as their name implies, allow you to compare two values.

Table 2-3. Comparison Operators

Example Name Result


%a = %b Equal #true if %a is equal to %b.
%a <> %b Not equal #true if %a is not equal to
%b.
%a < %b Less than #true if %a is less than %b.
%a > %b Greater than #true if %a is greater than
%b.

7
Chapter 2. Language Reference

Example Name Result


%a <= %b Less than or equal to #true if %a is less than or
equal to %b.
%a >= %b Greater than or equal to #true if %a is greater than or
equal to %b.
%a in %b Contained In #true if %a is a sub string in
%b.
%a notIn %b Not contained in #true if %a is not a sub string
in %b.
The result will always be #false if invalid operands are used, e.g. "if hello > 33".
With this you could also find out if a variable contains a valid number:
set %cnt invalid
if ! ( %cnt > 0 || %cnt < 1 )
set %cnt 0
set %cnt %cnt + 1

Code Formatting Operators


Table 2-4. Code Formatting Operators

Example Name Result


+ line concatenation (Must be used as the first
operator on a line, except
white space) Concatenates the
current line to the previous
line, so that EasyUO sees it as
one long line.
display ok This
+ is
+ all
+ on
+ one
+ line.$
halt

8
Chapter 2. Language Reference

Logical Operators
Table 2-5. Logical Operators

Example Name Result


%a && %b And #true if both %a and %b are
#true.
%a || %b Or #true if either %a or %b is
#true.
! %a Not #true if %a is not #true

String Operators
Table 2-6. String Operators

Example Name Result


, concatenation Returns a concatenation of the
left and the right arguments.

Array Operators
There is only one array operator in the EasyUO scripting language. The dot operator:
initEvents

set %a1 10
set %a2 20
set %a3 40

for %i 1 3
{
; This sets the variable %a to the content of the %a[%i]
set %a %a . %i
event SysMessage %a
}

Precedence and associativity


In an expression that contains multiple operators, EasyUO uses a number of rules to decide the
order in whiche operators are evaluated. The first and most important rule is called operator
precedence. Operators in an expression that higher precedence are executed before operators with

9
Chapter 2. Language Reference

lower precedence. For example multiplication has a higher precedence than addition. In the
expression 2 + 3 * 4, the multiplication is done before the addition, producing a result of 14.
If consecutive operators in an expression have the same precedence, a rule called associativity is
used to decide the order in which those operators are evaluated. An operator can be
left-associative, right-associative, or non-associative:

• Left-associative operators of the same precedence are evaluated in order from left to right. For
example, adition and substraction have the same precedence and they are left associative. In the
expression 10 - 4 + 2, the substraction is done first because it is to the left of the addition,
producing a value of 8.
• Right-associative operators of the same precedence are evaluated in order from right to left.
• A non-associative operator cannot be combined with other operators of the same precedence.

Table 2-7. Operator precedence and associativity

Precedence Operator Associativity


1a . right-associative
2a , left-associative
3 () non-associative
4 - (unary) ! right-associative
5 */% left-associative
6 +- left-associative
7 < > <= >= in notIn left-associative
8 = <> left-associative
9 && left-associative
10 || left-associative
Notes:
a. Note about the dot (array operator) and comma (concatenation) operators: These operators
have the highest precedence. They are special for they are evaluated before everything else
(including commands). This property enable their use in any context like this:
dis . play yes , no ok h , a , l , t

Examples:
set %r 5 + 3 * 2 ; 5 + ( 3 * 2 ) = 11

set %r 8 - 3 - 2 ; ( 8 - 3 ) - 2 = 3

set %r 1 + 2 * 2 ; 1 + ( 2 * 2 ) = 5

10
Chapter 2. Language Reference

set %r 1 + 2 * 2 * 4 ; 1 + ( ( 2 * 2 ) * 4 ) = 17

set %r ( 1 + 2 ) * 2 * 4 ; ( ( 1 + 2 ) * 2 ) * 4 = 24

set %a 3
set %z3 8 ; z[a]
set %w8 1337 ; w[z[a]]
set %euo %w . %z . %a
display ok %euo
halt

Control Structures

if
The if construct is one of the most important feature of many languages, the EasyUO scripting
language included. It allows for conditional execution of code fragments. The basic syntax of the
command is:
if ( expression )
statement

As described in the section about expressions expr is evaluated to its boolean value. If it evaluates
to #true the statement will be executed.
The following code fragment will display ’a is bigger than b’ if %a is bigger than %b:
initEvents

set %a 1
set %b 0
if %a > %b
event SysMessage a is bigger than b

Often you would want to have more than one statement executed conditionally. Of course, there is
no need to wrap each statement in an if clause. Instead, you can group several statements into a
statement group. For example, this code would display a is bigger than b if %a is bigger than %b,
and would then assign the value of %a into %b:
initEvents

set %a 10
set %b 2
if %a > %b
{
event SysMessage a is bigger than b

11
Chapter 2. Language Reference

set %b %a
}

if statements can be nested indefinitely within other if statements, which provides you with
complete flexibility for conditional execution of the various parts of your script.

else
Often you would want to execute a statement if a certain condition is met, and a different statement
if the condition is not met. This is what else is for. else extends an if statement to execute a
statement in case the expression in the if statement evaluates to #false. For example, the
following code would display a is bigger than b if %a is bigger than %b, and a is NOT bigger than
b otherwise:
initEvents

set %a 10
set %b 20
if %a > %b
{
event SysMessage a is bigger than b
}
else
{
event SysMessage a is NOT bigger than b
}

Note: Right now it is not possible to nest if commands and use else. Only one if, if you are
using else.

for
The for loop is a loop that counts a variable either up or down.
for variable from_value to_value
{
statement
}

The loop starts by assigning the from_value to the variable, runs the loop. Then it either increments
or decrements, depening on which way the loop is going, running the loop for each value.

Note: At the moment, you must ALWAYS use brackets with FOR.

12
Chapter 2. Language Reference

Subs
The term sub is short for subroutine. Subs are an important feature of the EasyUO script, that will
make your scripts more logically structured, easier to read, and will make you have to write less
code.
A basic sub definition starts with a sub statement followed by the subs name (sub names are case
insensitive), a number of script lines and ends with a return statement.
sub testSub
...
return

If parameters were added to the calling gosub command they will be present in the variables %1,
%2, and so on. The variable %0 holds the number of parameters passed. As all variables are in the
global scope, the %0, %1, %2.. will be overwritten if you call another sub from inside a sub.

Note: Don’t GOTO out of a sub. Always use return! EasyUO will probably not crash but it is
VERY bad programming style.
Currently, inline comments don’t work with the sub command (this’ll get fixed in a future
update).

gosub
The gosub command transfers the execution to a sub with the name given by the parameter.
gosub sub_name

Parameters can be added after the sub name. They will be transfered in the variables %1, %2, and
so on. The variable %0 holds the number of parameters passed.

return
The return command transfers the execution back to where the sub was called using gosub.
return

goto
The goto command moves the execution to another part of the script. The destination point is given
by a label.
goto label_name

13
Chapter 2. Language Reference

Labels
A label specifies a point in the code where you can goto to.
label_name:

14
I. Command Reference
I. Control-flow commands
call

Name
call — Transfers execution to another script file

Synopsis
call {file} [parameter...]

Description
The call command will transfer execution to another script. It will run the script until it meets the
exit command or the end of the file.

Note: Right now EasyUO doesn’t really support strings. Therefore, CALL won’t work if the path
to a file contains any spaces. Use the DOS short filename syntax to get around this problem.
wrong: C:\My Documents\blabla.txt
correct: C:\MyDocu~1\blabla.txt

Example
call subs.txt recall %runebookid %runenum
halt

See Also
exit

cmpPix

Name
cmpPix — Compares a current pixel to a previously saved pixel.

19
Control-flow commands

Synopsis
cmpPix {number} [[[t] | [f]] | {[t] | [f]} {lines}]
...

or

cmpPix {number} [[t] | [f]]


{
...
}

Description
The cmpPix command compares the pixel given by {number} previously saved with savePix
command. If it evaluates to either true or false (given by the option) it will execute the next
statement or statement block.

Table 1. cmpPix options

Option Description
t If pixel compares to the previously saved pixel
the statement or statement block is executed.
f If pixel does not compare to the previously
saved pixel the statement or statement block is
executed.

Example
;Go to the client login screen and make
;sure your mouse cursor is not over the
;Quit button (upper right corner)
;Start the script and move your mouse
;over the Quit button. The client will
;close even if you don’t make a click.

savePix 580 13 1
comparePixelAgain:
cmpPix 1 f 2
key F4 Alt
halt

20
Control-flow commands

goto comparePixelAgain

See Also
savePix, #pixCol

exit

Name
exit — Stops the execution of the current script

Synopsis
exit

Description
exit will stop the execution of the current script. If it’s called from inside a script that was called
using call it will resume execution from the line under the call statement. If the exit is used from
the main script, the script will start over.

Example
msg %pet %command $
if %pet = all
exit
msg %pet follow me $

See Also
call

21
Control-flow commands

for

Name
for — Creates a counting loop

Synopsis
for {variable} {start} {end}
{
...
}

Description
The for command controls a loop that iterates a variable over a range of numbers (both up or down
works).
The loop starts assigning the variable with the starting number, there after for each loop it either
increments or decrements the variable, until it reaches the ending number.

Example
for %i 1 20
{
msg %i $
wait 10
}

gosub

Name
gosub — Transfers execution to the matching sub.

22
Control-flow commands

Synopsis
gosub {sub name} [parameters...]

Description
The gosub command transfers execution to sub with the name given (Read about subs). It will run
the script until it meets the return, then it returns to where it was called, and executes from the
next line.

Example
gosub Mine
gosub RecallHome
gosub GoInside
gusub Smelt
gosub PutInChest
halt

See Also
return, Subs

goto

Name
goto — Moves execution to another part of the script given by a label.

Synopsis
goto {label name}

Description
The goto command moves the execution to another part of the script. The destination point is given
by a label.

23
Control-flow commands

Note: Currently, inline comments don’t work with labels (this’ll get fixed in a future update).

Note: Don’t GOTO out of a sub. Always use return! EasyUO will probably not crash but it is
VERY bad programming style.

Example
findAgain:
; find an item by it’s type
findItem XML

; ignore it if it’s on the ground


if #findKind = 1
{
ignoreItem #findID
goto findagain
}

; if there’s no more, stop processing


if #findKind = -1
goto done

; do something to the item

goto findAgain

done:
halt

See Also
Control Structures, Labels

24
Control-flow commands

halt

Name
halt — Ends the script.

Synopsis
halt

Description
The halt command ends the execution of the script. The script cannot be restarted. This command
does exactly the same as stop.

See Also
Control Structures, stop

if

Name
if — Executes code based on the evaluation of an expression.

Synopsis
if {expression} [lines]
...

or

if {expression}
{
...
}

25
Control-flow commands

Description
The if command executes a block of code, depending on the evaluation of an expression. If the
expression evaluates to true, the code-block is evaluated, if the expression evaluates to false, the
code-block is not evaluated.

See Also
Expressions, Control Structures

pause

Name
pause — Temporarily stops the execution of the current script.

Synopsis
pause

Description
The pause command will stop the execution of the current script, but it can be resumed by pressing
the "Play" button.

Example
findItem XML
if #findKind = -1
{
event SysMessage You are out of XML’s. Please refill.
pause
}

26
Control-flow commands

return

Name
return [ expression ] — Returns from a sub.

Synopsis
return [expression]

Description
The return command returns you from a sub to the line after the gosub that called the sub. If an
expression is given the #result system variable is set to the result.

Example
gosub testSomething
; this line will be executed after return
msg #result $
...
halt

sub testSomething
...
return %a * %b

See Also
gosub, #result

stop

Name
stop — Ends the script.

27
Control-flow commands

Synopsis
stop

Description
The stop command ends the execution of the script. The script cannot be restarted. This command
does exactly the same as halt.

See Also
Control Structures, halt

28
II. Client commands
chooseSkill

Name
chooseSkill — Reads the current skill value/lock status for a specific skill

Synopsis
chooseSkill {skill name} ["real"]

Description
The chooseSkill command reads the skill value for the specified skill and places the value into the
#skill system variable. The current lock status is placed in the #skillLock system variable and
the current skill cap is placed in the #skillCap system variable.
The skill name is the first four characters of the actual skill name, with the exception of animal lore
(ANIL) and stealth (STLT).

Example
chooseSkill mage
if #skill < 700
{
msg You don’t have enough magery $
halt
}
...

See Also
#skill, #skillCap, #skillLock

31
Client commands

click

Name
click — Clicks at a specific position in the UO client.

Synopsis
click {X-coordinate} {Y-coordinate} [Modifiers]

Description
The click command mimics a click of the mouse in a specific position on the screen.

Table 1. click command options

Option Description
d Double Click
dmc Don’t Move Cursor (New from 1.42 (build 7c))

f Fast Click
g Drag
mc Move Cursor (New from 1.42 (build 7c))
n Nothing (Just moves the cursor)
p Drop
r Right Click
x {count} Multiple Fast Clicks

Note: Using the drag and drop clicks is an obsolete way to move an object. event Drag
supports dragging an object by its ID instead. It is much more reliable.

Note: Using the "Don’t Move Cursor" option can make the double clicking fail randomly.

Note: From version 1.43 (build 7c) click now accepts multiple modifiers.

32
Client commands

Example
; close open crafting gump
click 150 150 r

See Also
event Drag

contPos

Name
contPos — Moves the active topmost gump to a new position.

Synopsis
contPos {X-Coordinate} {Y-Coordinate}

Description
The contPos command moves the currently active topmost gump to the coordinates specified.

Example
msg bank $
wait 20
contpos 10 10
halt

See Also
nextCPos, #contPosX, #contPosY, #nextCPosX, #nextCPosY

33
Client commands

deleteJournal

Name
deleteJournal — Forgets the contents of the journal buffer.

Synopsis
deleteJournal

Description
As of Build 0084 deleteJournal is to be considered obsolete and is only kept for backwards
compatibility.
The deleteJournal command forgets the contents of the journal from the last read line (inclusive)
and everything above so that it cannot be found using scanJournal.
Here is how the example works: Since it happens quite often that several entries get written into the
journal between two checks you should scan more than just the first line of the journal. 10 lines is a
very good value to make sure you don’t miss any new journal text. You must use deleteJournal to
mark the text you have already processed so that it does not get interpreted multiple times.
Imagine you manage to say "Hail" three times in a very short time. The example script finds the
first "Hail" on line 3, says "Farewell" and forgets line 3 and everything above (because line 3 was
the last line read by scanJournal). As the For loop proceeds it will find the other two "Hails" and
react as intended.
The very perceptive reader might be asking himself/herself why you cannot just specify the line
number as a parameter of deleteJournal. To answer that question, imagine that the journal gets
two new entries right when script execution is between scanJournal and deleteJournal. So when
the script recognizes the first "Hail" on line 3 and says the "Farewell", line 1 and 2 get moved up
by two lines (because of those two new journal entries) and are now on line 3 and 4 which would
then be ignored by "deleteJournal 3". That is why deleteJournal determines itself which line is to
be ignored.

Example
for %i 10 1
{
scanJournal %i
if hail in #journal
{

34
Client commands

msg Farewell$
deleteJournal
}
}

See Also
scanJournal, #journal, #jIndex, #jColor

findItem

Name
findItem — Finds items, monsters, players, NPCs based on object ID or object type.

Synopsis
findItem {{id} | {type} | *} [index] [[G] | [G_{dist}] | [C] | [C_{container id}]]

Description
The findItem command finds objects given by their ID (6-8 letters) or any object type (2-3 letters).
If no index is given the first object found is returned in the #FIND* variables. If an index is given,
the {index}’th object is returned in the #FIND*. If * is used instead of an id or an index, all items
of all types will be returned.

Table 1. findItem options

Argument Description
C Only objects in containers are returned.
C_{container id} Only objects in the container given by
{container id} are returned.
G Only objects on the ground are returned.
G_{dist} Only objects on the ground, and no farther than
{dist} are returned.

35
Client commands

Example
initEvents

set %regbag XXXXX ; <- replace with your own bag

; find an dagger on the ground within 2 tiles (pickup distance)


; and picks it up and drops it at a specific position
findItem TSF G_2 ;
if #findkind <> -1
{
event Drag #findID
wait 20
click 200 300 p
}

; find a stack of black perl in a specific bag and moves it


; to a specific position
findItem KUF C_ , %regbag
if #findkind <> -1
{
event Drag #findID
wait 20
click 200 300 p
}

See Also
ignoreItem, #findID, #findType, #findX, #findY, #findZ, #findDist, #findKind, #findStack,
#findBagID, #findRep, #findCol, #findCnt

getUOTitle

Name
getUOTitle — Gets the text on the title bar of the client.

Synopsis
getUOTitle

36
Client commands

Description
(Added in 1.38) The getUOTitle command retrieves the title of the UO client. The title is returned
in the system variable #strRes.

See Also
setUOTitle, #strRes

hideItem

Name
hideItem — Removes an items graphic from the client.

Synopsis
hideItem {id}

Description
The hideItem command removes a specific items graphic from the client. It can be used to
unclutter things, it does NOTHING on the server. Only items on the ground can be hidden.

Example
findItem ABC
; This will hide the item returned by they findItem command
hideItem #findId

ignoreItem

Name
ignoreItem — Removes items from the list searched by findItem.

37
Client commands

Synopsis
ignoreItem {{id} | {id-list} | {type} | {type-list} | {"reset"}} [list]

Description
The ignoreItem command removes specific items from the list of items searched by findItem. If
the option reset is given, all previously ignored items will be returned on the list.
There are different lists of ignored items. If no list number is given, it is the global list. The idea
behind this, is the ability to reset one list, while still keeping some other items ignored.
If an items id is added to any list, it will not be returned from subsequent calls to findItem. If reset
is given with a list number, only the specific list is cleared.

Note: From version 1.42 (build 77) a list of ID’s separated by underscores can now be used
with ignoreItem.

Example
; IgnoreItem.txt
;
; This script will demonstrate how ignoreItem can be used.
;
; Press start, go to a shop and follow the instructions.

msg #SMC Use a dagger and target an NPC$


wait 3s
msg #SMC (Press play to continue)
pause

set %npc1 #lTargetID

msg #SMC Use a dagger and target another NPC$


wait 3s
msg #SMC (Press play to continue)
pause

set %npc2 #lTargetID

ignoreItem %npc1 1
ignoreItem %npc2 2

; Nothing will be found

38
Client commands

findItem %npc1
msg #SMC 1: #findID $
findItem %npc2
msg #SMC 2: #findID $

ignoreItem reset 1

; NPC 1 will be found


findItem %npc1
msg #SMC 1: #findID $
findItem %npc2
msg #SMC 2: #findID $

ignoreItem %npc1 1
ignoreItem reset 2

; NPC 2 will be found


findItem %npc1
msg #SMC 1: #findID $
findItem %npc2
msg #SMC 2: #findID $
halt

See Also
findItem

key

Name
key — Sends a key-stroke to the client.

Synopsis
key {key-specifier} [[ alt ] | [ ctrl ] | [ shift ]]

39
Client commands

Description
The key command sends a keystroke of your choice to the client.
The key-specifier can either be A-Z, 0-9, F1-F12 and ESC, BACK, TAB, ENTER, PAUSE,
CAPSLOCK, SPACE, PGDN, PGUP, END, HOME, LEFT, RIGHT, UP, DOWN, PRNSCR,
INSERT, DELETE, NUMLOCK or SCROLLLOCK.

Note: If you are running more than one client, the modifier key (alt, control, shift) can
sometimes not work as its supposed to.

Example
; This will hold the ALT key down and press the F4 key.
key F4 ALT

move

Name
move — Moves the character to a specified location.

Synopsis
move {X-Coordinate} {Y-Coordinate} [tolerance] [timeout]

Description
The move command moves the character to a specified position. No pathfinding is done, so you
should probably use event PathFind instead.

Note: Please note that if you are using UOAssist, you need to make sure these keys are not
assigned to anything: Cursor Up, Cursor Down, Cursor Left, Cursor Right, Home, End, Page
Up and Page Down. EasyUO uses these keys to move your character.

40
Client commands

Example
; This will attempt to get within 2 tiles of location 1234 1234.
; If it does not get there within 3 seconds it will give up.
; The closest it will get is 2 tiles away, lower that arguement to get closer.
move 1234 1234 2 3s

See Also
event PathFind, #charPosX, #charPosY, #charPosZ

msg

Name
msg — Sends a string to the client as keystrokes.

Synopsis
msg {message}

Description
The msg command sends a series of key-strokes to the client. The ’$’ sign denotes carriage return.

Example
initEvents

; Locks Last Target Down


msg I wish to lock this down$
target 5s
event Macro 22
halt

41
Client commands

nextCPos

Name
nextCPos — Denotes where the next opened container/gump will open.

Synopsis
nextCPos {X-coordinate} {Y-coordinate}

Description
The nextCPos sets the position where the next container/gump will open at.

Note: The "Offset interface windows rather than perfectly stacking them" option, in Interface
options (Mouse Icon) must be turned on for this to work.

Example
nextCPos 10 10
wait 20
msg bank $
halt

See Also
contPos, #contPosX, #contPosY, #nextCPosX, #nextCPosY

onHotKey

Name
onHotKey — Performs a line of code if a specific key is pressed.

42
Client commands

Synopsis
onHotKey {key-specifier] [[alt] | [ctrl] | [shift]]

Description
The onHotKey command performs the following line of code (brackets does NOT work) when a
certain key is pressed.

Note: From version 1.42 (build 77) onHotKey supports brackets.

The key-specifier can either be A-Z, 0-9, F1-F12 and ESC, BACK, TAB, ENTER, PAUSE,
CAPSLOCK, SPACE, PGDN, PGUP, END, HOME, LEFT, RIGHT, UP, DOWN, PRNSCR,
INSERT, DELETE, NUMLOCK or SCROLLLOCK.

Note: The code is only executed when the parser passes it, if you want a key-press to perform
a certain action you have to make a loop. See the example.

Example
keyloop:
onHotKey F1
gosub F1
onHotKey F2
gosub F2
goto keyloop

sub F1
msg #SMC You pressed F1.$
return

sub F2
msg #SMC You pressed F2.$
return

See Also
key, gosub, goto

43
Client commands

savePix

Name
savePix — Saves the color of a pixel in a specified location.

Synopsis
savePix {X-coordinate] {Y-coordinate] [number]

Description
The savePix command saves the pixel given by the coordinates, into the memory slot given by
number. The color is also saved to #pixCol.

Example
; This will save the color on the screen where your cursor is into
; the number 1 pixel slot to be used with the cmpPix command.
savePix #cursX #cursY 1

See Also
cmpPix, #pixCol

setUOTitle

Name
setUOTitle — Sets the text on the title bar of the client.

Synopsis
setUOTitle {title}

44
Client commands

Description
The setUOTitle command changes the title bar on the client window.

Note: If you are using UOAssist, you should turn off the "Use titlebar for display" option on the
"Display" tab.

Example
; This will set the title of your UO Client window to Easy UO rox your sox!
setUOTitle Easy UO rox your sox!

See Also
getUOTitle

scanJournal

Name
scanJournal — Scans the users journal and stores the string for examination.

Synopsis
scanJournal {index}

Description
The scanJournal command scans the users journal and puts the matching string into the
#journal system variable. The system variable #jColor is updated with the line’s color.

The index specifies which line in the journal to use. 1 is the bottom line, 2 is the second to the last
line and so on. If the index is 1000 or over it is considered a #jIndex value.

45
Client commands

Example
waitForAttack:
scanjournal 1
if is_attacking_you in #journal
msg guards $
goto waitForAttack

See Also
deleteJournal, #journal, #jIndex, #jColor

sleep

Name
sleep — Waits a specified amount of time.

Synopsis
sleep {ms}

Description
The sleep command waits for a specified amount of time. Time is either given in miliseconds.

Note: For values above 50 ms you should use the command wait.

Example
...
; Wait for 5 miliseconds
sleep 5
...

46
Client commands

See Also
wait, event Sleep

target

Name
target — Waits for a target cursor to appear.

Synopsis
target {timeout}

Description
The target command waits for a target cursor to appear. If no timeout is given, the default timeout
is 2 seconds.

Example
; This will pause the script until either the target cursor is displayed,
; or 3 seconds passes.
; Set the timout just over what you expect the delay to take, otherwise
; you may miss the target cursor and cause errors in your script.
target 3s

See Also
#targCurs

47
Client commands

terminate

Name
terminate — Terminates the current client.

Synopsis
terminate [{"uo"} | {"euo"}]

Description
The terminate command terminates the current client or the current EasyUO instance. If the
current client is terminated the system variables #cliNr and #cliCnt are updated accordingly.

Table 1. terminate Options.

Value Description
uo (default) Closes the current UO client
euo Closes the current EasyUO instance.

Example
; This will cause the script containing this line to close and will NOT
; automatically save your work!
terminate euo

See Also
uoXL, #cliNr, #cliCnt

uoXL

Name
uoXL — Start/manage clients.

48
Client commands

Synopsis
uoXL {{"new"} | {"swap"}]

Description
The uoXL command starts and swaps between open clients. The system variables #cliNr and
#cliCnt are updated accordingly.

Table 1. uoXL Options.

Value Description
new Starts a new client
swap Swaps to the next client

Example

See Also
terminate, #cliNr, #cliCnt

wait

Name
wait — Waits a specified amount of time.

Synopsis
wait {time} [random time]

Description
The wait command waits for a specified amount of time. Time is either given in steps of 50
miliseconds or in seconds. The steps are given with just a number and seconds with an added s to
the number.

49
Client commands

Random time addes to the time waited, with a random time between 0 and the random time given.

Example
; Wait for 5 seconds
wait 5s

; Wait for 1 second


wait 20

; Wait for 2 seconds with a random length of 1 second


wait 2s 1s

See Also
sleep, event Sleep

50
III. Event commands
event Drag

Name
event Drag — Drags an object

Synopsis
event Drag {object id}

Description
The event Drag command drags an object given by its id.

Example
initEvents

event Drag %ore


wait 20
click 100 100 p
halt

See Also
initEvents, click

event ExMsg

Name
event ExMsg — Shows a message over the object given by the ID.

53
Event commands

Synopsis
event ExMsg {object ID} {font} {color} {message}

Description
The event ExMsg command shows a message as over the object given by the object ID. The font
and color arguments give different fonts and colors to the text.

Table 1. ExMsg fonts

Index Description
0 Big font with dark edges.
1 Small font with white drop shadow.
2 Big font with white drop shadow.
3 Small font with dark edges.
4 Big fancy font.
5 Medium font.
6 Tiny font.
7 Small font with recessed look.
8 Runic font replacing the following: Capital
A-Z, [, \, ], ^, _. Moon Phases replacing the
following: (128), (129), (130), (132), (133),
(134), (135).
9 Tiny font.

Example
initEvents

event ExMsg #charID 3 0 Welcome to my world!


halt

See Also
initEvents

54
Event commands

event Macro

Name
event Macro — Performs a UO internal macro.

Synopsis
event Macro {param 1} [param 2] [param 3]

Description
The event Macro command performs a UO macro. The second parameter will default to 0, if
ommitted.

Table 1. event Macro options

Param 1 Param 2 Param 3 Description


1 0 ^ say
2 0 ^ emote
3 0 ^ whisper
4 0 ^ yell
5 0 walk North West
5 1 walk North
5 2 walk North East
5 3 walk East
5 4 walk South East
5 5 walk South
5 6 walk South West
5 7 walk West
6 0 toggle War/Peace
7 0 paste
8 0 open Configuration
8 1 open Paperdoll
8 2 open Status
8 3 open Journal

55
Event commands

Param 1 Param 2 Param 3 Description


8 4 open Skills
8 5 open Spellbook
8 6 open Chat
8 7 open Backpack
8 8 open Overview
8 9 open Mail
8 10 open Party Manifest
8 11 open Party Chat
8 12 open Necro Spellbook
8 13 open Paladin
Spellbook
8 14 open Combat Book
9 0 close Configuration
9 1 close Paperdoll
9 2 close Status
9 3 close Journal
9 4 close Skills
9 5 close Spellbook
9 6 close Chat
9 7 close Backpack
9 8 close Overview
9 9 close Mail
9 10 close Party Manifest
9 11 close Party Chat
9 12 close Necro Spellbook

9 13 close Paladin
Spellbook
9 14 close Combat Book
10 0 minimize
Configuration
10 1 minimize Paperdoll
10 2 minimize Status
10 3 minimize Journal

56
Event commands

Param 1 Param 2 Param 3 Description


10 4 minimize Skills
10 5 minimize Spellbook
10 6 minimize Chat
10 7 minimize Backpack
10 8 minimize Overview
10 9 minimize Mail
10 10 minimize Party
Manifest
10 11 minimize Party Chat
10 12 minimize Necro
Spellbook
10 13 minimize Paladin
Spellbook
10 14 minimize Combat
Book
11 0 maximize
Configuration
11 1 maximize Paperdoll
11 2 maximize Status
11 3 maximize Journal
11 4 maximize Skills
11 5 maximize Spellbook
11 6 maximize Chat
11 7 maximize Backpack
11 8 maximize Overview
11 9 maximize Mail
11 10 maximize Party
Manifest
11 11 maximize Party Chat
11 12 maximize Necro
Spellbook
11 13 maximize Paladin
Spellbook
11 14 maximize Combat
Book

57
Event commands

Param 1 Param 2 Param 3 Description


12 0 opendoor
13 1 use skill Anatomy
13 2 use skill Animal Lore
13 35 use skill Animal
Taming
13 4 use skill Arms Lore
13 6 use skill Begging
13 12 use skill Cartography
13 14 use skill Detecting
Hidden
13 15 use skill Discordance
13 16 use skill Evaluating
Intelligence
13 19 use skill Forensic
Evaluation
13 21 use skill Hiding
13 23 use skill Inscription
13 3 use skill Item
Identification
13 46 use skill Meditation
13 9 use skill Peacemaking
13 30 use skill Poisoning
13 22 use skill Provocation
13 48 use skill Remove Trap
13 32 use skill Spirit Speak
13 33 use skill Stealing
13 47 use skill Stealth
13 36 use skill Taste
Identification
13 38 use skill Tracking
14 0 last skill
15 0 cast spell Clumsy
15 1 cast spell Create Food
15 2 cast spell Feeblemind

58
Event commands

Param 1 Param 2 Param 3 Description


15 3 cast spell Heal
15 4 cast spell Magic
Arrow
15 5 cast spell Night Sight
15 6 cast spell Reactive
Armor
15 7 cast spell Weaken
15 8 cast spell Agility
15 9 cast spell Cunning
15 10 cast spell Cure
15 11 cast spell Harm
15 12 cast spell Magic Trap
15 13 cast spell Magic
Untrap
15 14 cast spell Protection
15 15 cast spell Strength
15 16 cast spell Bless
15 17 cast spell Fireball
15 18 cast spell Magic Lock
15 19 cast spell Poison
15 20 cast spell Telekinesis
15 21 cast spell Teleport
15 22 cast spell Unlock
15 23 cast spell Wall Of
Stone
15 24 cast spell Arch Cure
15 25 cast spell Arch
Protection
15 26 cast spell Curse
15 27 cast spell Fire Field
15 28 cast spell Greater Heal

15 29 cast spell Lightning


15 30 cast spell Mana Drain

59
Event commands

Param 1 Param 2 Param 3 Description


15 31 cast spell Recall
15 32 cast spell Blade Spirits

15 33 cast spell Dispel Field


15 34 cast spell Incognito
15 35 cast spell Magic
Reflection
15 36 cast spell Mind Blast
15 37 cast spell Paralyze
15 38 cast spell Poison Field
15 39 cast spell Summon
Creature
15 40 cast spell Dispel
15 41 cast spell Energy Bolt
15 42 cast spell Explosion
15 43 cast spell Invisibility
15 44 cast spell Mark
15 45 cast spell Mass Curse
15 46 cast spell Paralyze
Field
15 47 cast spell Reveal
15 48 cast spell Chain
Lightning
15 49 cast spell Energy Field

15 50 cast spell Flame Strike

15 51 cast spell Gate Travel


15 52 cast spell Mana
Vampire
15 53 cast spell Mass Dispel
15 54 cast spell Meteor
Swarm
15 55 cast spell Polymorph
15 56 cast spell Earthquake

60
Event commands

Param 1 Param 2 Param 3 Description


15 57 cast spell Energy
Vortex
15 58 cast spell Resurrection

15 59 cast spell Air


Elemental
15 60 cast spell Summon
Daemon
15 61 cast spell Earth
Elemental
15 62 cast spell Fire
Elemental
15 63 cast spell Water
Elemental
15 101 cast spell [N] Animate
Dead
15 102 cast spell [N] Blood
Oath
15 103 cast spell [N] Corpse
Skin
15 104 cast spell [N] Curse
Weapon
15 105 cast spell [N] Evil
Omen
15 106 cast spell [N] Horrific
Beast
15 107 cast spell [N] Lich
Form
15 108 cast spell [N] Mind
Rot
15 109 cast spell [N] Pain
Spike
15 110 cast spell [N] Poison
Strike
15 111 cast spell [N] Strangle

61
Event commands

Param 1 Param 2 Param 3 Description


15 112 cast spell [N] Summon
Familiar
15 113 cast spell [N]
Vampiric Embrace
15 114 cast spell [N] Vengeful
Spirit
15 115 cast spell [N] Wither
15 116 cast spell [N] Wraith
Form
15 201 cast spell [C] Cleanse
by Fire
15 202 cast spell [C] Close
Wounds
15 203 cast spell [C]
Consecrate Weapon
15 204 cast spell [C] Dispel
Evil
15 205 cast spell [C] Divine
Fury
15 206 cast spell [C] Enemy
of One
15 207 cast spell [C] Holy
Light
15 208 cast spell [C] Noble
Sacrifice
15 209 cast spell [C] Remove
Curse
15 210 cast spell [C] Sacred
Journey
16 0 last spell
17 0 last object
18 0 bow
19 0 salute
20 0 quit game
21 0 all names
22 0 last target

62
Event commands

Param 1 Param 2 Param 3 Description


23 0 target self
24 1 arm/disarm Left
24 2 arm/disarm Right
25 0 wait for target
26 0 target next
27 0 attack last
28 0 ^ delay
29 0 circletrans
31 0 close gumps
32 0 always run
33 0 save desktop
34 0 kill gump open
35 0 primary ability
36 0 secondary ability
37 0 ^ set update range
38 0 ^ modify update range
39 0 increase update range
40 0 decrease update range
41 0 maximum update
range
42 0 minimum update
range
43 0 default update range
44 0 update update range
45 0 enable update range
color
46 0 disable update range
color
47 0 toggle update range
color
49 1 invoke honor virtue
49 2 invoke sacrifice virtue
49 3 invoke valor virtue

63
Event commands

Example
initEvents

set #lTargetX 1000


set #lTargetY 1000
set #lTargetKind 3

; uses a shovel and targets ground at 1000, 1000


set #lObjectID %shovel
event Macro 17
target 5s
event macro 22
halt

See Also
initEvents,

event PathFind

Name
event PathFind — Moves you to a specified position if it is possible.

Synopsis
event PathFind {X-Coordinate} {Y-Coordinate} [Z-Coordinate]

Description
The event PathFind moves you to the position given by the coordinates. If the Z coordinate os
omitted, it is assumed to be -1.

Note: Please note that your script will keep on executing while the character is moving. Take a
look at the example below which mimics the way that the move command works.

64
Event commands

Note: The event PathFind command only works within one screen. If you need to move longer
you need to break up the path in to several calls.

Example
;===========================================================
; Name: pathFind
; Author: ScriptFellow (the.WZA)
; Parameters: %1 = X
; %2 = Y
; %3 = Z
; %4 = tolerance
; %5 = timeout (in seconds)
; Purpose: Pathfind to the given coordinates
; Return: %return (#true or #false )
;-----------------------------------------------------------
sub pathFind
set %_x %1
set %_y %2
if %0 <= 2 || %2 = N/A
set %_z -1
else
set %_z %3
if %0 <= 3 || %3 = N/A
set %_tolerance 0
else
set %_tolerance %4
if %0 <= 4
set %_endTime #sCnt + 15
else
set %_endTime #sCnt + %5
set %return #false
deleteJournal
scanJournal 2
event PathFind %_x %_y %_z
_pathFindScanAgain:
scanJournal 1
if pathfinding in #journal
goto _pathFindOkay
if can’t_get_there in #journal || #sCnt > %_endTime
return
goto _pathFindScanAgain
_pathFindOkay:
gosub _pathFindDist %_x %_y %_z #charPosX #charPosY #charPosZ

65
Event commands

set %return %return <= %_tolerance


if %return
{
if %_tolerance > 0
{
set %1 #cliLeft + #cliXRes / 2
set %2 #cliTop + #cliYRes / 2
if #charDir < 3
set %1 %1 + 1
else
{
if #charDir > 3 && #charDir < 7
set %1 %1 - 1
}
if #charDir = 0 || #charDir = 6
set %2 %2 - 1
else
{
if #charDir > 1 && #charDir < 5
set %2 %2 + 1
}
click %1 %2 R
}
return
}
if #sCnt > %_endTime
return
goto _pathFindOkay

sub _pathFindDist
set %1 %1 - %4 abs
set %2 %2 - %5 abs
set %3 %3 - %6 abs
gosub max %1 %2 %3
return

; to be defined
sub max
set %return %1
for %_idx 2 %0
{
if % . %_idx > %return
set %return % . %_idx
}
return

66
Event commands

See Also
initEvents, move

event Property

Name
event Property — Reads the property description of an item.

Synopsis
event Property {ID}

Description
(Added in 1.39) The event Property command reads the description and properies of an item and
places the information in the system variable #property. Each line in the #property variable is
seperated by ’$’.

Example
; This will use the item returned by the findItem command and save
; the information displayed in game by the property pop-up widow
; into the #property variable.
findItem ABC
event Property #findID

See Also
#property

67
Event commands

event SkillLock

Name
event SkillLock — Changes the skill locks on the different skills.

Synopsis
event SkillLock {skill name} {up | down | locked}

Description
The event SkillLock command changes the skill lock on the specified skill to either: up, down or
locked.

Example
initEvents
; changes magery to down
event SkillLock mage down
; locks armlore
event SkillLock armslore locked

See Also
initEvents, chooseSkill, #skillLock

event Sleep

Name
event Sleep — Suspends the client for a specified time.

68
Event commands

Synopsis
event Sleep {ms}

Description
The event Sleep command suspends the client for a specified number of miliseconds. The client
will be completely unresponsive, but will use 0% CPU time.

Example
initEvents

if %waitForVendorRespawn = #true
{
; sleep for one minute
event Sleep 60000
}
...

See Also
sleep, wait

event SysMessage

Name
event SysMessage — Outputs text to the client as a system message.

Synopsis
event SysMessage {message}

69
Event commands

Description
The event SysMessage command outputs a message as a system message inside the client.

Note: This command does NOT work unless you have enabled the "Enable Event
Sysmessage" configuration option.

Example
initEvents

event SysMessage Welcome to EasyUO!


halt

See Also
initEvents, event ExMsg

initEvents

Name
initEvents — Initializes all event commands.

Synopsis
initEvents

Description
The initEvents command initializes all event commands. If it is not run once per script, none of
the event commands will function. You should only call initEvents once per script.

70
Event commands

See Also
event Drag, event Macro, event PathFind, event SkillLock, event SysMessage

71
Event commands

72
IV. Shop Commands
getShopInfo

Name
getShopInfo — Retrieves information from the client about the currently shown top entry on a
shopping gump.

Synopsis
getShopInfo

Description
The getShopInfo command retrives information about the currently shown top entry on an open
gump. When it is called it fills all the #shop* system variables with their appropriate infomration.

Note: Every time you scroll to a new entry, you have to call getShopInfo to update the #shop*
system variables.

See Also
setShopItem, #shopCurPos, #shopCnt, #shopItemType, #shopItemID, #shopItemName,
#shopItemPrice, #shopItemMax

setShopItem

Name
setShopItem — Sets the number of items to purchase given by ID.

Synopsis
setShopItem {ID} {amount}

75
Shop Commands

Description
The setShopItem command sets the amount to purchase given by an items ID. The ID is usually
gotten from the system variable #shopItemID.

Note: The setShopItem command does NOT update the graphics in UO. The amount is still set
though.

Example
; This will set the amount to buy of the top item to the total number that
; is available to be bought.
getShopInfo
setShopItem #shopItemID #shopItemMax

See Also
getShopInfo, #shopCurPos, #shopCnt, #shopItemType, #shopItemID, #shopItemName,
#shopItemPrice, #shopItemMax

76
V. Menu Commands
menu Activate

Name
menu Activate — Activates a window element in the EasyUO menu window.

Synopsis
menu Activate {name}

Description
The menu Activate command activates the window element given by its name, in the EasyUO
menu window.

Example
; This will will choose the menu element called EditBox. This is
; useful if you want your script to type something into an edit
; box as the script runs.
menu Activate EditBox

See Also
menu Button, menu Check, menu Clear, menu Combo menu Delete, menu Edit, menu Font Align,
menu Font BGColor, menu Font Color, menu Font Name, menu Font Size, menu Font Style, menu
Font Transparent, menu Get, menu GetNum, menu Hide, menu HideEUO, menu List, menu Set,
menu Shape, menu Show, menu Text, menu Window Color, menu Window Size, menu Window
Title, #menuRes

menu Button

Name
menu Button — Creates a button at position x/y with specified size on the EasyUO menu
window.

79
Menu Commands

Synopsis
menu Button {name} {x} {y} {width} {height} {text}

Description
The menu Button command creates a button on the EasyUO menu window at the specified
postion with the specified size.

Example
; This will create a button named button_1 in position 10 20
; with a width of 50 and hight of 25. The text on the button
; will say Click me!
; Note that when refering to this button later in the script
; you will reference the NAME and not the displayed TEXT.
menu Button button_1 10 20 50 25 Click me!

See Also
menu Activate, menu Check, menu Clear, menu Combo, menu Delete, menu Edit, menu Font
Align, menu Font BGColor, menu Font Color, menu Font Name, menu Font Size, menu Font
Style, menu Font Transparent, menu Get, menu GetNum, menu Hide, menu HideEUO, menu List,
menu Set, menu Shape, menu Show, menu Text, menu Window Color, menu Window Size, menu
Window Title, #menuRes, #menuButton

menu Check

Name
menu Check — Creates a checkbox at position x/y with specified size on the EasyUO menu
window.

Synopsis
menu Check { name } { x } { y } { width } { height } { checked } { text }

80
Menu Commands

Description
(Added in 1.42 (build 78)) The menu Check creates a checkbox on the EasyUO menu.

See Also
menu Activate, menu Button, menu Clear, menu Combo, menu Delete, menu Edit, menu Font
Align, menu Font BGColor, menu Font Color, menu Font Name, menu Font Size, menu Font
Style, menu Font Transparent, menu Get, menu GetNum, menu Hide, menu Shape, menu Show,
menu Text, menu Window Color, menu Window Size, menu Window Title

menu Clear

Name
menu Clear — Clears all window elements from the EasyUO menu window.

Synopsis
menu Clear

Description
The menu Clear command clears all window elements (i.e. text, button, edit) from the EasyUO
menu window.

Note: Stopping your EasyUO script will not clear the current menu, so you might want to put
menu Clear at the top of your script to preserve memory.

See Also
menu Activate, menu Button, menu Check, menu Combo, menu Delete, menu Edit, menu Font
Align, menu Font BGColor, menu Font Color, menu Font Name, menu Font Size, menu Font
Style, menu Font Transparent, menu Get, menu GetNum, menu Hide, menu HideEUO, menu List,
menu Set, menu Shape, menu Show, menu Text, menu Window Color, menu Window Size, menu
Window Title

81
Menu Commands

menu Combo

Name
menu Combo — Creates a combobox at position x/y with specified size on the EasyUO menu
window or adds entires to the combobox.

Synopsis
menu Combo ( {"Create"} {name} {x} {y} {width} ) | ( "Add" {name} {text} | {"SELECT"}
{name} {index} )

Description
(Added in 1.41) The menu Combo command creates a combobox at position x/y with specified
size on the EasyUO menu window or adds entires to the combobox. Select defines what entry is
currently showing, similar to menu Set.

See Also
menu Activate, menu Button, menu Check, menu Clear, menu Delete, menu Edit, menu Font
Align, menu Font BGColor, menu Font Color, menu Font Name, menu Font Size, menu Font
Style, menu Font Transparent, menu Get, menu GetNum, menu Hide, menu HideEUO, menu List,
menu Set, menu Shape, menu Show, menu Text, menu Window Color, menu Window Size, menu
Window Title

menu Delete

Name
menu Delete — Deletes a window element from the EasyUO menu window.

82
Menu Commands

Synopsis
menu Delete {name}

Description
The menu Delete command deletes a window element (i.e. text, button, edit) from the EasyUO
window menu.

Example
; This will remove the menu item named button_1 from the current menu
; and from memory. Please use this command and do not just create
; new items over old ones. This is expecially important when using
; menu Text items, as they sometimes need to be updated regularly.
menu Delete button_1

See Also
menu Activate, menu Button, menu Check, menu Clear, menu Combo, menu Edit, menu Font
Align, menu Font BGColor, menu Font Color, menu Font Name, menu Font Size, menu Font
Style, menu Font Transparent, menu Get, menu GetNum, menu Hide, menu HideEUO, menu List,
menu Set, menu Shape, menu Show, menu Text, menu Window Color, menu Window Size, menu
Window Title

menu Edit

Name
menu Edit — Creates a edit field at position x/y with specified width in the EasyUO menu
window.

Synopsis
menu Edit {name} {x} {y} {width} {text}

83
Menu Commands

Description
The menu Edit command creates an edit field at the specified postion and with the specified
dimensions in the EasyUO window menu.

Example
; This will create an editable field named edit_1 in position 10 20
; with a width of 50 and hight of 25. The text in the field
; will say Change me!
; Note that when refering to this field later in the script
; you will reference the NAME and not the displayed TEXT.
menu Edit edit_1 10 20 150 Change , #spc , me!

See Also
menu Activate, menu Button, menu Check, menu Clear, menu Combo, menu Delete, menu Font
Align, menu Font BGColor, menu Font Color, menu Font Name, menu Font Size, menu Font
Style, menu Font Transparent, menu Get, menu GetNum, menu Hide, menu HideEUO, menu List,
menu Set, menu Shape, menu Show, menu Text, menu Window Color, menu Window Size, menu
Window Title, #menuButton

menu Font Align

Name
menu Font Align — Changes the font alignment in the EasyUO menu window.

Synopsis
menu Font Align {{left} | {center} | {right}}

Description
The menu Font Align command sets the alignment of the font used in the EasyUO menu window.

84
Menu Commands

See Also
menu Activate, menu Button, menu Check, menu Clear, menu Combo, menu Delete, menu Edit,
menu Font BGColor, menu Font Color, menu Font Name, menu Font Size, menu Font Style, menu
Font Transparent, menu Get, menu GetNum, menu Hide, menu HideEUO, menu List, menu Set,
menu Shape, menu Show, menu Text, menu Window Color, menu Window Size, menu Window
Title

menu Font BGColor

Name
menu Font BGColor — Changes the font background color in the EasyUO menu window.

Synopsis
menu Font BGColor {color-descriptor}

Description
The menu Font BGColor command changes the background color of the font used in the EasyUO
menu window.
color-descriptor can be a few different things: black, red, btnface or a hexadecial (i.e. $aabbcc).

See Also
menu Activate, menu Button, menu Check, menu Clear, menu Combo, menu Delete, menu Edit,
menu Font Align, menu Font Color, menu Font Name, menu Font Size, menu Font Style, menu
Font Transparent, menu Get, menu GetNum, menu Hide, menu HideEUO, menu List, menu Set,
menu Shape, menu Show, menu Text, menu Window Color, menu Window Size, menu Window
Title

85
Menu Commands

menu Font Color

Name
menu Font Color — Changes the font color in the EasyUO menu window.

Synopsis
menu Font Color {color-descriptor}

Description
The menu Font Color command changes the color of the font used in the EasyUO menu window.
color-descriptor can be a few different things: black, red, btnface or a hexadecial (i.e. $aabbcc).

See Also
menu Activate, menu Button, menu Check, menu Clear, menu Combo, menu Delete, menu Edit,
menu Font Align, menu Font BGColor, menu Font Name, menu Font Size, menu Font Style, menu
Font Transparent, menu Get, menu GetNum, menu Hide, menu HideEUO, menu List, menu Set,
menu Shape, menu Show, menu Text, menu Window Color, menu Window Size, menu Window
Title

menu Font Name

Name
menu Font Name — Changes the font in the EasyUO menu window.

Synopsis
menu Font Name {font-descriptor}

86
Menu Commands

Description
The menu Font Name command changes the font used in the EasyUO menu window.

See Also
menu Activate, menu Button, menu Check, menu Clear, menu Combo, menu Delete, menu Edit,
menu Font Align, menu Font BGColor, menu Font Color, menu Font Size, menu Font Style, menu
Font Transparent, menu Get, menu GetNum, menu Hide, menu HideEUO, menu List, menu Set,
menu Shape, menu Show, menu Text, menu Window Color, menu Window Size, menu Window
Title

menu Font Size

Name
menu Font Size — Changes the font size in the EasyUO menu window.

Synopsis
menu Font Size {point-size}

Description
The menu Font Size command changes the font size used in the EasyUO menu window.

See Also
menu Activate, menu Button, menu Check, menu Clear, menu Combo, menu Delete, menu Edit,
menu Font Align, menu Font BGColor, menu Font Color, menu Font Name, menu Font Style,
menu Font Transparent, menu Get, menu GetNum, menu Hide, menu HideEUO, menu List, menu
Set, menu Shape, menu Show, menu Text, menu Window Color, menu Window Size, menu
Window Title

87
Menu Commands

menu Font Style

Name
menu Font Style — Changes the font style in the EasyUO menu window.

Synopsis
menu Font Style { "b" } | { "i" } | { "u" } | { "s" }

Description
The menu Font Style command changes the font style used in the EasyUO menu window.

Table 1. menu Font Style Values.

Value Description
b Bold
i Italics
u Underline
s Strikeout

See Also
menu Activate, menu Button, menu Check, menu Clear, menu Combo, menu Delete, menu Edit,
menu Font Align, menu Font BGColor, menu Font Color, menu Font Name, menu Font Size,
menu Font Transparent, menu Get, menu GetNum, menu Hide, menu HideEUO, menu List, menu
Set, menu Shape, menu Show, menu Text, menu Window Color, menu Window Size, menu
Window Title

menu Font Transparent

Name
menu Font Transparent — Sets the transparency of the background color of the font.

88
Menu Commands

Synopsis
menu Font Transparent {#true|#false}

Description
(Added in 1.41) The menu Font Transparent command sets the transparency of the background
color of the font.

Note: Note that transparency for fonts only works for labels.

See Also
menu Activate, menu Button, menu Check, menu Clear, menu Combo, menu Delete, menu Edit,
menu Font Align, menu Font BGColor, menu Font Color, menu Font Name, menu Font Size,
menu Font Style, menu Font Transparent, menu Get, menu GetNum, menu Hide, menu HideEUO,
menu List, menu Set, menu Shape, menu Show, menu Text, menu Window Color, menu Window
Size, menu Window Title

menu Get

Name
menu Get — Returns the value associated with a control in the EasyUO menu window.

Synopsis
menu Get {name}

Description
The menu Get command returns value associated with a control in the EasyUO menu window in
the #menuRes system variable. If the window is closed "Closed" is returned.

89
Menu Commands

Example
; This will save the text in the edit field named edit_1 into the
; variable #menuRes. This will only work for edit field items.
; #menuRes will return as a string.
menu Get edit_1

See Also
menu Activate, menu Button, menu Check, menu Clear, menu Combo, menu Delete, menu Edit,
menu Font Align, menu Font BGColor, menu Font Color, menu Font Name, menu Font Size,
menu Font Style, menu Font Transparent, menu GetNum, menu Hide, menu HideEUO, menu List,
menu Set, menu Shape, menu Show, menu Text, menu Window Color, menu Window Size, menu
Window Title, #menuRes

menu GetNum

Name
menu GetNum — Returns the number in an edit field in the EasyUO menu window.

Synopsis
menu GetNum {name} {default}

Description
The menu GetNum command returns the number in an edit field in the EasyUO menu window in
the #menuRes system variable. If the edit field does not hold a number, the default value is
returned.

Example
; This will save the text in the edit field named edit_1 into the
; variable #menuRes. If the field is blank it will save 144 into
; the variable #menuRes. This will only work for edit field items.
; #menuRes will return as a number.
menu GetNum edit_1 144

90
Menu Commands

See Also
menu Activate, menu Button, menu Check, menu Clear, menu Combo, menu Delete, menu Edit,
menu Font Align, menu Font BGColor, menu Font Color, menu Font Name, menu Font Size,
menu Font Style, menu Font Transparent, menu Get, menu Hide, menu HideEUO, menu List,
menu Set, menu Shape, menu Show, menu Text, menu Window Color, menu Window Size, menu
Window Title, #menuRes

menu Hide

Name
menu Hide — Hides the EasyUO menu window.

Synopsis
menu Hide

Description
The menu Hide command hides the EasyUO menu window.

Note: Calling menu Show is the only way to make the menu visible again

See Also
menu Activate, menu Button, menu Check, menu Clear, menu Combo, menu Delete, menu Edit,
menu Font Align, menu Font BGColor, menu Font Color, menu Font Name, menu Font Size,
menu Font Style, menu Font Transparent, menu Get, menu GetNum, menu HideEUO, menu List,
menu Set, menu Shape, menu Show, menu Text, menu Window Color, menu Window Size, menu
Window Title

91
Menu Commands

menu HideEUO

Name
menu HideEUO — Hides the main EasyUO window.

Synopsis
menu HideEUO

Description
The menu HideEUO command hides the main EasyUO window.

Note: The only way to make the EasyUO window visible again is to close the current menu and
restore the EasyUO window.

See Also
menu Activate, menu Button, menu Check, menu Clear, menu Combo, menu Delete, menu Edit,
menu Font Align, menu Font BGColor, menu Font Color, menu Font Name, menu Font Size,
menu Font Style, menu Font Transparent, menu Get, menu GetNum, menu Hide, menu List, menu
Set, menu Shape, menu Show, menu Text, menu Window Color, menu Window Size, menu
Window Title

menu List

Name
menu List — Creates a listbox at position x/y with specified size on the EasyUO menu window
or adds entires to the listbox.

Synopsis
menu List { "Create" { name } { x } { y } { width } { height } | "Add" { name } { string } }

92
Menu Commands

Description
(Added in 1.42 (build 78)) The menu List creates a listbox at position x/y with specified size on
the EasyUO menu window or adds entires to the listbox.

See Also
menu Activate, menu Button, menu Check, menu Clear, menu Combo, menu Delete, menu Edit,
menu Font Align, menu Font BGColor, menu Font Color, menu Font Name, menu Font Size,
menu Font Style, menu Font Transparent, menu Get, menu GetNum, menu Hide, menu Set, menu
Shape, menu Show, menu Text, menu Window Color, menu Window Size, menu Window Title

menu Set

Name
menu Set — Sets the text of a control.

Synopsis
menu Set { name } { text }

Description
(Added in 1.42 (build 78)) The menu Set command sets the text of a control.

See Also
menu Activate, menu Button, menu Check, menu Clear, menu Combo, menu Delete, menu Edit,
menu Font Align, menu Font BGColor, menu Font Color, menu Font Name, menu Font Size, menu
Font Style, menu Font Transparent, menu Get, menu GetNum, menu Hide, menu HideEUO, menu
List, menu Shape, menu Text, menu Window Color, menu Window Size, menu Window Title

93
Menu Commands

menu Shape

Name
menu Shape — Creates a shape in the EasyUO menu window.

Synopsis
menu Shape {name} {left} {top} {width} {height} {shapetype} {linetype} {linewidth}
{linecolor} {filltype} {fillcolor}

Description
(Added in 1.41) The menu Shape command creates a shape in the EasyUO menu window.

Table 1. menu Shape shapetype

Value Description
1 Circle
2 Ellipse
3 Rectangle
4 Round Rectangle
5 Round Square
6 Square

Table 2. menu Shape linetype

Value Description
1 Clear
2 Dash
3 Dash Dot
4 Dash Dot Dot
5 Dot
6 Inside Frame
7 Solid

Table 3. menu Shape filltype

94
Menu Commands

Value Description
1 BDiagonal
2 Clear
3 Cross
4 Diagonal Cross
5 FDiagonal
6 Horizontal
7 Solid
8 Vertical

See Also
menu Activate, menu Button, menu Check, menu Clear, menu Combo, menu Delete, menu Edit,
menu Font Align, menu Font BGColor, menu Font Color, menu Font Name, menu Font Size,
menu Font Style, menu Font Transparent, menu Get, menu GetNum, menu Hide, menu HideEUO,
menu List, menu Set, menu Set, menu Show, menu Text, menu Window Color, menu Window
Size, menu Window Title

menu Show

Name
menu Show — Shows the EasyUO menu window.

Synopsis
menu Show {x} {y}

Description
The menu Show command shows the main EasyUO window at the specified position.

Note: Calling menu Show is the only way to make a menu, hidden by calling menu Hide
visible again.

95
Menu Commands

See Also
menu Activate, menu Button, menu Check, menu Clear, menu Combo, menu Delete, menu Edit,
menu Font Align, menu Font BGColor, menu Font Color, menu Font Name, menu Font Size,
menu Font Style, menu Font Transparent, menu Get, menu GetNum, menu Hide, menu HideEUO,
menu List, menu Set, menu Shape, menu Text, menu Window Color, menu Window Size, menu
Window Title

menu Text

Name
menu Text — Creates a label at the specifed postion in the EasyUO menu window.

Synopsis
menu Text {name} {x} {y} {text}

Description
The menu Text command creates a label at the specified position in the EasyUO menu window.

Example
; This will create a text line named text_1 at position 10 20
; with the words Read me!
; Note that when refering to this field later in the script
; you will reference the NAME and not the displayed TEXT.
menu Text text_1 10 20 Read me!

See Also
menu Activate, menu Button, menu Check, menu Clear, menu Combo, menu Delete, menu Edit,
menu Font Align, menu Font BGColor, menu Font Color, menu Font Name, menu Font Size,
menu Font Style, menu Font Transparent, menu Get, menu GetNum, menu Hide, menu HideEUO,
menu List, menu Set, menu Shape, menu Show, menu Window Color, menu Window Size, menu
Window Title

96
Menu Commands

menu Window Color

Name
menu Window Color — Changes the color of the EasyUO menu window.

Synopsis
menu Window Color {color-descriptor}

Description
The menu Window Color command changes the color of the EasyUO menu window.
color-descriptor can be a few different things: black, red, btnface or a hexadecial (i.e. $aabbcc).

See Also
menu Activate, menu Button, menu Check, menu Clear, menu Combo, menu Delete, menu Edit,
menu Font Align, menu Font BGColor, menu Font Color, menu Font Name, menu Font Size, menu
Font Style, menu Font Transparent, menu Get, menu GetNum, menu Hide, menu HideEUO, menu
List, menu Set, menu Shape, menu Show, menu Text, menu Window Size, menu Window Title

menu Window Size

Name
menu Window Size — Changes the size of the EasyUO menu window.

Synopsis
menu Window Size {width} {height}

97
Menu Commands

Description
The menu Window Size command changes the size of the EasyUO menu window.

See Also
menu Activate, menu Button, menu Check, menu Clear, menu Combo, menu Delete, menu Edit,
menu Font Align, menu Font BGColor, menu Font Color, menu Font Name, menu Font Size, menu
Font Style, menu Font Transparent, menu Get, menu GetNum, menu Hide, menu HideEUO, menu
List, menu Set, menu Shape, menu Show, menu Text, menu Window Color, menu Window Title

menu Window Title

Name
menu Window Title — Changes the title of the EasyUO menu window.

Synopsis
menu Window Title {title}

Description
The menu Window Title command changes the window title of the EasyUO menu window.

See Also
menu Activate, menu Button, menu Check, menu Clear, menu Combo, menu Delete, menu Edit,
menu Font Align, menu Font BGColor, menu Font Color, menu Font Name, menu Font Size, menu
Font Style, menu Font Transparent, menu Get, menu GetNum, menu Hide, menu HideEUO, menu
List, menu Set, menu Shape, menu Show, menu Text, menu Window Color, menu Window Size

98
VI. Namespace commands
nameSpace {local | global}

Name
nameSpace {local | global} — Defines the current namespace and its scope.

Synopsis
nameSpace {local | global} {namespace name}

Description
(Added in 1.39) The nameSpace {local | global} commands defines the current namespace name
and scope. The {namespace name} must be a valid EasyUO name. The scope is either Local or
Global. A Local namespace can only be accessed by the script that defined it. A Global namespace
can be accessed by any script running witihn the same EasyUO instance.

Note: Note: currently only Local scope is available. Global scope is to be introduced in a future
version of EasyUO.

The default namespace is local and named STD. This setting is restored when then script is
stopped.

Example
namespace local ns1
set !test test1

namespace local ns2


set !test test2

namespace local ns3


set !test test3

namespace local ns1


display ok !test

namespace local ns2


display ok !test

namespace clear ns2

101
Namespace commands

namespace local ns2


display ok !test

namespace local ns3


display ok !test

halt

See Also
nameSpace clear, nameSpace {push | pop}, nameSpace copy, #nsType, #nsName, the Section
called Namespace Variables and Scope in Chapter 2

nameSpace clear

Name
nameSpace clear — Clears every variables within the current namespace.

Synopsis
nameSpace clear

Description
(Added in 1.39) The nameSpace command clears every variables within the current namespace.

Note: Note: currently only Local scope is available. Global scope is to be introduced in a future
version of EasyUO.

The default namespace is local and named STD. This setting is restored when then script is
stopped.

Example
set !return ; make sure !return is empty
gosub test
display ok !return

102
Namespace commands

halt

sub test
nameSpace Push ; saves current namespace
nameSpace Local Test ; create a new temporary namespace to work with
set !return this_is_a_test
nameSpace Pop ; restore previous namespace
nameSpace Copy ret* From Local Test ; copy variables to the original namespace
nameSpace Push ; saves current namespace
nameSpace Local Test
nameSpace Clear ; free memory used by temporary namespace
nameSpace Pop ; restore previous namespace
return

See Also
nameSpace {local | global}, nameSpace {push | pop}, nameSpace copy, #nsType, #nsName, the
Section called Namespace Variables and Scope in Chapter 2

nameSpace {push | pop}

Name
nameSpace {push | pop} — Store and restore the current namespace name and scope.

Synopsis
nameSpace {push | pop}

Description
(Added in 1.40) The nameSpace {push | pop} commands respectively store and restore the current
namespace name and scope in and from an internal stack.

Note: Note: currently only Local scope is available. Global scope is to be introduced in a future
version of EasyUO.

103
Namespace commands

The default namespace is local and named STD. This setting is restored when then script is
stopped.

Example
set !return ; make sure !return is empty
gosub test
display ok !return
halt

sub test
nameSpace Push ; saves current namespace
nameSpace Local Test ; create a new temporary namespace to work with
set !return this_is_a_test
nameSpace Pop ; restore previous namespace
nameSpace Copy ret* From Local Test ; copy variables to the original namespace
nameSpace Push ; saves current namespace
nameSpace Local Test
nameSpace Clear ; free memory used by temporary namespace
nameSpace Pop ; restore previous namespace
return

See Also
nameSpace {local | global}, nameSpace clear, nameSpace copy, #nsType, #nsName, the Section
called Namespace Variables and Scope in Chapter 2

nameSpace copy

Name
nameSpace copy — Copy variables from one namespace to another.

Synopsis
nameSpace copy {filter} {from | to} {local | global} {namespace name}

104
Namespace commands

Description
(Added in 1.40) The nameSpace copy command allows to copy all or part of variables within a
namespace into another. The {filter} parameter is use to specify which variables should be copied
and accepts two special characters "?" and "*".
The "?" character matches any single character and can be use multiple times within one {filter}
expression. I.e. "return?" will match any variable whose name start with "return" and has one
additional character.
The "*" character matches zero or more unspecified character. It can only appear but once within a
{filter} expression. I.e. "return*" will match any variable whose name start with "return".
The {from | to} parameter defines the direction for the copy, while the {local | global} {namespace
name} parameters define the name and scope of the namespace.to be used.
From: copies variables from the specified namespace into the current namespace.
To: copies variables from the current namespace into the specified namespace. If the specified
namespace doesn’t exist at this time, it will be created.

Note: Note: currently only Local scope is available. Global scope is to be introduced in a future
version of EasyUO.

The default namespace is local and named STD. This setting is restored when then script is
stopped.

Example
set !return ; make sure !return is empty
gosub test
display ok !return
halt

sub test
nameSpace Push ; saves current namespace
nameSpace Local Test ; create a new temporary namespace to work with
set !return this_is_a_test
nameSpace Pop ; restore previous namespace
nameSpace Copy ret* From Local Test ; copy variables to the original namespace
nameSpace Push ; saves current namespace
nameSpace Local Test
nameSpace Clear ; free memory used by temporary namespace
nameSpace Pop ; restore previous namespace
return

105
Namespace commands

See Also
nameSpace {local | global}, nameSpace clear, nameSpace {push | pop}, #nsType, #nsName, the
Section called Namespace Variables and Scope in Chapter 2

106
VII. Miscellaneous commands
deleteVar

Name
deleteVar — Sets a variable to an empty string

Synopsis
deleteVar {variable name}

Description
The deleteVar command deletes the content of a variable.

Note: The content can only be deleted if the variable has already been assigned to.

Note: The deleteVar command is deprecated since the set command can now assign an
empty string value to a variable.

Example
...
; set %test to something
set %test TEST

; note there is no % char in front.


deleteVar test

; %test now holds nothing


...

See Also
the Section called Variables in Chapter 2, set

109
Miscellaneous commands

display

Name
display — Shows a message

Synopsis
display {ok | okcancel | yesno | yesnocancel} {message}

Description
The display command displays a standard Windows messagebox with a set of buttons of your
choice.

Example
display yesno You have run out of ingots. Do you want to end the script?
if #dispRes = yes
halt
...

See Also
#dispRes

execute

Name
execute — Executes an external program.

Synopsis
execute {filename} [argument...]

110
Miscellaneous commands

Description
The execute command executes an external command with the argunments given.

Note: This command does NOT work unless you have enabled the "Allow Execute"
configuration option.

Example
execute EasyUO.exe healthWatch.euo

execute cmd.exe /c echo >>rail.txt move #charPosX #charPosY 0

linesPerCycle

Name
linesPerCycle — Sets the execution speed.

Synopsis
linesPerCycle {linespercycle}

Description
The linespercycle command sets the number of lines that the EasyUO parser runs through for
every cycle. The default value is 10 and is reset when you stop the script.

See Also
#lpc

111
Miscellaneous commands

playCD

Name
playCD — Starts playing an audio CD in a CD-Rom drive.

Synopsis
playCD {drive-spec}

Description
The playCD command plays an audio CD in the drive denoted by the drive-spec.

Example
...
if #hits < 30
playCD D:
...

set

Name
set — sets a variable to a value (variable assignment).

Synopsis
set {!namespaceVariable | %standardVariable | *persistantVariable |
#systemVariable} [expression] [abs]

112
Miscellaneous commands

Description
The set command, sets a varible to what an expression evaluates to. If the abs option is specified,
the absolute (mathimatically) value will be assigned. Ommitting the expression will set the
variable to a blank string.

Example
set %a 2
set %b $a ; we can use hexadecimal too
set %c ( %a * %b ) + 1 ; %c is 21
set %d %a * ( %b + 1 ) ; %d is 22
set %e %a * %b + 1 ; %e is 21
set %f ; set %f to a blank string
halt

See Also
Expressions

send

Name
send — Sends a HTTP request to a server and runs the code that is returned.

Synopsis
send {{"HTTPPost[port]"} | {"DebugHTTPPost[port]"} {site} {path} {post data}

Description
The send command sends a HTTP request to a web server and executes the code that is returned.

Note: Allow Send must be enabled for this command to work.

113
Miscellaneous commands

Example
;******************************
; EUO Chat V1.0 by Cheffe
;******************************
;
; Allow send must be enabled!!!

menu Clear
menu Window Size 245 120
menu Window Title EUO Chat V1.0
menu Show 200 200
menu HideEUO

menu Text 1 20 20 Please enter your nickname:


menu Font BGColor White
menu Edit 2 20 40 200
menu Font BGColor BtnFace
menu Button 3 130 70 90 25 OK

set #menuButton 0
N1:
if #menuButton = closed
halt
if #menuButton <> 3
goto N1

menu Get 2
set %nickname #menuRes

;******************************

menu Clear
menu Window Size 500 230
menu Font BGColor White
menu Edit e1 20 180 360
menu Font BGColor BtnFace
menu Button b1 400 180 80 25 Send!

set #menuButton 0
N2:
N3:
if #scnt2 > 30
{
send HTTPPost www.easyuo.com /webscripts/euochat.pl R
set #scnt2 0
}

114
Miscellaneous commands

if #menuButton = CLOSED
halt

if #menuButton <> b1
goto N3
set #menuButton 0

menu Get e1
send HTTPPost www.easyuo.com /webscripts/euochat.pl S %nickname , : #menuRes
menu Activate e1

goto N2

shutDown

Name
shutDown — Shuts your computer down.

Synopsis
shutDown ["force"]

Description
The shutDown command shuts your computer down. The option force forces non-responsive
application to shut down, as well.

sound

Name
sound — Plays a wave file or the SystemDefault beep.

115
Miscellaneous commands

Synopsis
sound [filename]

Description
(Added in 1.38, updated with filename in 1.39) The sound command plays a wave file or the
SystemDefault beep.

str

Name
str — performs a operation on a string.

Synopsis
str {"Len"} {string}
str {"Pos"} {string} {sub string}
str {"Left"} {string} {length}
str {"Right"} {string} {length}
str {"Mid"} {string} {start} {length}
str {"Lower"} {string}
str {"Ins"} {string} {sub string} {start}
str {"Del"} {string} {start} [length}

Description
(Added in 1.38) The str command performs a string operation on the string given and stores the
result in #strRes.

Table 1. String Operations

Option Description

116
Miscellaneous commands

Option Description
Len Stores the length of the string in the #strRes
system variable.
Pos Stores the position of the sub string in the
#strRes system variable.
Left Stores a part of the string taken from the left, in
the #strRes system variable.
Right Stores a part of the string taken from the right,
in the #strRes system variable.
Mid Stores a part of the string taken from the
middle, in the #strRes system variable.
Lower Stores a lower case version of the string in the
#strRes system variable.
Ins Inserts a string into the string and stores it in
the #strRes system variable.
Del Deletes a part of the string and stores it in the
#strRes system variable.

Example
set %string HELLO
str Len %string ; #strRes = 5
str Pos %string LL ; #strRes = 3
str Left %string 4 ; #strRes = HELL
str Right %string 2 ; #strRes = LO
str Mid %string 2 3 ; #strRes = ELL
str Lower %string ; #strRes = hello
str Ins %string I 3 ; #strRes = HELILO
str Del %string 3 2 ; #strRes = HEO

See Also
#strRes

117
Miscellaneous commands

tile

Name
tile — retrieves information about tiles.

Synopsis
tile {"Init"} [noOverrides]
tile {"Cnt"} {x} {y} [facet]
tile {"Get"} {x} {y} {index} [facet]

Description
(Added in 1.42) The tile command retrieves information about tiles.

Table 1. Tile Operations

Option Description
Init Initializes the tile information for retrieval in
EasyUO. The "noOverrides" options makes
EasyUO not read the statics override files, this
could be useful for freeshards that does not use
the overrides.
Cnt Retrieves the number of tiles for a specific
position. The value in #tileCnt is updated. The
default value for facet is the current facet.
Otherwise follows the values for #cursKind.
Get Retrives the tile type and z value. The values in
#tileType and #tileZ are updated. The index
goes from 1 to #tileCnt. The default value for
facet is the current facet. Otherwise follows the
values for #cursKind.

See Also
#tileType, #tileZ, #tileCnt, #cursKind

118
II. System Variable Reference
VIII. Character Info System
Variables
#charPosX

Name
#charPosX — (readonly) Determines the characters world X-coordinate.

Description
The #charPosX system variable determines the characters world X-coordinate. It is the same
coordinate system as used in UO Auto Map.

See Also
#charPosY, #charPosZ

#charPosY

Name
#charPosY — (readonly) Determines the characters world Y-coordinate.

Description
The #charPosY system variable determines the characters world X-coordinate. It is the same
coordinate system as used in UO Auto Map.

See Also
#charPosX, #charPosZ

123
Character Info System Variables

#charPosZ

Name
#charPosZ — (readonly) Determines the characters world Z-coordinate.

Description
The #charPosZ system variable determines the characters world Z-coordinate (elevation).

See Also
#charPosX, #charPosY

#charDir

Name
#charDir — (readonly) Determines the direction the character is facing.

Description
The #charDir system variable determines the direction the character is facing.

Table 1. #charDir values.

Value Facing
0 North
1 North East
2 East
3 South East
4 South
5 South West
6 West
7 Noth West

124
Character Info System Variables

Example
top:
if #CHARDIR = 0
msg : Looking North $
wait 2s
goto top

#charStatus

Name
#charStatus — (readonly) Determines different states that the character can be in.

Description
The #charStatus system variable determintes a number of different states that the character can
be in:

Table 1. #charStatus values.

Value Description
C Character is poisoned.
H Character is hidden.
B Character is female.
G Character is in war mode.

Example
...
if C in #charStatus
{
gosub cureMe
}

...

sub cureMe
...

125
Character Info System Variables

return

See Also
#charGhost, #sex

#charID

Name
#charID — (readonly) Determines the id of the character.

Description
The #charID system variable determines the id of your character. This is a unique identifier, so it
can be used to identify different characters and make specific actions depending on what character
it is.

Example
call specific_char_variables.txt
if #charID <> %charID
{
event sysmessage You are using this script for the wrong character! Halting Script!
halt
}

#charGhost

Name
#charGhost — (readonly) Determines if your character is dead.

126
Character Info System Variables

Description
The #charGhost system variable determines if your character is dead. If the character is dead it
holds "YES", if it is alive it holds "NO".

Example
...
if #charGhost = YES
{
gosub logOut
halt
}
...

See Also
#charStatus

127
Character Info System Variables

128
IX. Status Bar System Variables
#charName

Name
#charName — (readonly) Determines the name of the character.

Description
The #charName system variable determines the name of the character.

Note: This variable will not work unless the character status bar is open. You can use "event
Macro 8 2" to open it from your script.

Example
msg My name is #CHARNAME $
halt

#str

Name
#str — (readonly) Determines the strength of the character.

Description
The #str system variable determines the strength of the character.

Note: This variable will not work unless the character status bar is open. You can use "event
Macro 8 2" to open it from your script.

131
Status Bar System Variables

See Also
#hits, #maxHits, #dex, #stamina, #maxStam, #int, #mana, #maxMana, #maxStats

#hits

Name
#hits — (readonly) Determines the current number of hitpoints of the character.

Description
The #hits system variable determines the current number of hitpoints of the character.

Note: This variable will not work unless the character status bar is open. You can use "event
Macro 8 2" to open it from your script.

Example
...
if #hits < 30
goto recallHome
...

See Also
#str, #maxHits, #dex, #stamina, #maxStam, #int, #mana, #maxMana, #maxStats

#maxHits

Name
#maxHits — (readonly) Determines the maximum number of hitpoints of the character.

132
Status Bar System Variables

Description
The #maxHits system variable determines the maximum number of hitpoints of the character.

Note: This variable will not work unless the character status bar is open. You can use "event
Macro 8 2" to open it from your script.

See Also
#str, #hits, #dex, #stamina, #maxStam, #int, #mana, #maxMana, #maxStats

#dex

Name
#dex — (readonly) Determines the dexterity of the character.

Description
The #dex system variable determines the dexterity of the character.

Note: This variable will not work unless the character status bar is open. You can use "event
Macro 8 2" to open it from your script.

See Also
#str, #hits, #maxHits, #stamina, #maxStam, #int, #mana, #maxMana, #maxStats

#stamina

Name
#stamina — (readonly) Determines the current stamina level or the character.

133
Status Bar System Variables

Description
The #stamina system variable determines the current stamina level of the character.

Note: This variable will not work unless the character status bar is open. You can use "event
Macro 8 2" to open it from your script.

Example
...
if #stamina < 30
gosub drinkRefresh
...

See Also
#str, #hits, #maxHits, #dex, #maxStam, #int, #mana, #maxMana, #maxStats

#maxStam

Name
#maxStam — (readonly) Determines the maximum stamina level or the character.

Description
(Added in 1.41) The #maxStam system variable determines the maximum stamina level of the
character.

Note: This variable will not work unless the character status bar is open. You can use "event
Macro 8 2" to open it from your script.

Example
...
if #stamina < #maxStam
gosub drinkRefresh

134
Status Bar System Variables

...

See Also
#str, #hits, #maxHits, #dex, #stamina, #int, #mana, #maxMana, #maxStats

#int

Name
#int — (readonly) Determines the inteligence of the character.

Description
The #int system variable determines the inteligence of the character.

Note: This variable will not work unless the character status bar is open. You can use "event
Macro 8 2" to open it from your script.

See Also
#str, #hits, #maxHits, #dex, #stamina, #maxStam, #mana, #maxMana, #maxStats

#mana

Name
#mana — (readonly) Determines the current mana pool for the character.

Description
The #mana system variable determines the current mana pool for the character.

135
Status Bar System Variables

Note: This variable will not work unless the character status bar is open. You can use "event
Macro 8 2" to open it from your script.

Example
...
if #mana < 30
gosub meditate
...

See Also
#str, #hits, #maxHits, #dex, #stamina, #maxStam, #int, #maxMana, #maxStats

#maxMana

Name
#maxMana — (readonly) Determines the maximum mana pool for the character.

Description
(Added in 1.41) The #maxMana system variable determines the maximum mana pool for the
character.

Note: This variable will not work unless the character status bar is open. You can use "event
Macro 8 2" to open it from your script.

Example
...
if #mana < #maxMana
gosub meditate
...

136
Status Bar System Variables

See Also
#str, #hits, #maxHits, #dex, #stamina, #maxStam, #int, #mana, #maxStats

#maxStats

Name
#maxStats — (readonly) Determines the current maximum stats of the character.

Description
The #maxStats system variable determines the current maximum stats of the character.

Note: This variable will not work unless the character status bar is open. You can use "event
Macro 8 2" to open it from your script.

See Also
#str, #hits, #maxHits, #dex, #stamina, #maxStam, #int, #mana, #maxMana

#sex

Name
#sex — (readonly) Determines the sex of the character.

Description
The #sex system variable determines the sex of the character.

Note: This variable will not work unless the character status bar is open. You can use "event
Macro 8 2" to open it from your script.

137
Status Bar System Variables

Table 1. #sex values.

Value Description
0 Character is male.
1 Character is female.

See Also
#charStatus

#AR

Name
#AR — (readonly) Determines the Armor Rating of the character.

Description
The #AR system variable determines the Armor Rating (Physical Resistance with AoS system) of
the character.

Note: This variable will not work unless the character status bar is open. You can use "event
Macro 8 2" to open it from your script.

Example
msg My Physical Resist is #AR $
halt

See Also
#FR, #CR, #PR, #ER

138
Status Bar System Variables

#FR

Name
#FR — (readonly) Determines the Fire Resist of the character.

Description
(Added in 1.41) The #FR system variable determines the Fire Resist of the character.

Note: This variable will not work unless the character status bar is open. You can use "event
Macro 8 2" to open it from your script.

Example
msg My Fire Resist is #FR $
halt

See Also
#AR, #CR, #PR, #ER

#CR

Name
#CR — (readonly) Determines the Cold Resist of the character.

Description
(Added in 1.41) The #CR system variable determines the Cold Resist of the character.

Note: This variable will not work unless the character status bar is open. You can use "event
Macro 8 2" to open it from your script.

139
Status Bar System Variables

Example
msg My Cold Resist is #CR $
halt

See Also
#AR, #FR, #PR, #ER

#PR

Name
#FR — (readonly) Determines the Poison Resist of the character.

Description
(Added in 1.41) The #PR system variable determines the Poison Resist of the character.

Note: This variable will not work unless the character status bar is open. You can use "event
Macro 8 2" to open it from your script.

Example
msg My Poison Resist is #PR $
halt

See Also
#AR, #FR, #CR, #ER

140
Status Bar System Variables

#ER

Name
#ER — (readonly) Determines the Energy Resist of the character.

Description
(Added in 1.41) The #ER system variable determines the Energy Resist of the character.

Note: This variable will not work unless the character status bar is open. You can use "event
Macro 8 2" to open it from your script.

Example
msg My Energy Resist is #ER $
halt

See Also
#AR, #FR, #CR, #PR

#gold

Name
#gold — (readonly) Determines the amount of gold on the character.

Description
The #gold system variable determines the amount of gold on the character.

Note: This variable will not work unless the character status bar is open. You can use "event
Macro 8 2" to open it from your script.

141
Status Bar System Variables

Example
...
if #gold < 1000
gosub gotoBank
...

#weight

Name
#weight — (readonly) Determines the current weight of the character.

Description
The #weight system variable determines the current weight of the character.

Note: This variable will not work unless the character status bar is open. You can use "event
Macro 8 2" to open it from your script.

Example
...
if #weight > 350
gosub gotoBank
...

See Also
#maxWeight

142
Status Bar System Variables

#maxWeight

Name
#maxWeight — (readonly)Determines the maximum weight of the character.

Description
The #maxWeight system variable determines the maximum weight of the character.

Note: This variable will not work unless the character status bar is open. You can use "event
Macro 8 2" to open it from your script.

See Also
#weight

#followers

Name
#followers — (readonly) Determines the current number of followers of the character.

Description
The #followers system variable determines the current number of followers of the character.

Note: This variable will not work unless the character status bar is open. You can use "event
Macro 8 2" to open it from your script.

See Also
#maxFol

143
Status Bar System Variables

#maxFol

Name
#maxFol — (readonly) Determines the maximum number of followers of the character.

Description
(Added in 1.41) The #maxFol system variable determines the maximum number of followers of
the character.

Note: This variable will not work unless the character status bar is open. You can use "event
Macro 8 2" to open it from your script.

See Also
#followers

#luck

Name
#luck — (readonly) Determines the current luck of the character.

Description
(Added in 1.41) The #luck system variable determines the current luck of the character.

Note: This variable will not work unless the character status bar is open. You can use "event
Macro 8 2" to open it from your script.

144
Status Bar System Variables

#minDmg

Name
#minDmg — (readonly) Determines the minimum damage done with the currently yielded
weapon.

Description
(Added in 1.41) The #minDmg system variable determines the minimum damage done with the
currently yielded weapon.

Note: This variable will not work unless the character status bar is open. You can use "event
Macro 8 2" to open it from your script.

See Also
#maxDmg

#maxDmg

Name
#maxDmg — (readonly) Determines the maximum damage done with the currently yielded
weapon.

Description
(Added in 1.41) The #maxDmg system variable determines the maximum damage done with the
currently yielded weapon.

Note: This variable will not work unless the character status bar is open. You can use "event
Macro 8 2" to open it from your script.

145
Status Bar System Variables

See Also
#minDmg

146
X. Container Info System Variables
#nextCPosX

Name
#nextCPosX — (read/write) Determines the x-coordinate of where the next containter/gump
will open.

Description
The #nextCPosX system variable determines the x-coordinate of where the next container/gump
will open.

Note: The "Offset interface windows rather than perfectly stacking them" option, in Interface
options (Mouse Icon) must be turned on for this to work.

Example
; Open bank box at 10,10
set #nextCPosX 10
set #nextCPosY 10
msg bank$
halt

See Also
#nextCPosY, contPos, nextCPos

#nextCPosY

Name
#nextCPosY — (read/write) Determines the y-coordinate of where the next containter/gump
will open.

149
Container Info System Variables

Description
The #nextCPosY system variable determines the y-coordinate of where the next container/gump
will open.

Note: The "Offset interface windows rather than perfectly stacking them" option, in Interface
options (Mouse Icon) must be turned on for this to work.

Example
; Open bank box at 10,10
set #nextCPosX 10
set #nextCPosY 10
msg bank$
halt

See Also
#nextCPosX, contPos, nextCPos

#contSize

Name
#contSize — (readonly) Determines the size of the currently selected container/gump.

Description
The #contSize system variable determines the size of the currently selected container/gump. The
format is as follows: "{Width}_{Height}".

See Also
#contPosY, #contKind, #contID, #contType

150
Container Info System Variables

#contPosX

Name
#contPosX — (read/write) Determines the x-coordinate of the currently selected
container/gump.

Description
The #contPosX system variable determines the x-coordinate of the currently selected
container/gump.

See Also
#contSize, #contPosY, #contKind, #contID, #contType

#contPosY

Name
#contPosY — (read/write) Determines the y-coordinate of the currently selected
container/gump.

Description
The #contPosY system variable determines the y-coordinate of the currently selected
container/gump.

See Also
#contSize, #contPosX, #contKind, #contID, #contType

151
Container Info System Variables

#contKind

Name
#contKind — (readonly) Determines the kind of the currently selected container/gump.

Description
The #contKind system variable determines the kind of the currently selected container/gump.
Most menus have a kind attached to them. The can be utilized to find out if a crafting menu is
open, if something is being dragged, if a runebook is open and many other things.

Note: This variable can change every time a new patch is released for the client. Good
scripting standards dictate that you use variables in top of your script for #contKind’s. This way
they can easily be updated if the client is patched.

Example
...
if #contKind <> %craftMenuKind
gosub useNewTool
...

See Also
#contSize, #contPosX, #contPosY, #contID, #contType

#contID

Name
#contID — (readonly) Determines the id of the currently selected container/gump.

152
Container Info System Variables

Description
The #contID system variable determines the id of the currently selected container/gump.

See Also
#contSize, #contPosX, #contPosY, #contKind, #contType

#contType

Name
#contType — (readonly) Determines the object type of the currently selected container/gump.

Description
The #contType system variable determines the object type of the currently selected
container/gump.

See Also
#contSize, #contPosX, #contPosY, #contKind, #contID

#contName

Name
#contName — (readonly) Determines the name of currently selected container/gump.

Description
(Added in 1.41) The #contName system variable determines the name of the currently selected
container/gump.
The following values have been found so far (not all are identified):

153
Container Info System Variables

Table 1. #contName values.

Value Description
stack_gump comes up for amount input when dragging a
stack
drag_gump when something is dragged on the cursor
paperdoll_gump
status_gump
skill_gump
text_gump from a journal open
YesNo_gump from a logout
OptionsGump
generic_gump from a help request. Pretty much indicitive of
the answers you get too! lol. Also from
runebooks and tailoring/blacksmith menus.
missile_gump seems to be an intermediate/transitional status,
shows up when something if flying through the
air.
normal_gump seen with: chat, shardselect
container_gump
MainMenu_gump
waiting_gump this one comes up for stuff like bad password
login_gump
GameAreaEdgeGump very quick, hard to catch, name might be
wrong
radar_gump The map
DamageNumbers_gump comes up when doing damage to a target
skillcon_gump
spellcon_gump
party_gump
profile_gump
combat_ability_book_gump for setting special moves
spellbook_gump
Course_gump Treasure Map
Bill_gump Buy/Sell
hue_gump set the color of dye tub

154
Container Info System Variables

Value Description
CharCreation_gump character creation
ListBoxControl_gump it can be found on option gump, character
creation
resize_gump resizing journal, skill gump, etc...
map_gump Character creation, when you choose the city to
start
CONTEXT_HELP Codex of Wisdom...

See Also
#contSize, #contPosX, #contPosY, #contKind, #contID, #contType

155
Container Info System Variables

156
XI. Last Action System Variables
#lObjectID

Name
#lObjectID — (read/write) Determines the id of the last used object.

Description
The #lObjectID system variable determines the id of the last used object. You can also write to
this variable and use it in conjuction with "event Macro 17" (LastObject), which will use the
object as if it was double-clicked with the mouse.

Example
set #lObjectID %carpentryTool
event macro 17
; crafting menu is now open
...

See Also
event Macro

#lObjectType

Name
#lObjectType — (readonly) Determines the type of the last used object.

Description
The #lObjectType system variable determines the type of the last used object.

159
Last Action System Variables

#lTargetID

Name
#lTargetID — (read/write) Determines the id of the last target used.

Description
The #lTargetID system variable determines the id of the last target used. You can also write to
this variable and use it in conjuction with "event Macro 22" (LastTarget), which will target the
object as if it was clicked with the mouse.

Be aware: #lTargetKind must be set to 1 for event Macro 22 to use the target id.

Example
; use the dagger
set #lObjectID %dagger
event Macro 17

; wait for target cursor


target 5s

; carve the hides from the corpse


set #lTargetID %cowCorpse
set #lTargetKind 1 ; make sure it targets an object
event Macro 22
...

See Also
event Macro, #lTargetKind

160
Last Action System Variables

#lTargetX

Name
#lTargetX — (read/write) Determines the world x-coordinate of the last target used.

Description
The #lTargetX system variable determines the world x-coordinate of the last target used.

Be aware: #lTargetKind must be set to 2 or 3 for event Macro 22 to use the target position.

Example
; use the shovel
set #lObjectID %shovel
event Macro 17

; wait for target cursor


target 5s

; mine a spot
set #lTargetX 1000
set #lTargetY 1000
set #lTargetZ -1
set #lTargetKind 3
event Macro 22
...

See Also
event Macro, #lTargetKind, #lTargetY, #lTargetZ

161
Last Action System Variables

#lTargetY

Name
#lTargetY — (read/write) Determines the world y-coordinate of the last target used.

Description
The #lTargetY system variable determines the world y-coordinate of the last target used.

Be aware: #lTargetKind must be set to 2 or 3 for event Macro 22 to use the target position.

Example
; use the shovel
set #lObjectID %shovel
event Macro 17

; wait for target cursor


target 5s

; mine a spot
set #lTargetX 1000
set #lTargetY 1000
set #lTargetZ -1
set #lTargetKind 3
event Macro 22
...

event Macro, #lTargetKind, #lTargetX, #lTargetZ

#lTargetZ

Name
#lTargetZ — (read/write) Determines the world z-coordinate of the last target used.

162
Last Action System Variables

Description
The #lTargetZ system variable determines the world z-coordinate of the last target used.

Be aware: #lTargetKind must be set to 2 or 3 for event Macro 22 to use the target position.

Example
; use the shovel
set #lObjectID %shovel
event Macro 17

; wait for target cursor


target 5s

; mine a spot
set #lTargetX 1000
set #lTargetY 1000
set #lTargetZ -1
set #lTargetKind 3
event Macro 22
...

event Macro, #lTargetKind, #lTargetX, #lTargetY

#lTargetKind

Name
#lTargetKind — (read/write) Determines the kind of what was last targeted.

Description
The #lTargetKind system variable determines the kind of what was last targeted:

163
Last Action System Variables

Value Description
Table 1. #lTargetKind values.

Value Description
1 Object.
2 Ground/Mountains/Caves.
3 Resource/Tree.

Object Example
; use the dagger
set #lObjectID %dagger
event Macro 17

; wait for target cursor


target 5s

; carve the hides from the corpse


set #lTargetID %cowCorpse
set #lTargetKind 1 ; make sure it targets an object
event Macro 22
...

World Position Example


; use the shovel
set #lObjectID %shovel
event Macro 17

; wait for target cursor


target 5s

; mine a spot
set #lTargetX 1000
set #lTargetY 1000
set #lTargetZ -1
set #lTargetKind 3
event Macro 22
...

164
Last Action System Variables

See Also
#lTargetID, #lTargetX, #lTargetY, #lTargetZ

#lTargetTile

Name
#lTargetTile — (read/write) Determines the tile last targeted.

Description
The #lTargetTile system variable determines the tile last targeted. The number in this variable
is determined by the graphic of the tile.

#lLiftedID

Name
#lLiftedID — (readonly) Determines the id of the object last dragged/lifted.

Description
The #lLiftedID system variable determines the id of the object last dragged/lifted.

Example
initEvents

finditem JTL
event Drag #findID
wait 20
msg The ID of the item you lifted is #lLiftedID $
halt

165
Last Action System Variables

See Also
#lLiftedID, #lLiftedKind

#lLiftedType

Name
#lLiftedType — (readonly) Determines the type of the object last dragged/lifted.

Description
(Added in 1.41) The #lLiftedType system variable determines the type of the object last
dragged/lifted.

Example
initEvents

finditem JTL
event Drag #findID
wait 20
msg The type of the item you lifted is #lLiftedType $
halt

See Also
#lLiftedType, #lLiftedKind

#lLiftedKind

Name
#lLiftedKind — (readonly) Determines if an object is being dragged/lifted.

166
Last Action System Variables

Description
(Added in 1.41) The #lLiftedKind system variable determines if an object is being
dragged/lifted.

Table 1. #lLiftedKind values

Value Description
0 An object is not on the cursor
1 An object is on the cursor

See Also
#lLiftedID, #lLiftedType

#lSkill

Name
#lSkill — (read/write) Determines the skill last used.

Description
The #lSkill system variable determines the skill last used. You can also write to this variable and
use it in conjuction with "event Macro 14" (LastSkill), which will perform the skill as if you
clicked the blue diamond in the skill list.

Table 1. #lSkill values

Skill Number Skill Name


1 Anatomy
2 Animal Lore
35 Animal Taming
4 Arms Lore
6 Begging
12 Cartography
14 Detecting Hidden

167
Last Action System Variables

Skill Number Skill Name


15 Discordance
16 Evaluating Intelligence
19 Forensic Evaluation
21 Hiding
23 Inscription
3 Item Identification
46 Meditation
9 Peacemaking
30 Poisoning
22 Provocation
48 Remove Trap
32 Spirit Speak
33 Stealing
47 Stealth
36 Taste Identification
38 Tracking

See Also
event Macro

#lSpell

Name
#lSpell — (read/write) Determines the last spell cast.

Description
The #lSpell system variable determines the last spell cast. You can also write to this variable and
use it in conjuction with "event Macro 16" (LastSpell), which will cast the spell.

Table 1. #lSpell values

168
Last Action System Variables

Spell Number Spell Name


0 Clumsy
1 Create Food
2 Feeblemind
3 Heal
4 Magic Arrow
5 Night Sight
6 Reactive Armor
7 Weaken
8 Agility
9 Cunning
10 Cure
11 Harm
12 Magic Trap
13 Magic Untrap
14 Protection
15 Strength
16 Bless
17 Fireball
18 Magic Lock
19 Poison
20 Telekinesis
21 Teleport
22 Unlock
23 Wall Of Stone
24 Arch Cure
25 Arch Protection
26 Curse
27 Fire Field
28 Greater Heal
29 Lightning
30 Mana Drain
31 Recall
32 Blade Spirits

169
Last Action System Variables

Spell Number Spell Name


33 Dispel Field
34 Incognito
35 Magic Reflection
36 Mind Blast
37 Paralyze
38 Poison Field
39 Summon Creature
40 Dispel Field
41 Energy Bolt
42 Explosion
43 Invisibility
44 Mark
45 Mass Curse
46 Paralyze Field
47 Reveal
48 Chain Lightning
49 Energy Field
50 Flame Strike
51 Gate Travel
52 Mana Vampire
53 Mass Dispel
54 Meteor Swarm
55 Polymorph
56 Earthquake
57 Energy Vortex
58 Resurrection
59 Air Elemental
60 Summon Daemon
61 Earth Elemental
62 Fire Elemental
63 Water Elemental
101 [N] Animate Dead
102 [N] Blood Oath

170
Last Action System Variables

Spell Number Spell Name


103 [N] Corpse Skin
104 [N] Curse Weapon
105 [N] Evil Omen
106 [N] Horrific Beast
107 [N] Lich Form
108 [N] Mind Rot
109 [N] Pain Spike
110 [N] Poison Strike
111 [N] Strangle
112 [N] Summon Familiar
113 [N] Vampiric Embrace
114 [N] Vengeful Spirit
115 [N] Wither
116 [N] Wraith Form
201 [C] Cleanse by Fire
202 [C] Close Wounds
203 [C] Consecrate Weapon
204 [C] Dispel Evil
205 [C] Divine Fury
206 [C] Enemy of One
207 [C] Holy Light
208 [C] Noble Sacrifice
209 [C] Remove Curse
210 [C] Sacred Journey

See Also
event Macro

171
Last Action System Variables

172
XII. FindItem System Variables
#findID

Name
#findID — (readonly) Determines the id of the object returned by findItem.

Description
The #findID system variable determines the id of the object returned by findItem.

Example
findAgain:
finditem POF

if #findkind = 1
{
ignoreitem #findid
goto findAgain
}
if findkind = -1
halt
msg #findid is the ID of the gold in my bag. I have exactly #findstack gold on me.$
halt

See Also
findItem, #findType, #findX, #findY, #findZ, #findDist, #findKind, #findStack, #findBagID,
#findMod, #findRep, #findCol, #findCnt

#findType

Name
#findType — (readonly) Determines the type of the object returned by findItem.

175
FindItem System Variables

Description
The #findType system variable determines the type of the object returned by findItem.

See Also
findItem, #findID, #findX, #findY, #findZ, #findDist, #findKind, #findStack, #findBagID,
#findMod, #findRep, #findCol, #findCnt

#findX

Name
#findX — (readonly) Determines the x-coordinate of the object returned by findItem.

Description
The #findX system variable determines the x-coordinate of the object returned by findItem. If
#findKind equals 0, the coordinate is a screen coordinate, if #findKind equals 1, the coordinate is a
world coordinate.

See Also
findItem, #findID, #findType, #findY, #findZ, #findDist, #findKind, #findStack, #findBagID,
#findMod, #findRep, #findCol, #findCnt

#findY

Name
#findY — (readonly) Determines the y-coordinate of the object returned by findItem.

176
FindItem System Variables

Description
The #findY system variable determines the x-coordinate of the object returned by findItem. If
#findKind equals 0, the coordinate is a screen coordinate, if #findKind equals 1, the coordinate is a
world coordinate.

See Also
findItem, #findID, #findType, #findX, #findZ, #findDist, #findKind, #findStack, #findBagID,
#findMod, #findRep, #findCol, #findCnt

#findZ

Name
#findZ — (readonly) Determines the z-coordinate of the object returned by findItem.

Description
The #findZ system variable determines the x-coordinate of the object returned by findItem. If
#findKind equals 0, the coordinate is not valid, if #findKind equals 1, the coordinate is a world
coordinate.

See Also
findItem, #findID, #findType, #findX, #findY, #findDist, #findKind, #findStack, #findBagID,
#findMod, #findRep, #findCol, #findCnt

#findDist

Name
#findDist — (readonly) Determines the distance from the character to the object returned by
findItem.

177
FindItem System Variables

Description
The #findDist system variable determines the distance from the character to the object returned
by findItem.

See Also
findItem, #findID, #findType, #findX, #findY, #findZ, #findKind, #findStack, #findBagID,
#findMod, #findRep, #findCol, #findCnt

#findKind

Name
#findKind — (readonly) Determines the kind of the object returned by findItem.

Description
The #findKind system variable determines the kind of the object returned by findItem.

Table 1. #findKind values.

Value Description
-1 No objects found.
0 Object is in a container.
1 Object is on the ground.

See Also
findItem, #findID, #findType, #findX, #findY, #findZ, #findDist, #findStack, #findBagID,
#findMod, #findRep, #findCol, #findCnt

178
FindItem System Variables

#findStack

Name
#findStack — (readonly) Determines the number of stacked items in the object returned by
findItem.

Description
The #findStack system variable determines the number of stacked items in the object returned
by findItem.

See Also
findItem, #findID, #findType, #findX, #findY, #findZ, #findDist, #findKind, #findBagID,
#findMod, #findRep, #findCol, #findCnt

#findBagID

Name
#findBagID — (readonly) Determines the bag the object returned by findItem is contained in.

Description
The #findBagID system variable determines the bag the object returned by findItem is contained
in.

See Also
findItem, #findID, #findType, #findX, #findY, #findZ, #findDist, #findKind, #findStack, #findMod,
#findRep, #findCol, #findCnt

179
FindItem System Variables

#findMod

Name
#findMod — (read/write) Determines displacement for #findX and #findY.

Description
The #findMod system variable Determines displacement for #findX and #findY.
The displacement is in the format {X}_{Y}.
The displacement is added to #findX and #findY respectively.

See Also
findItem, #findID, #findType, #findX, #findY, #findZ, #findDist, #findKind, #findStack,
#findBagID, #findRep, #findCol, #findCnt

#findRep

Name
#findRep — (readonly) Determines the reputation of the object returned by findItem.

Description
The #findRep system variable determines the reputation of the object returned by findItem:

Table 1. #findRep values.

Value Description
1 Innocent (Blue)
2 Friend (Green)
3 Grey (Grey - Animal)
4 Criminal (Grey)
5 Enemy (Orange)

180
FindItem System Variables

Value Description
6 Murderer (Red)
7 Invulnerable (Yellow)

See Also
findItem, #findID, #findType, #findX, #findY, #findZ, #findDist, #findKind, #findStack,
#findBagID, #findMod, #findCol, #findCnt

#findCol

Name
#findCol — (readonly) Determines the color of the object returned by findItem.

Description
The #findCol system variable determines the color of the object returned by findItem.

See Also
findItem, #findID, #findType, #findX, #findY, #findZ, #findDist, #findKind, #findStack,
#findBagID, #findMod, #findCnt

#findCnt

Name
#findCnt — (readonly) Determines the number of objects that matches what was searched for
with the findItem command.

181
FindItem System Variables

Description
The #findCnt system variable determines the number of objects that matches what was searched
for with the findItem command.

See Also
findItem, #findID, #findType, #findX, #findY, #findZ, #findDist, #findKind, #findStack,
#findBagID, #findMod, #findCol

182
XIII. Shop Info System Variables
#shopCurPos

Name
#shopCurPos — (readonly) Determines the current position on the shop menu

Description
The #shopCurPos system variable determines the current position on the shop menu.

See Also
getShopInfo, #shopCnt, #shopItemType, #shopItemID, #shopItemName, #shopItemPrice,
#shopItemMax

#shopCnt

Name
#shopCnt — (readonly) Determines the total number of lines on the shop menu.

Description
The #shopCnt system variable determines the total number of lines on the shop menu.

See Also
getShopInfo, #shopCurPos, #shopItemType, #shopItemID, #shopItemName, #shopItemPrice,
#shopItemMax

185
Shop Info System Variables

#shopItemType

Name
#shopItemType — (readonly) Determines the item type of the current line on the shop menu.

Description
The #shopItemType

Note: To initialize this variable, you need to call getShopInfo.

See Also
getShopInfo, #shopCurPos, #shopCnt, #shopItemID, #shopItemName, #shopItemPrice,
#shopItemMax

#shopItemID

Name
#shopItemID — (readonly) Determines the item ID of the current line on the shop menu.

Description
The #shopItemID system variable determines the item ID of the current line on the shop menu.

Note: To initialize this variable, you need to call getShopInfo.

See Also
getShopInfo, #shopCurPos, #shopCnt, #shopItemType, #shopItemName, #shopItemPrice,
#shopItemMax

186
Shop Info System Variables

#shopItemName

Name
#shopItemName — (readonly) Determines the name of the item the current line on the shop
menu.

Description
The #shopItemName system variable determines the name of the item the current line on the shop
menu.

Note: To initialize this variable, you need to call getShopInfo.

See Also
getShopInfo, #shopCurPos, #shopCnt, #shopItemType, #shopItemID, #shopItemPrice,
#shopItemMax

#shopItemPrice

Name
#shopItemPrice — (readonly) Determines the price of the current line in the shop menu.

Description
The #shopItemPrice system variable determines the price of the current line in the shop menu.

Note: To initialize this variable, you need to call getShopInfo.

187
Shop Info System Variables

See Also
getShopInfo, #shopCurPos, #shopCnt, #shopItemType, #shopItemID, #shopItemName,
#shopItemMax

#shopItemMax

Name
#shopItemMax — (readonly) Determines the number of items in the stack of the current line in
the shop menu.

Description
The #shopItemMax system variable determines the number of items in the stack of the current
line in the shop menu.

Note: To initialize this variable, you need to call getShopInfo.

See Also
getShopInfo, #shopCurPos, #shopCnt, #shopItemType, #shopItemID, #shopItemName,
#shopItemPrice

188
XIV. Extended Info System Variables
#skill

Name
#skill — (readonly) Determines the current skill level for a skill chosen with chooseSkill
command.

Description
The #skill system variable determines the current skill level for a skill chosen with chooseSkill
command.

Example
chooseSkill taming
if #skill < 1000
event SysMessage You need to tame bulls.
if #skill >= 1000
event SysMessage You need to tame ridgebacks.

See Also
chooseSkill, event SkillLock, #skillLock

#skillCap

Name
#skillCap — (readonly) Determines the current skill cap for a skill chosen with chooseSkill
command.

Description
The #skillCap system variable determines the current skill cap for a skill chosen with
chooseSkill command.

191
Extended Info System Variables

See Also
chooseSkill, event SkillLock, #skillLock

#skillLock

Name
#skillLock — (readonly) Determines the current lock status of the skill chosen with
chooseSkill command.

Description
The #skillLock system variable determines the current lock status of the skill chosen with
chooseSkill command.

Table 1. #skillLock values.

Value Description
up Skill lock is pointing up.
down Skill lock is pointing down.
locked Skill lock is locked.

Example
chooseSkill taming
if #skillLock = locked
{
event SysMessage Your taming is locked. Cannot continue.
halt
}

See Also
chooseSkill, event SkillLock, #skill

192
Extended Info System Variables

#journal

Name
#journal — (readonly) Determines the journal line selected using the scanJournal command.

Description
The #journal system variable determines the journal line selected using the scanJournal
command.

Example
loop:
scanJournal 1
if is_attacking_you in #journal
{
msg Guards$
call recallme
}
delteJournal
goto loop

See Also
deleteJournal, scanJournal, #jIndex, #jColor

#jIndex

Name
#jIndex — (readonly) Determines the index of the current journal entry.

193
Extended Info System Variables

Description
The #jIndex system variable determines the index of the current journal entry. By calling
scanJournal with #jIndex as the parameter you will get the last line in the journal. By saving the
value of #jIndex at appropriate times you can scan a section of the journal without ever losing a
string.

Example
initEvents

set %success #false


set %js #jIndex + 1
msg #smc TestA$
msg #smc TestB$
msg #smc TestC$
wait 1s
set %je #jIndex
for %ji %js %je
{
scanJournal %ji
if TestB in #journal
set %success #true
msg #smc Interference$
}
if %success = #true
display Ok Success
else
display Ok Failure
halt

See Also
deleteJournal, scanJournal, #journal, #jColor

#jColor

Name
#jColor — (read/write) Determines the color of the text in the journal.

194
Extended Info System Variables

Description
The #jColor system variable determines the color of the text in the journal.

See Also
deleteJournal, scanJournal, #journal

#sysMsg

Name
#sysMsg — (readonly) Determines the current system message.

Description
The #sysMsg system variable determines the current system message.

See Also
#sysMsgCol

#sysMsgCol

Name
#sysMsgCol — (read/write) Determines the current system message color.

Description
The #sysMsgCol system variable determines the current system message color.

195
Extended Info System Variables

Example
set #sysmsgcol 1264
halt

See Also
#sysMsg

#targCurs

Name
#targCurs — (read/write) Determines if cursor is a target cursor.

Description
The #targCurs system variable determines if cursor is a target cursor. It can also be written to, to
get a target cursor.

Table 1. #targCurs values.

Value Description
0 Cursor is a normal cursor.
1 Cursor is a target cursor.

Example
initevents

event SysMessage Target something!

set #targCurs 1
targLoop
if #targCurs = 1
goto targLoop

event SysMessage The ID of the target is #lTargetID

196
Extended Info System Variables

halt

See Also
target

#cursKind

Name
#cursKind — (readonly) Determines the facet where the character is.

Description
The #cursKind system variable determines the facet where the character is.

Table 1. #cursKind values.

Value Description
0 Felucca
1 Trammel
2 Ilshenar
3 Malas

Example
_PROGRAM_cursKind

197
Extended Info System Variables

198
XV. Client Info System Variables
#cliVer

Name
#cliVer — (readonly) Determines the version of the client.

Description
The #cliVer system variable determines the version of the client.

Example
if #cliVer <> 4.0.0e
{
event SysMessage This script was developed for client 4.0.0e. Be aware of any change
pause
}

#cliCnt

Name
#cliCnt — (readonly) Determines the number of clients currently running.

Description
The #cliCnt system variable determines the number of clients currently running.

See Also
uoXL, terminate, #cliNr

201
Client Info System Variables

#cliNr

Name
#cliNr — (readonly) Determines which client is currently active for EasyUO.

Description
The #cliNr system variable determines which client is currently active for EasyUO.

See Also
uoXL, terminate, #cliCnt

#cliXRes

Name
#cliXRes — (read/write) Determines the width of the gameplay window.

Description
The #cliXRes system variable determines the width of the gameplay window.

Example
; Make the game play window small
set #cliXRes 100
set #cliYRes 100
halt

See Also
#cliYRes, #cliLeft, #cliTop

202
Client Info System Variables

#cliYRes

Name
#cliYRes — (read/write) Determines the height of the gameplay window.

Description
The #cliYRes system variable determines the height of the gameplay window.

Example
; Make the game play window small
set #cliXRes 100
set #cliYRes 100
halt

See Also
#cliXRes, #cliLeft, #cliTop

#cliLeft

Name
#cliLeft — (read/write) Determines the X coordinate of the left edge of the gameplay window.

Description
The #cliLeft system variable determines the X coordinate of the left edge of the gameplay
window.

203
Client Info System Variables

Example
; Move the gameplay window to the top/left corner
set #cliLeft 0
set #cliTop 0
halt

See Also
#cliXRes, #cliYRes, #cliTop

#cliTop

Name
#cliTop — (read/write) Determines the Y coordinate of the top edge of the gameplay window.

Description
The #cliTop system variable determines the Y coordinate of the top edge of the gameplay
window.

Example
; Move the gameplay window to the top/left corner
set #cliLeft 0
set #cliTop 0
halt

See Also
#cliXRes, #cliYRes, #cliLeft

204
Client Info System Variables

#cliLogged

Name
#cliLogged — (readonly) Determines if a character is logged into the game.

Description
(Added in 1.41) The #cliLogged system variable determines if a character is logged into the
game.

Table 1. #cliLogged values.

Value Description
0 Not logged in
1 Logged in

205
Client Info System Variables

206
XVI. Combat Info System Variables
#lHandID

Name
#lHandID — (read/write) Determines the ID of the item to be armed in the left hand.

Description
The #lHandID system variable determines the ID of the item to be armed in the left hard.

Example
initEvents

set #lHandID %shield


event Macro 24 1
halt

See Also
event Macro, #rHandID

#rHandID

Name
#rHandID — (read/write) Determines the ID of the item to be armed in the right hand.

Description
The #rHandID system variable determines the ID of the item to be armed in the right hand.

209
Combat Info System Variables

Example
initEvents

set #rHandID %dagger


event Macro 24 2
halt

See Also
event Macro, #lHandID

#enemyHits

Name
#enemyHits — (readonly) Determines the percentage of hit points left on the current enemy.

Description
The #enemyHits system variable determines the percentage of hit points left on the current
enemy.

See Also
#enemyID

#enemyID

Name
#enemyID — (readonly) Determines the ID of the current enemy.

210
Combat Info System Variables

Description
The #enemyID system variable determines the ID of the current enemy.
Unfortunately it is only possible to see on enemy at a time using this variable, and you will notice
if you have more than one enemy, the variable will switch around by random. Instead a solution
like below can be used:
; constants
set %_NORTHWEST 0
set %_NORTH 1
set %_NORTHEAST 2
set %_EAST 3
set %_SOUTHEAST 4
set %_SOUTH 5
set %_SOUTHWEST 6
set %_WEST 7
set %_SAMETILE 8

;===========================================================
; Name: findEnemyArray
; Status: Still being reviewed
; Author: Roadkill
; Parameters: %1 = objectTypes
; Purpose: find objects of %_objectTypes and arrange data into array
; Return: array is %enemyArray, indexes are:
; 1=enemyid
; 2=enemytype
; 3=finddist
; 4=findrep
; 5=direction
; 9=totalfound
;-----------------------------------------------------------
sub findEnemyArray
set %_objectTypes %1
set %_idx 0
_findEnemyArray:
set %_idx %_idx + 1
findItem %_objectTypes %_idx
if #findKind = 1
{
set %enemyArray1 . %_idx #findID
set %enemyArray2 . %_idx #findType
set %enemyArray3 . %_idx #findDist
set %enemyArray4 . %_idx #findRep
gosub findDirectionTo #findX #findY
set %enemyArray5 . %_idx %thingsDirection

211
Combat Info System Variables

goto _findEnemyArray
}
set %enemyArray1 . %_idx 0 ;put a 0 after valid spots
set %enemyArray9 %_idx - 1 ;puts total found enemy position 9
return

;===========================================================
; Name: findDirectionTo
; Author: Roadkill
; Parameters: %1 = world x-coordinate, can use FINDITEM to get this as #FINDX
; %2 = world y-coordinate , as above
; Purpose: find the direction from character to something,
; use FINDITEM to get it’s coords
; Return: %thingsDirection, (%_NORTHWEST, %_NORTH,%_NORTHEAST, %_EAST,
; %_SOUTHEAST, %_SOUTH, %_SOUTHWEST, %_WEST or %_SAMETILE)
; these will be a number 0 thru 8 0-nw 1-n 2-ne 3-e 4-se
; 5-s 6-sw 7-w 8-same
;-----------------------------------------------------------
sub findDirectionTo
if %1 < #charPosX
{
if %2 < #charPosY
set %thingsDirection %_NORTHWEST
if %2 > #charPosY
set %thingsDirection %_SOUTHWEST
if %2 = #charPosY
set %thingsDirection %_WEST
}
if %1 > #charPosX
{
if %2 < #charPosY
set %thingsDirection %_NORTHEAST
if %2 > #charPosY
set %thingsDirection %_SOUTHEAST
if %2 = #charPosY
set %thingsDirection %_EAST
}
if %1 = #charPosX
{
if %2 < #charPosY
set %thingsDirection %_NORTH
if %2 > #charPosY
set %thingsDirection %_SOUTH
if %2 = #charPosY
set %thingsDirection %_SAMETILE
}

212
Combat Info System Variables

return

See Also
#enemyHits

213
Combat Info System Variables

214
XVII. Namespace System Variables
#nsName

Name
#nsName — (readonly) Determines the name of the currently active namespace.

Description
(Added in 1.39) The #nsName system variable determines the name of the currently active
namespace.

See Also
#nsType, nameSpace {local | global}, nameSpace clear, nameSpace {push | pop}, nameSpace
copy, Local Variables

#nsType

Name
#nsType — (readonly) Determines the type of the currently active namespace.

Description
(Added in 1.39) The #nsType system variable determines the type of the currently active
namespace. This variable is either LOCAL or GLOBAL.

See Also
#nsName, nameSpace {local | global}, nameSpace clear, nameSpace {push | pop}, nameSpace
copy, Local Variables

Note: Global namespace is not available in the current EasyUO, but will be available later.

217
Namespace System Variables

218
XVIII. Miscellaneous System
Variables
#shard

Name
#shard — (readonly) Determines which shard you are logged into.

Description
The #shard system variable determines which shard you are logged into.

#date

Name
#date — (readonly) Determines the local date on your computer.

Description
The #date system variable determines the local date on your computer.
The format is YYMMDD, where YY is the year, MM is the month and DD is the day.

Example
if #date = 24122003
{
event SysMessage Merry christmas!
pause
}

See Also
#sCnt, #sysTime, #sCnt2, #time

221
Miscellaneous System Variables

#time

Name
#time — (readonly) Determines the local time on your computer.

Description
The #time system variable determines the local time on your computer.
The format is HHMMSS, where HH is the hour in 24 hour format, MM is the minutes and SS is
the seconds.

Example
if #time = 120000
{
event SysMessage Time for lunch!
pause
}

See Also
#date, #sysTime, #sCnt, #sCnt2

#sysTime

Name
#sysTime — (readonly) Counts the number of milliseconds since 01/Jan/1980 UTC..

Description
(Added in 1.41) The #sysTime system variable counts the number of milliseconds since
01/Jan/1980 UTC (it is timezone independant). It can be useful for timing, time calculations, and is
not affected by overflow issues or speedhack tools.

222
Miscellaneous System Variables

See Also
#date, #time, #sCnt, #sCnt2

#sCnt

Name
#sCnt — (read/write) Timer in seconds since Windows boot.

Description
The #sCnt system variable is a timer in seconds since Windows boot.

Example
...
set %timeOut #sCnt + 10
waitForSomething:
...
if #scnt < %timeOut
goto waitForSomething
...

See Also
#date, #time, #sysTime, #sCnt2

#sCnt2

Name
#sCnt2 — (read/write) Timer in tenths of seconds since Windows boot.

223
Miscellaneous System Variables

Description
The #sCnt2 system variable is a timer in tenths of seconds since Windows boot.

See Also
#date, #time, #sysTime, #sCnt

#pixCol

Name
#pixCol — (readonly) Determines the color of the pixel last saved with savePix.

Description
The #pixCol system variable determines the color of the pixel last saved with the savePix
command.

See Also
cmpPix, savePix

#cursorX

Name
#cursorX — (readonly) Determines the x-coordinate of the cursor.

Description
The #cursorX system variable determines the x-coordinate of the cursor.

224
Miscellaneous System Variables

See Also
#cursorY

#cursorY

Name
#cursorY — (readonly) Determines the y-coordinate of the cursor.

Description
The #cursorY system variable determines the y-coordinate of the cursor.

See Also
#cursorX

#random

Name
#random — (readonly) Holds a random number.

Description
The #random system variable holds a random number.

Example
; make a random number between 0 and 99.
set %a #random % 100

225
Miscellaneous System Variables

#dispRes

Name
#dispRes — (readonly) Determines button clicked in last call to display.

Description
The #dispRes system variable determines button clicked in last call to display.

Table 1. #dispRep values.

Value Description
ok "Ok" was clicked.
cancel "Cancel" was clicked.
yes "Yes" was clicked.
no "No" was clicked.

See Also
display

#menuButton

Name
#menuButton — (read/write) Determines the name of the last menu button clicked.

Description
The #menuButton system variable determines the name of the last menu button clicked.

Note: You should set #menuButton to N/A when you have read which button was clicked, so
you can distinguish between two seperate clicks

226
Miscellaneous System Variables

See Also
menu Button, menu Get, menu GetNum

#menuRes

Name
#menuRes — (readonly) Determines the content of last menu Get or menu GetNum.

Description
The #menuRes system variable determines the content of last menu Get or menu GetNum.

See Also
menu Get, menu GetNum

#sendHeader

Name
#sendHeader — (read/write) Determines http header information for the send command.

Description
The system variable #sendHeader is a variable that lets you add additional header lines to the
post request sent by the send command. Each line must be finished with a $ to mark the end.

set #sendheader content-type: , #spc , blabla$line2: , #spc , blabla2$

If #sendheader doesn’t contain any $ signs at all then no additional lines will be added to the
header. Setting #sendheader to $$$ will obviously mess up the outgoing packet so that is not
recommended.

227
Miscellaneous System Variables

First let’s look at EUO default format for http requests:


; test1
send debugHTTPPost localhost /euo/action.php?getVar=getValue postVar=postValue
halt

Outgoing HTTP request:


POST /euo/action.php?getvar=getvalue HTTP/1.0 Host: localhost
Content-Length: 17 postVar=postValue

Supposing you want your HTTP request to be identifiied as issued by EasyUO by adding the
directive "User-Agent: EasyUO #cliVer" to the HTTP header:

; test2
set #sendHeader User-Agent: , #spc , EasyUO , #spc , #cliVer , $
send debugHTTPPost localhost /euo/action.php?getVar=getValue postVar=postValue
halt

Outgoing HTTP request:


POST /euo/action.php?getvar=getvalue HTTP/1.0 Host: localhost
Content-Length: 17 user-agent: easyuo 4.0.0e postVar=postValue

A few things are worth mentioning here:

• you cannot SET a value containing spaces to #sendHeader without ’escaping’ them using the
#spc constant.

• the value of #sendHeader is converted to lowercase when added to the HTTP header.
• it must be terminated by a single end-of-line symbol ’$’. Without this symbol, #sendHeader
value will be ignored and not added to the HTTP header.

Warning: Two consecutive ’$’ will break the header structure and are likely to cause
inpredictable results!

If you need to specify more than one http directive, you may use the following syntax:
set #sendHeader User-Agent: , #spc , EasyUO , #spc , #cliVer , $ ,
+ Content-type: , #spc , application/x-www-form-urlencoded$

or

228
Miscellaneous System Variables

set #sendHeader User-Agent: , #spc , EasyUO , #spc , #cliVer , $


set #sendHeader #sendHeader , Content-type: , #spc , application/x-www-form-urlencode

In order to reset #sendHeader, try any of these:


set #sendHeader N/A
set #sendHeader invalid content

Example
set #sendHeader Content-type: , #spc , application/x-www-form-urlencoded$

See Also
send

#strRes

Name
#strRes — (read/write) Determines the result of last str command.

Description
The #strRes system variable determines the result of last str command.

See Also
str

229
Miscellaneous System Variables

#property

Name
#property — (readonly) Determines the result of last event Property command.

Description
(Added in 1.39) The #property system variable determines the result of last event Property
command. Each property line is seperated by ’$’.

See Also
event Property

#result

Name
#result — (read/write) Determines the result of last return command.

Description
(Added in 1.40) The #result system variable determines the result of last return command.

See Also
return

230
Miscellaneous System Variables

#opts

Name
#opts — (readonly) Determines which EasyUO configuration options are active.

Description
(Added in 1.40) The #opt system variable determines which EasyUO configuration options are
active.

Table 1. #opts values.

Value Facing
SOT Stay on top
SYS event SysMessage
DMC Don’t Move Cursor
EXEC Allow Execute
SEND Allow Send

Example
if DMC notin #opts
{
display ok This script requires "Don’t move cursor" enabled!$
+Enable this option in the EasyUO Tools menu and restart the script.$
halt
}

#euoVer

Name
#euoVer — (readonly) Determines the current EasyUO version.

231
Miscellaneous System Variables

Description
(Added in 1.40) The #euoVer system variable determines the current EasyUO version. The format
is as follows: (MAJOR)_(MINOR)_(BUILD).

Example
;Checks to make sure the correct version of EUO is used for your script requirements.
;#euo = 1_40_88 ,which is version 1.40 (build 0058) 58 hex = 88 dec
set %euoBuildRequired $ , 58
set %euoVersionRequired 1_40
str Left #euoVer 4
set %_euover #strRes
str Right #euover 2
set %_euoBuild #strRes
if %_euoVer <> %euoVersionRequired || %_euoBuild < %euoBuildRequired
{
display ok This program requires EUO version 1.4 (build 0058) or higher in order$
+ to work. Download the latest version from www.easyuo.com.$
halt
}

#lpc

Name
#lpc — (read/write) Determines the current linesPerCycle setting.

Description
(Added in 1.41) The #lpc system variable determines the current linesPerCycle setting.

See Also
linesPerCycle

232
Miscellaneous System Variables

#tileType

Name
#tileType — (readonly) Determines the type for the currently read tile.

Description
(Added in 1.42, build 7F) The #tileType system variable determines the type for the currently
read tile. For more information, please see the command tile.

See Also
tile, #tileZ, #tileCnt

#tileZ

Name
#tileZ — (readonly) Determines the z-coordinate for the currently read tile.

Description
(Added in 1.42, build 7F) The #tileZ system variable determines the z-coordinate for the
currently read tile. For more information, please see the command tile.

See Also
tile, #tileType, #tileCnt

233
Miscellaneous System Variables

#tileCnt

Name
#tileCnt — (readonly) Determines the number of tiles in the currently read position.

Description
(Added in 1.42) The #tileCnt system variable determines the number of tiles in the currently
read position. For more information, please see the command tile.

See Also
tile, #tileType, #tileZ

#tileName

Name
#tileName — (readonly) Determines the name for the currently read tile.

Description
(Added in 1.42, build 80) The #tileCnt system variable determines the name for the currently
read tile. For more information, please see the command tile.

See Also
tile, #tileType, #tileZ

234
Miscellaneous System Variables

#tileFlags

Name
#tileFlags — (readonly) Determines the flags for the currently read tile.

Description
(Added in 1.42, build 80) The #tileFlags system variable determines the flags for the currently
read tile.

Table 1. #tileFlags values.

Value Description
Background
Weapon
Transparent
Translucent
Wall
Damaging
Impassable
Wet
Unknown
Surface
Bridge
GenericStackable
Window
NoShoot
PrefixA
PrefixAn
Internal
Foliage
PartialHue
Unknown1
Map
Container

235
Miscellaneous System Variables

Value Description
Wearable
LightSource
Animated
NoDiagonal
Unknown2
Armor
Roof
Door
StairBack
StairRight

See Also
tile, #tileType, #tileZ

236
XIX. Constants System Variables
#dot

Name
#dot — (readonly) A constant that represents a dot character.

Description
The constant #dot is used to assign or compare a variable or an expression with the dot character.

See Also
#smc, #spc

#false

Name
#false — (readonly) A constant that represents boolean false.

Description
The constant #false is used to assign or compare a variable or an expression with the boolean
false value.
Internally, #false is represented by the integer value 0.

Example
display yesno Do you have a pet?
if #dispRes = yes
{
set %petOwner #true
}
else
{
set %petOwner #false
}

239
Constants System Variables

See Also
#true

#smc

Name
#smc — (readonly) A constant that represents semi-colon character.

Description
The constant #smc is used to assign or compare a variable or an expression with the semi-colon
character.
This constant is needed since the semi-colon character ’;’ is used for inline comments.

Example
set %var #smc ; value of user variable is now the semi-colon character

See Also
#spc, #dot

#spc

Name
#spc — (readonly) A constant that represents space character.

240
Constants System Variables

Description
The constant #spc is used to assign or compare a variable or an expression with the space
character.

Example
set %message hello , #spc , world

See Also
#smc, #dot

#true

Name
#true — (readonly) A constant that represents boolean true.

Description
The constant #true is used to assign or compare a variable or an expression with the boolean true
value.
Internally, #true is represented by the integer value -1.

Example
display yesno Do you have a pet?
if #dispRes = yes
{
set %petOwner #true
}
else
{
set %petOwner #false
}

241
Constants System Variables

See Also
#false

242
Appendix A. Design Hotkey Manager
The design hotkey manager is a little tool in EasyUO that can help you assign often repeated code
to a hotkey.
The code is inserted at the bottom of the EasyUO window, and system variables enclosed in <>
will be replaced with their current value
Consider this extremely easy, rail maker:
move <#charPosX> <#charPosY>

243
Appendix A. Design Hotkey Manager

244
Appendix B. GNU Free Documentation License
Copyright (C) 2000,2001,2002 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document,
but changing it is not allowed.

PREAMBLE
The purpose of this License is to make a manual, textbook, or other functional and useful
document "free" in the sense of freedom: to assure everyone the effective freedom to copy and
redistribute it, with or without modifying it, either commercially or noncommercially. Secondarily,
this License preserves for the author and publisher a way to get credit for their work, while not
being considered responsible for modifications made by others.
This License is a kind of "copyleft", which means that derivative works of the document must
themselves be free in the same sense. It complements the GNU General Public License, which is a
copyleft license designed for free software.
We have designed this License in order to use it for manuals for free software, because free
software needs free documentation: a free program should come with manuals providing the same
freedoms that the software does. But this License is not limited to software manuals; it can be used
for any textual work, regardless of subject matter or whether it is published as a printed book. We
recommend this License principally for works whose purpose is instruction or reference.

APPLICABILITY AND DEFINITIONS


This License applies to any manual or other work, in any medium, that contains a notice placed by
the copyright holder saying it can be distributed under the terms of this License. Such a notice
grants a world-wide, royalty-free license, unlimited in duration, to use that work under the
conditions stated herein. The "Document", below, refers to any such manual or work. Any member
of the public is a licensee, and is addressed as "you". You accept the license if you copy, modify or
distribute the work in a way requiring permission under copyright law.
A "Modified Version" of the Document means any work containing the Document or a portion of
it, either copied verbatim, or with modifications and/or translated into another language.
A "Secondary Section" is a named appendix or a front-matter section of the Document that deals
exclusively with the relationship of the publishers or authors of the Document to the Document’s
overall subject (or to related matters) and contains nothing that could fall directly within that
overall subject. (Thus, if the Document is in part a textbook of mathematics, a Secondary Section
may not explain any mathematics.) The relationship could be a matter of historical connection with

245
Appendix B. GNU Free Documentation License

the subject or with related matters, or of legal, commercial, philosophical, ethical or political
position regarding them.
The "Invariant Sections" are certain Secondary Sections whose titles are designated, as being those
of Invariant Sections, in the notice that says that the Document is released under this License. If a
section does not fit the above definition of Secondary then it is not allowed to be designated as
Invariant. The Document may contain zero Invariant Sections. If the Document does not identify
any Invariant Sections then there are none.
The "Cover Texts" are certain short passages of text that are listed, as Front-Cover Texts or
Back-Cover Texts, in the notice that says that the Document is released under this License. A
Front-Cover Text may be at most 5 words, and a Back-Cover Text may be at most 25 words.
A "Transparent" copy of the Document means a machine-readable copy, represented in a format
whose specification is available to the general public, that is suitable for revising the document
straightforwardly with generic text editors or (for images composed of pixels) generic paint
programs or (for drawings) some widely available drawing editor, and that is suitable for input to
text formatters or for automatic translation to a variety of formats suitable for input to text
formatters. A copy made in an otherwise Transparent file format whose markup, or absence of
markup, has been arranged to thwart or discourage subsequent modification by readers is not
Transparent. An image format is not Transparent if used for any substantial amount of text. A copy
that is not "Transparent" is called "Opaque".
Examples of suitable formats for Transparent copies include plain ASCII without markup, Texinfo
input format, LaTeX input format, SGML or XML using a publicly available DTD, and
standard-conforming simple HTML, PostScript or PDF designed for human modification.
Examples of transparent image formats include PNG, XCF and JPG. Opaque formats include
proprietary formats that can be read and edited only by proprietary word processors, SGML or
XML for which the DTD and/or processing tools are not generally available, and the
machine-generated HTML, PostScript or PDF produced by some word processors for output
purposes only.
The "Title Page" means, for a printed book, the title page itself, plus such following pages as are
needed to hold, legibly, the material this License requires to appear in the title page. For works in
formats which do not have any title page as such, "Title Page" means the text near the most
prominent appearance of the work’s title, preceding the beginning of the body of the text.
A section "Entitled XYZ" means a named subunit of the Document whose title either is precisely
XYZ or contains XYZ in parentheses following text that translates XYZ in another language.
(Here XYZ stands for a specific section name mentioned below, such as "Acknowledgements",
"Dedications", "Endorsements", or "History".) To "Preserve the Title" of such a section when you
modify the Document means that it remains a section "Entitled XYZ" according to this definition.
The Document may include Warranty Disclaimers next to the notice which states that this License
applies to the Document. These Warranty Disclaimers are considered to be included by reference
in this License, but only as regards disclaiming warranties: any other implication that these

246
Appendix B. GNU Free Documentation License

Warranty Disclaimers may have is void and has no effect on the meaning of this License.

VERBATIM COPYING
You may copy and distribute the Document in any medium, either commercially or
noncommercially, provided that this License, the copyright notices, and the license notice saying
this License applies to the Document are reproduced in all copies, and that you add no other
conditions whatsoever to those of this License. You may not use technical measures to obstruct or
control the reading or further copying of the copies you make or distribute. However, you may
accept compensation in exchange for copies. If you distribute a large enough number of copies you
must also follow the conditions in section 3.
You may also lend copies, under the same conditions stated above, and you may publicly display
copies.

COPYING IN QUANTITY
If you publish printed copies (or copies in media that commonly have printed covers) of the
Document, numbering more than 100, and the Document’s license notice requires Cover Texts, you
must enclose the copies in covers that carry, clearly and legibly, all these Cover Texts: Front-Cover
Texts on the front cover, and Back-Cover Texts on the back cover. Both covers must also clearly
and legibly identify you as the publisher of these copies. The front cover must present the full title
with all words of the title equally prominent and visible. You may add other material on the covers
in addition. Copying with changes limited to the covers, as long as they preserve the title of the
Document and satisfy these conditions, can be treated as verbatim copying in other respects.
If the required texts for either cover are too voluminous to fit legibly, you should put the first ones
listed (as many as fit reasonably) on the actual cover, and continue the rest onto adjacent pages.
If you publish or distribute Opaque copies of the Document numbering more than 100, you must
either include a machine-readable Transparent copy along with each Opaque copy, or state in or
with each Opaque copy a computer-network location from which the general network-using public
has access to download using public-standard network protocols a complete Transparent copy of
the Document, free of added material. If you use the latter option, you must take reasonably
prudent steps, when you begin distribution of Opaque copies in quantity, to ensure that this
Transparent copy will remain thus accessible at the stated location until at least one year after the
last time you distribute an Opaque copy (directly or through your agents or retailers) of that edition
to the public.
It is requested, but not required, that you contact the authors of the Document well before
redistributing any large number of copies, to give them a chance to provide you with an updated
version of the Document.

247
Appendix B. GNU Free Documentation License

MODIFICATIONS
You may copy and distribute a Modified Version of the Document under the conditions of sections
2 and 3 above, provided that you release the Modified Version under precisely this License, with
the Modified Version filling the role of the Document, thus licensing distribution and modification
of the Modified Version to whoever possesses a copy of it. In addition, you must do these things in
the Modified Version:

A. Use in the Title Page (and on the covers, if any) a title distinct from that of the Document, and
from those of previous versions (which should, if there were any, be listed in the History
section of the Document). You may use the same title as a previous version if the original
publisher of that version gives permission.
B. List on the Title Page, as authors, one or more persons or entities responsible for authorship of
the modifications in the Modified Version, together with at least five of the principal authors
of the Document (all of its principal authors, if it has fewer than five), unless they release you
from this requirement.
C. State on the Title page the name of the publisher of the Modified Version, as the publisher.
D. Preserve all the copyright notices of the Document.
E. Add an appropriate copyright notice for your modifications adjacent to the other copyright
notices.
F. Include, immediately after the copyright notices, a license notice giving the public permission
to use the Modified Version under the terms of this License, in the form shown in the
Addendum below.
G. Preserve in that license notice the full lists of Invariant Sections and required Cover Texts
given in the Document’s license notice.
H. Include an unaltered copy of this License.
I. Preserve the section Entitled "History", Preserve its Title, and add to it an item stating at least
the title, year, new authors, and publisher of the Modified Version as given on the Title Page.
If there is no section Entitled "History" in the Document, create one stating the title, year,
authors, and publisher of the Document as given on its Title Page, then add an item describing
the Modified Version as stated in the previous sentence.
J. Preserve the network location, if any, given in the Document for public access to a
Transparent copy of the Document, and likewise the network locations given in the Document
for previous versions it was based on. These may be placed in the "History" section. You may
omit a network location for a work that was published at least four years before the Document
itself, or if the original publisher of the version it refers to gives permission.
K. For any section Entitled "Acknowledgements" or "Dedications", Preserve the Title of the
section, and preserve in the section all the substance and tone of each of the contributor

248
Appendix B. GNU Free Documentation License

acknowledgements and/or dedications given therein.


L. Preserve all the Invariant Sections of the Document, unaltered in their text and in their titles.
Section numbers or the equivalent are not considered part of the section titles.
M. Delete any section Entitled "Endorsements". Such a section may not be included in the
Modified Version.
N. Do not retitle any existing section to be Entitled "Endorsements" or to conflict in title with
any Invariant Section.
O. Preserve any Warranty Disclaimers.
If the Modified Version includes new front-matter sections or appendices that qualify as Secondary
Sections and contain no material copied from the Document, you may at your option designate
some or all of these sections as invariant. To do this, add their titles to the list of Invariant Sections
in the Modified Version’s license notice. These titles must be distinct from any other section titles.
You may add a section Entitled "Endorsements", provided it contains nothing but endorsements of
your Modified Version by various parties--for example, statements of peer review or that the text
has been approved by an organization as the authoritative definition of a standard.
You may add a passage of up to five words as a Front-Cover Text, and a passage of up to 25 words
as a Back-Cover Text, to the end of the list of Cover Texts in the Modified Version. Only one
passage of Front-Cover Text and one of Back-Cover Text may be added by (or through
arrangements made by) any one entity. If the Document already includes a cover text for the same
cover, previously added by you or by arrangement made by the same entity you are acting on
behalf of, you may not add another; but you may replace the old one, on explicit permission from
the previous publisher that added the old one.
The author(s) and publisher(s) of the Document do not by this License give permission to use their
names for publicity for or to assert or imply endorsement of any Modified Version.

COMBINING DOCUMENTS
You may combine the Document with other documents released under this License, under the
terms defined in section 4 above for modified versions, provided that you include in the
combination all of the Invariant Sections of all of the original documents, unmodified, and list
them all as Invariant Sections of your combined work in its license notice, and that you preserve all
their Warranty Disclaimers.
The combined work need only contain one copy of this License, and multiple identical Invariant
Sections may be replaced with a single copy. If there are multiple Invariant Sections with the same
name but different contents, make the title of each such section unique by adding at the end of it, in
parentheses, the name of the original author or publisher of that section if known, or else a unique

249
Appendix B. GNU Free Documentation License

number. Make the same adjustment to the section titles in the list of Invariant Sections in the
license notice of the combined work.
In the combination, you must combine any sections Entitled "History" in the various original
documents, forming one section Entitled "History"; likewise combine any sections Entitled
"Acknowledgements", and any sections Entitled "Dedications". You must delete all sections
Entitled "Endorsements".

COLLECTIONS OF DOCUMENTS
You may make a collection consisting of the Document and other documents released under this
License, and replace the individual copies of this License in the various documents with a single
copy that is included in the collection, provided that you follow the rules of this License for
verbatim copying of each of the documents in all other respects.
You may extract a single document from such a collection, and distribute it individually under this
License, provided you insert a copy of this License into the extracted document, and follow this
License in all other respects regarding verbatim copying of that document.

AGGREGATION WITH INDEPENDENT WORKS


A compilation of the Document or its derivatives with other separate and independent documents
or works, in or on a volume of a storage or distribution medium, is called an "aggregate" if the
copyright resulting from the compilation is not used to limit the legal rights of the compilation’s
users beyond what the individual works permit. When the Document is included in an aggregate,
this License does not apply to the other works in the aggregate which are not themselves derivative
works of the Document.
If the Cover Text requirement of section 3 is applicable to these copies of the Document, then if the
Document is less than one half of the entire aggregate, the Document’s Cover Texts may be placed
on covers that bracket the Document within the aggregate, or the electronic equivalent of covers if
the Document is in electronic form. Otherwise they must appear on printed covers that bracket the
whole aggregate.

TRANSLATION
Translation is considered a kind of modification, so you may distribute translations of the
Document under the terms of section 4. Replacing Invariant Sections with translations requires
special permission from their copyright holders, but you may include translations of some or all
Invariant Sections in addition to the original versions of these Invariant Sections. You may include
a translation of this License, and all the license notices in the Document, and any Warranty

250
Appendix B. GNU Free Documentation License

Disclaimers, provided that you also include the original English version of this License and the
original versions of those notices and disclaimers. In case of a disagreement between the translation
and the original version of this License or a notice or disclaimer, the original version will prevail.
If a section in the Document is Entitled "Acknowledgements", "Dedications", or "History", the
requirement (section 4) to Preserve its Title (section 1) will typically require changing the actual
title.

TERMINATION
You may not copy, modify, sublicense, or distribute the Document except as expressly provided for
under this License. Any other attempt to copy, modify, sublicense or distribute the Document is
void, and will automatically terminate your rights under this License. However, parties who have
received copies, or rights, from you under this License will not have their licenses terminated so
long as such parties remain in full compliance.

FUTURE REVISIONS OF THIS LICENSE


The Free Software Foundation may publish new, revised versions of the GNU Free Documentation
License from time to time. Such new versions will be similar in spirit to the present version, but
may differ in detail to address new problems or concerns. See http://www.gnu.org/copyleft/.
Each version of the License is given a distinguishing version number. If the Document specifies
that a particular numbered version of this License "or any later version" applies to it, you have the
option of following the terms and conditions either of that specified version or of any later version
that has been published (not as a draft) by the Free Software Foundation. If the Document does not
specify a version number of this License, you may choose any version ever published (not as a
draft) by the Free Software Foundation.

251
Appendix B. GNU Free Documentation License

252

You might also like