easyuo documentation - sourceforgecodename-alex.sourceforge.net/easyuo-docs/easyuo.pdf · the type...
TRANSCRIPT
EasyUO Documentation
EasyUO Documentation
Table of ContentsPreface..................................................................................................................................................................... i
Introduction..................................................................................................................................................... iRevision History............................................................................................................................................. iCredits............................................................................................................................................................ ii
1. Getting Started...................................................................................................................................................1
Introduction.....................................................................................................................................................1A simple tutorial.............................................................................................................................................1Installation......................................................................................................................................................2
2. Language Reference...........................................................................................................................................3
Variables.........................................................................................................................................................3Expressions.....................................................................................................................................................4Operators.........................................................................................................................................................4Control Structures...........................................................................................................................................7
I. Command Reference........................................................................................................................................10
I. Control-flow commands............................................................................................................................11II. Client commands......................................................................................................................................20III. Event commands.....................................................................................................................................35IV. Shop Commands.....................................................................................................................................48V. Menu Commands.....................................................................................................................................50VI. Namespace commands...........................................................................................................................61VII. Miscellaneous commands.....................................................................................................................63
II. System Variable Reference.............................................................................................................................71
VIII. Character Info System Variables..........................................................................................................72IX. Status Bar System Variables...................................................................................................................77X. Container Info System Variables.............................................................................................................85XI. Last Action System Variables.................................................................................................................90XII. FindItem System Variables.................................................................................................................100XIII. Shop Info System Variables...............................................................................................................107XIV. Extended Info System Variables........................................................................................................111XV. Client Info System Variables..............................................................................................................117XVI. Combat Info System Variables..........................................................................................................122XVII. Namespace System Variables...........................................................................................................127XVIII. Miscellaneous System Variables.....................................................................................................129XIX. Constants System Variables...............................................................................................................138
A. Design Hotkey Manager................................................................................................................................142
B. GNU Free Documentation License...............................................................................................................143
PREAMBLE...............................................................................................................................................143APPLICABILITY AND DEFINITIONS ...................................................................................................143VERBATIM COPYING.............................................................................................................................144COPYING IN QUANTITY........................................................................................................................144MODIFICATIONS.....................................................................................................................................145COMBINING DOCUMENTS...................................................................................................................146COLLECTIONS OF DOCUMENTS.........................................................................................................146AGGREGATION WITH INDEPENDENT WORKS................................................................................146TRANSLATION.........................................................................................................................................146TERMINATION .........................................................................................................................................147FUTURE REVISIONS OF THIS LICENSE.............................................................................................147
iii
Preface
IntroductionCopyright (C) 2003 Codename Alexandria Project. Permission is granted to copy, distribute and/or modify thisdocument under the terms of the GNU Free Documentation License, Version 1.2 or any later version publishedby the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. Acopy 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 aCommand Referenceand aSystem Variable Reference, but also contains aLanguage 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 andCheffe.
1.0.0 RC3 June 7th, 2003. More fixes from Spewy. AddedRoadkill’s findEnemyArray sub tothe#enemyID description.Explained the format of#time and#date .
1.0.0 June 9th, 2003. Addedstr and#strRes .
1.0.1 June 25th, 2003. AddedgetUOTitle andsound.
1.0.2 July 15th, 2003. Addedevent Propertyand#property .
1.0.3 July 17th, 2003. AddedCode Formatting Operators.Fixedevent Propertyand#property to include versionnumber.
1.0.4 July 24th, 2003. Addednamespace variableschapter, nameSpace, #nsName,#nsType and#dot . Updatedsound.
1.0.5 July 28th, 2003. Some typos were corrected. TheVariablessection was revisited.Description of#trueand#falsenowlists their numerical value.
i
Preface
Version Date Description
1.0.6 July 30th, 2003. Some system variables read andwrite state were corrected:#contPosX, #contPosYand#strRes. Default state fornameSpaceandlinesPerCyclecommads has been clarified.
CreditsThis documentation was written by ScriptFellow with the assistance of the.WZA. Parts were copied and inspiredby previous EasyUO manuals, like the online reference and the old PDF manual.
Examples created by ScriptFellow, the.WZA, Cheffe, and Roadkill.
Spewy and Cheffe helped fix typos, misconceptions, bugs, problems and the likes.
ii
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 UltimaOnline 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 theWhat 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 thelatest EasyUO update.
To get started, follow these simple guidelines:
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 scriptCopy and Paste, or type in the following program:
msg #smc Hello there!$halt
1
Chapter 1. Getting Started
Now press the Run icon or press F9 inside the EasyUO program. Your character will now whisper: "Hellothere!".
Something usefulNow we are going to try and do something more useful. We will move the character using themovecommand:
; calculate a new x coordinate based on our current positionset %newX #charPosX + 2; calculate a new y coordinate based on our current positionset %newY #charPosY + 2; move the character to the new positionmove %newX %newY 0 10shalt
Now we are going to open a pack using some of the event commands. First, we need to identify the ID of yourpack:
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:
; the id of your pack. change it to the value you wrote downset %pack XYZ; assign your pack’s ID to the last object id system variableset #lObjectID %pack; run UO’s client macro for "Use Last Object"event Macro 17halt
What’s next?With what you know now you should be able to understand most of the manual and also the various examplescripts available in the example archives. You can also find other examples on the easyuo.com(http://www.easyuo.com) website.
InstallationInstallation of EasyUO is extremely simple.
Download the zipped file from the EasyUO site (http://www.easyuo.com) and unzip it to whatever directory youprefer.
Then simply run the EasyUO.exe file.
REMEMBER! EasyUO only works with the 2D client.
2
Chapter 2. Language Reference
Variables
BasicsVariables in Easy UO come in four types; Standard, Namespace, Persistent and System. The type of a variable isdefined by its first character. Repectively Standard variables start with a percent sign, Namespace variables withan 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 orunderscore, followed by any number of letters, numbers, or underscores.
set %var Bobset %Var Joemsg %var %Var ; outputs "JOE JOE"
set %4bank not_yet ; invalid; starts with a numberset %_4bank not_yet ; valid; starts with an underscore
Standard VariablesStandard variables in EasyUO are represented by a percent sign (%) followed by the name of the variable. Thevariable name is case insensitive.
Namespace Variables and ScopeNamespace variables in EasyUO are represented by an exclamation mark (!) followed by the name of thevariable. Namespace variable name is case insensitive.
Namespace variables visibility is affected by thenameSpacecommand.
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 ofEasyUO(not yet available).
Persistent VariablesPersistent variables in EasyUO are represented by a asteriks sign (*) followed by a number between 1 and 1000(both inclusive).
Persistent variables are shared between all instances of EasyUO running on the computer. Persistent variables arestored in the registry under the keyHKEY_CURRENT_USER\Software\EasyUO.
System VariablesSystem variables in EasyUO are represented by an hash sign (#) followed by a descriptive text. System variablename is case insensitive.
System variables are all described in detail in theSystem Variable Reference.
Variable ScopeThe different variable types have different scope depending on different things. Here is an explaination of how itworks:
3
Chapter 2. Language Reference
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 thenameSpacecommand.A Local namespace is accessible to the current scriptrunning only. A Global namespace is accessible to allscripts running in the same EasyUO instance(not yetavailable). Namespace Variables are cleared whenEasyUO exits.
Persistent Scope is limited to all scripts running on the samecomputer. Persistent Variables are stored in theregistry and not cleared when EasyUO exits.
System Scope is typically defined by the current UltimaOnline instance for the current script running. SystemVariables are not saved by EasyUO upon exit.
ExpressionsExpressions are important building blocks in an EasyUO script. They can be used to create relatively advancedinteger mathematics.
An expression can be a simple constant value or it can be a more advanced mathematical expression.
set %var 2 + 2
Operators
Arithmetic OperatorsRemember 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 OperatorsComparison 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.
4
Chapter 2. Language Reference
Example Name Result
%a > %b Greater than #true if %a is greater than %b.
%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 orequal 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 invalidif ! ( %cnt > 0 || %cnt < 1 )
set %cnt 0set %cnt %cnt + 1
Code Formatting Operators
Table 2-4. Code Formatting Operators
Example Name Result
+ line concatenation (Must be used as the first operatoron a line, except white space)Concatenates the current line to theprevious line, so that EasyUO seesit as one long line.
display ok This+ is+ all+ on+ one+ line.$halt
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
5
Chapter 2. Language Reference
Example Name Result
, concatenation Returns a concatenation of the leftand the right arguments.
Array OperatorsThere is only one array operator in the EasyUO scripting language. The dot operator:
initEvents
set %a1 10set %a2 20set %a3 40
for %i 1 3{
; This sets the variable %a to the content of the %a[%i]set %a %a . %ievent SysMessage %a
}
Precedence and associativityIn an expression that contains multiple operators, EasyUO uses a number of rules to decide the order in whicheoperators are evaluated. The first and most important rule is called operator precedence. Operators in anexpression that higher precedence are executed before operators with lower precedence. For examplemultiplication has a higher precedence than addition. In the expression 2 + 3 * 4, the multiplication is donebefore the addition, producing a result of 14.
If consecutive operators in an expression have the same precedence, a rule called associativity is used to decidethe order in which those operators are evaluated. An operator can be left-associative, right-associative, ornon-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
6
Chapter 2. Language Reference
Precedence Operator Associativity
Notes:a. Note about the dot (array operator) and comma (concatenation) operators: These operators have thehighest precedence. They are special for they are evaluated before everything else (including commands). Thisproperty 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
set %r 1 + 2 * 2 * 4 ; 1 + ( ( 2 * 2 ) * 4 ) = 17
set %r ( 1 + 2 ) * 2 * 4 ; ( ( 1 + 2 ) * 2 ) * 4 = 24
set %a 3set %z3 8 ; z[a]set %w8 1337 ; w[z[a]]set %euo %w . %z . %adisplay ok %euohalt
Control Structures
ifThe if construct is one of the most important feature of many languages, the EasyUO scripting languageincluded. 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 thestatement will be executed.
The following code fragment will display ’a is bigger than b’ if %a is bigger than %b:
initEvents
set %a 1set %b 0if %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 towrap each statement in anif clause. Instead, you can group several statements into a statement group. Forexample, 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 10set %b 2if %a > %b{
event SysMessage a is bigger than bset %b %a
7
Chapter 2. Language Reference
}
if statements can be nested indefinitely within otherif statements, which provides you with complete flexibilityfor conditional execution of the various parts of your script.
elseOften you would want to execute a statement if a certain condition is met, and a different statement if thecondition is not met. This is what else is for. else extends anif statement to execute a statement in case theexpression in theif statement evaluates to#false . For example, the following code would display a is biggerthan b if %a is bigger than %b, and a is NOT bigger than b otherwise:
initEvents
set %a 10set %b 20if %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 .
forThefor 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 ordecrements, 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.
SubsThe term sub is short for subroutine. Subs are an important feature of the EasyUO script, that will make yourscripts more logically structured, easier to read, and will make you have to write less code.
A basic sub definition starts with asubstatement followed by the subs name (sub names are case insensitive), anumber of script lines and ends with areturn statement.
sub testSub...return
If parameters were added to the callinggosubcommand they will be present in the variables %1, %2, and so on.The variable %0 holds the number of paramrters 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 badprogramming style.
8
Chapter 2. Language Reference
Currently, inline comments don’t work with the sub command (this’ll get fixed in a future update).
gosubThegosubcommand 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. Thevariable %0 holds the number of parameters passed.
returnThereturn command transfers the execution back to where the sub was called usinggosub.
return
gotoThegotocommand moves the execution to another part of the script. The destination point is given by a label.
goto label_name
LabelsA label specifies a point in the code where you cangoto to.
label_name:
9
I. Command Reference
I. Control-flow commands
call
Namecall — Transfers execution to another script file
Synopsiscall {file} [parameter...]
DescriptionThecall command will transfer execution to another script. It will run the script until it meets theexit commandor the end of the file.
Note: Right now EasyUO doesn’t really support strings. Therefore, CALL won’t work if the path to a filecontains 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
Examplecall subs.txt recall %runebookid %runenumhalt
See Alsoexit
cmpPix
NamecmpPix — Compares a current pixel to a previously saved pixel.
Synopsis
cmpPix {number} [[[t] | [f]] | {[t] | [f]} {lines}]...
or
cmpPix {number} [[t] | [f]]{...}
12
Control-flow commands
DescriptionThecmpPix command compares the pixel given by {number} previously saved withsavePixcommand. If itevaluates 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 thestatement or statement block is executed.
f If pixel does not compare to the previously savedpixel 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 1comparePixelAgain:cmpPix 1 f 2key F4 Althaltgoto comparePixelAgain
See AlsosavePix, #pixCol
exit
Nameexit — Stops the execution of the current script
Synopsisexit
Descriptionexit will stop the execution of the current script. If it’s called from inside a script that was called usingcall it willresume execution from the line under the call statement. If theexit is used from the main script, the script willstart over.
13
Control-flow commands
Examplemsg %pet %command $if %pet = all
exitmsg %pet follow me $
See Alsocall
for
Namefor — Creates a counting loop
Synopsis
for {variable} {start} {end}{...
}
DescriptionThefor 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 ordecrements the variable, until it reaches the ending number.
Examplefor %i 1 20{
msg %i $wait 10
}
gosub
Namegosub — Transfers execution to the matching sub.
14
Control-flow commands
Synopsisgosub{sub name} [parameters...]
DescriptionThegosubcommand transfers execution to sub with the name given (Readabout subs). It will run the script untilit meets thereturn , then it returns to where it was called, and executes from the next line.
Examplegosub Minegosub RecallHomegosub GoInsidegusub Smeltgosub PutInChesthalt
See Alsoreturn, Subs
goto
Namegoto — Moves execution to another part of the script given by a label.
Synopsisgoto {label name}
DescriptionThegotocommand moves the execution to another part of the script. The destination point is given by a label.
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 badprogramming style.
Examplefindagain:; find an item by it’s typefinditem XML
; ignore it if it’s on the groundif #FINDKIND = 1
15
Control-flow commands
{ignoreitem #FINDIDgoto findagain
}
; if there’s no more, stop processingif #FINDKIND = -1
goto done
; do something to the item
goto findagain
done:halt
See AlsoControl Structures, Labels
halt
Namehalt — Ends the script.
Synopsishalt
DescriptionThehalt command ends the execution of the script. The script cannot be restarted. This command does exactlythe same asstop.
See AlsoControl Structures, stop
if
Nameif — Executes code based on the evaluation of an expression.
16
Control-flow commands
Synopsis
if {expression} [lines]...
or
if {expression}{...}
DescriptionThe if command executes a block of code, depending on the evaluation of an expression. If the expressionevaluates to true, the code-block is evaluated, if the expression evaluates to false, the code-block is not evaluated.
See AlsoExpressions, Control Structures
pause
Namepause — Temporarily stops the execution of the current script.
Synopsispause
DescriptionThepausecommand will stop the execution of the current script, but it can be resumed by pressing the "Play"button.
ExamplefindItem XMLif #findKind = -1{
event SysMessage You are out of XML’s. Please refill.pause
}
17
Control-flow commands
return
Namereturn — Returns from a sub.
Synopsisreturn
DescriptionThereturn command returns you from a sub to the line after thegosubthat called the sub.
Examplegosub testSomething; this line will be executed after return...halt
sub testSomething...return
See Alsogosub
stop
Namestop — Ends the script.
Synopsisstop
DescriptionThestopcommand ends the execution of the script. The script cannot be restarted. This command does exactlythe same ashalt.
18
Control-flow commands
See AlsoControl Structures, halt
19
II. Client commands
chooseSkill
NamechooseSkill — Reads the current skill value/lock status for a specific skill
SynopsischooseSkill{skill name} ["real"]
DescriptionThechooseSkillcommand 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 isplaced 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) andstealth (STLT).
ExamplechooseSkill mageif #skill < 700{
msg You don’t have enough magery $halt
}...
See Also#skill, #skillCap, #skillLock
click
Nameclick — Clicks at a specific position in the UO client.
Synopsis
click {X-coordinate} {Y-coordinate} [d | f | g | n | p | r | x] [num clicks (for x)]
DescriptionTheclick command mimics a click of the mouse in a specific position on the screen.
Table 1. click command options
21
Client commands
Option Description
d Double Click
f Fast Click
g Drag
n Nothing (Just moves the cursor)
p Drop
r Right Click
x Multiple Fast Clicks
Note: Using the drag and drop clicks is an obsolete way to move an object. event Drag supports dragging anobject by its ID instead. It is much more reliable.
Note: Using the "Don’t Move Cursor" option can make the double clicking fail randomly.
Example; close open crafting gumpclick 150 150 r
See Alsoevent Drag
contPos
NamecontPos — Moves the active topmost gump to a new position.
SynopsiscontPos{X-Coordinate} {Y-Coordinate}
DescriptionThecontPoscommand moves the currently active topmost gump to the coordinates specified.
Examplemsg bank $wait 20contpos 10 10halt
22
Client commands
See AlsonextCPos, #contPosX, #contPosY, #nextCPosX, #nextCPosY
deleteJournal
NamedeleteJournal — Forgets the contents of the journal buffer.
SynopsisdeleteJournal
DescriptionThedeleteJournalcommand forget" the contents of the journal from the last read line (inclusive) and everythingabove so that it cannot be found usingscanJournal.
Here is how the example works: Since it happens quite often that several entries get written into the journalbetween two checks you should scan more than just the first line of the journal. 10 lines is a very good value tomake sure you don’t miss any new journal text. You must usedeleteJournalto mark the text you have alreadyprocessed 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" online 3, says "Farewell" and forgets line 3 and everything above (because line 3 was the last line read byscanJournal). 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 aparameter ofdeleteJournal. To answer that question, imagine that the journal gets two new entries right whenscript execution is betweenscanJournalanddeleteJournal. So when the script recognizes the first "Hail" online 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 whydeleteJournaldetermines itself which line is to be ignored.
Examplefor %i 10 1{
scanJournal %iif hail in #journal{
msg Farewell$deleteJournal
}}
See AlsoscanJournal, #journal
23
Client commands
findItem
NamefindItem — Finds items, monsters, players, NPCs based on object ID or object type.
SynopsisfindItem {{id} | {type} | *} [index] [[G] | [G_{dist}] | [C] | [C_{container id}]]
DescriptionThefindItem command finds objects given by their ID (6-8 letters) or any object type (2-3 letters). If no index isgiven the first object found is returned in the#FIND* variables. If an index is given, the {index}’th object isreturned 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.
ExampleinitEvents
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 positionfindItem TSF G_2 ;if #findkind <> -1{
event Drag #findIDwait 20click 200 300 p
}
; find a stack of black perl in a specific bag and moves it; to a specific positionfindItem KUF C_ , %regbagif #findkind <> -1{
event Drag #findIDwait 20click 200 300 p
}
See AlsoignoreItem, #findID, #findType, #findX, #findY, #findZ, #findDist, #findKind, #findStack, #findBagID,#findRep, #findCol, #findCnt
24
Client commands
getUOTitle
NamegetUOTitle — Gets the text on the title bar of the client.
SynopsissetUOTitle {title}
Description(Added in 1.38)ThegetUOTitle command retrieves the title of the UO client. The title is returned in the systemvariable#strRes .
See AlsosetUOTitle, #strRes
hideItem
NamehideItem — Removes an items graphic from the client.
SynopsishideItem {id}
DescriptionThehideItem command removes a specific items graphic from the client. It can be used to unclutter things, itdoes NOTHING on the server.
ignoreItem
NameignoreItem — Removes items from the list searched by findItem.
25
Client commands
SynopsisignoreItem {{id} | {"reset"}} [list]
DescriptionThe ignoreItem command removes specific items from the list of items searched byfindItem . If the optionreset 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, isthe 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 tofindItem . If reset is given witha list number, only the specific list is cleared.
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 3smsg #SMC (Press play to continue)pause
set %npc1 #lTargetID
msg #SMC Use a dagger and target another NPC$wait 3smsg #SMC (Press play to continue)pause
set %npc2 #lTargetID
ignoreItem %npc1 1ignoreItem %npc2 2
; Nothing will be foundfindItem %npc1msg #SMC 1: #findID $findItem %npc2msg #SMC 2: #findID $
ignoreItem reset 1
; NPC 1 will be foundfindItem %npc1msg #SMC 1: #findID $findItem %npc2msg #SMC 2: #findID $
ignoteItem %npc1 1ignoreItem reset 2
; NPC 2 will be foundfindItem %npc1msg #SMC 1: #findID $findItem %npc2
26
Client commands
msg #SMC 2: #findID $halt
See AlsofindItem
key
Namekey — Sends a key-stroke to the client.
Synopsiskey {key-specifier} [[ alt ] | [ ctrl ] | [ shift ]]
DescriptionThekey 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, NUMLOCKor SCROLLLOCK.
Note: If you are running more than one client, the modifier key (alt, control, shift) can sometimes not work asits supposed to.
move
Namemove — Moves the character to a specified location.
Synopsismove{X-Coordinate} {Y-Coordinate} [tolerance] [timeout]
DescriptionThemovecommand moves the character to a specified position. No pathfinding is done, so you should probablyuseevent PathFind instead.
Note: Please note that if you are using UOAssist, you need to make sure these keys are not assigned toanything: Cursor Up, Cursor Down, Cursor Left, Cursor Right, Home, End, Page Up and Page Down.EasyUO uses these keys to move your character.
27
Client commands
See Alsoevent PathFind, #charPosX, #charPosY, #charPosZ
msg
Namemsg — Sends a string to the client as keystrokes.
Synopsismsg{message}
DescriptionThemsgcommand sends a series of key-strokes to the client. The ’$’ sign denotes carriage return.
ExampleinitEvents
; Locks Last Target Downmsg I wish to lock this down$target 5sevent Macro 22halt
nextCPos
NamenextCPos — Denotes where the next opened container/gump will open.
SynopsisnextCPos{X-coordinate} {Y-coordinate}
DescriptionThenextCPossets the position where the next container/gump will open at.
Note: The "Offset interface windows rather than perfectly stacking them" option, in Interface options (MouseIcon) must be turned on for this to work.
28
Client commands
ExamplenextCPos 10 10wait 20msg bank $halt
See AlsocontPos, #contPosX, #contPosY, #nextCPosX, #nextCPosY
onHotKey
NameonHotKey — Performs a line of code if a specific key is pressed.
SynopsisonHotKey {key-specifier] [[alt] | [ctrl] | [shift]]
DescriptionTheonHotKey command performs the following line of code (brackets does NOT work) when a certain key ispressed.
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, NUMLOCKor SCROLLLOCK.
Note: The code is only executed when the parser passes it, if you want a key-press to perform a certainaction you have to make a loop. See the example.
Examplekeyloop:
onHotKey F1gosub F1
onHotKey F2gosub F2
goto keyloop
sub F1msg #SMC You pressed F1.$return
sub F2msg #SMC You pressed F2.$return
29
Client commands
See Alsokey, gosub, goto
savePix
NamesavePix — Saves the color of a pixel in a specified location.
SynopsissavePix{X-coordinate] {Y-coordinate] [number]
DescriptionThesavePixcommand saves the pixel given by the coordinates, into the memory slot given by number. Thecolor is also saved to#pixCol .
See AlsocmpPix, #pixCol
setUOTitle
NamesetUOTitle — Sets the text on the title bar of the client.
SynopsissetUOTitle {title}
DescriptionThesetUOTitle 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.
See AlsogetUOTitle
30
Client commands
scanJournal
NamescanJournal — Scans the users journal and stores the string for examination.
SynopsisscanJournal{index}
DescriptionThescanJournalcommand scans the users journal and puts the matching string into the#journal systemvariable. 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.
ExamplewaitForAttack:scanjournal 1if is_attacking_you in #journal
msg guards $goto waitForAttack
See AlsodeleteJournal, #journal, #jColor
sleep
Namesleep — Waits a specified amount of time.
Synopsissleep{ms}
DescriptionThesleepcommand 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 .
31
Client commands
Example...; Wait for 5 milisecondssleep 5...
See Alsowait, event Sleep
target
Nametarget — Waits for a target cursor to appear.
Synopsistarget {timeout}
DescriptionThetarget command waits for a target cursor to appear. If no timeout is given, the default timeout is 2 seconds.
See Also#targCurs
terminate
Nameterminate — Terminates the current client.
Synopsisterminate [{"uo"} | {"euo"}]
DescriptionTheterminate command terminates the current client. The system variables#cliNr and#cliCnt are updatedaccordingly.
Table 1. terminate Options.
32
Client commands
Value Description
uo (default) Closes the current UO client
euo Closes the current EasyUO program.
See AlsouoXL, #cliNr, #cliCnt
uoXL
NameuoXL — Start/manage clients.
SynopsisuoXL {{"new"} | {"swap"}]
DescriptionTheuoXL command starts and swaps between open clients. The system variables#cliNr and#cliCnt areupdated accordingly.
Table 1. uoXL Options.
Value Description
new Starts a new client
swap Swaps to the next client
See Alsoterminate, #cliNr, #cliCnt
wait
Namewait — Waits a specified amount of time.
Synopsiswait {time} [random time]
33
Client commands
DescriptionThewait command waits for a specified amount of time. Time is either given in steps of 50 miliseconds or inseconds. The steps are given with just a number and seconds with an added s to the number.
Random time addes to the time waited, with a random time between 0 and the random time given.
Example; Wait for 5 secondswait 5s
; Wait for 1 secondwait 20
; Wait for 2 seconds with a random length of 1 secondwait 2s 1s
See Alsosleep, event Sleep
34
III. Event commands
event Drag
Nameevent Drag — Drags an object
Synopsis
event Drag {object id}
DescriptionTheevent Dragcommand drags an object given by its id.
ExampleinitEvents
event Drag %orewait 20click 100 100 phalt
See AlsoinitEvents, click
event Macro
Nameevent Macro — Performs a UO internal macro.
Synopsis
event Macro {param 1} [param 2] [param 3]
DescriptionTheevent Macrocommand performs a UO macro.
Table 1. event Macro options
Param 1 Param 2 Param 3 Description
1 0 ^ say
2 0 ^ emote
3 0 ^ whisper
36
Event commands
Param 1 Param 2 Param 3 Description
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
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
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
10 0 minimize Configuration
10 1 minimize Paperdoll
10 2 minimize Status
10 3 minimize Journal
10 4 minimize Skills
10 5 minimize Spellbook
10 6 minimize Chat
10 7 minimize Backpack
10 8 minimize Overview
10 9 minimize Mail
37
Event commands
Param 1 Param 2 Param 3 Description
10 10 minimize Party Manifest
10 11 minimize Party Chat
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
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 DetectingHidden
13 15 use skill Discordance
13 16 use skill EvaluatingIntelligence
13 19 use skill ForensicEvaluation
13 21 use skill Hiding
13 23 use skill Inscription
13 3 use skill ItemIdentification
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 TasteIdentification
13 38 use skill Tracking
14 0 last skill
15 0 cast spell Clumsy
15 1 cast spell Create Food
38
Event commands
Param 1 Param 2 Param 3 Description
15 2 cast spell Feeblemind
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
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 MagicReflection
15 36 cast spell Mind Blast
15 37 cast spell Paralyze
15 38 cast spell Poison Field
15 39 cast spell SummonCreature
15 40 cast spell Dispel Field
15 41 cast spell Energy Bolt
15 42 cast spell Explosion
15 43 cast spell Invisibility
15 44 cast spell Mark
39
Event commands
Param 1 Param 2 Param 3 Description
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
15 57 cast spell Energy Vortex
15 58 cast spell Resurrection
15 59 cast spell Air Elemental
15 60 cast spell SummonDaemon
15 61 cast spell Earth Elemental
15 62 cast spell Fire Elemental
15 63 cast spell Water Elemental
15 101 cast spell [N] AnimateDead
15 102 cast spell [N] Blood Oath
15 103 cast spell [N] Corpse Skin
15 104 cast spell [N] CurseWeapon
15 105 cast spell [N] Evil Omen
15 106 cast spell [N] HorrificBeast
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] PoisonStrike
15 111 cast spell [N] Strangle
15 112 cast spell [N] SummonFamiliar
15 113 cast spell [N] VampiricEmbrace
15 114 cast spell [N] VengefulSpirit
15 115 cast spell [N] Wither
15 116 cast spell [N] WraithForm
40
Event commands
Param 1 Param 2 Param 3 Description
15 201 cast spell [C] Cleanse byFire
15 202 cast spell [C] CloseWounds
15 203 cast spell [C] ConsecrateWeapon
15 204 cast spell [C] Dispel Evil
15 205 cast spell [C] Divine Fury
15 206 cast spell [C] Enemy ofOne
15 207 cast spell [C] Holy Light
15 208 cast spell [C] NobleSacrifice
15 209 cast spell [C] RemoveCurse
15 210 cast spell [C] SacredJourney
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
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 ^ 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 ^ set update range
38 ^ 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
41
Event commands
Param 1 Param 2 Param 3 Description
45 0 enable update range color
46 0 disable update range color
47 0 toggle update range color
ExampleinitEvents
set #lTargetX 1000set #lTargetY 1000set #lTargetKind 3
; uses a shovel and targets ground at 1000, 1000set #lObjectID %shovelevent Macro 17target 5sevent macro 22halt
See AlsoinitEvents,
event PathFind
Nameevent PathFind — Moves you to a specified position if it is possible.
Synopsis
event PathFind {X-Coordinate} {Y-Coordinate} [Z-Coordinate]
DescriptionTheevent PathFindmoves you to the position given by the coordinates. If the Z coordinate os omitted, it isassumed to be -1.
Note: Please note that your script will keep on executing while the character is moving. Take a look at theexample below which mimics the way that the move command works.
Example;===========================================================; Name: pathFind; Author: ScriptFellow (the.WZA); Parameters: %1 = X
42
Event commands
; %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 %1set %_y %2if %0 <= 2 || %2 = N/A
set %_z -1else
set %_z %3if %0 <= 3 || %3 = N/A
set %_tolerance 0else
set %_tolerance %4if %0 <= 4
set %_endTime #sCnt + 15else
set %_endTime #sCnt + %5set %return #falsedeleteJournalscanJournal 2event PathFind %_x %_y %_z
_pathFindScanAgain:scanJournal 1if pathfinding in #journal
goto _pathFindOkayif can’t_get_there in #journal || #sCnt > %_endTime
returngoto _pathFindScanAgain
_pathFindOkay:gosub _pathFindDist %_x %_y %_z #charPosX #charPosY #charPosZset %return %return <= %_toleranceif %return{
if %_tolerance > 0{
set %1 #cliLeft + #cliXRes / 2set %2 #cliTop + #cliYRes / 2if #charDir < 3
set %1 %1 + 1else{
if #charDir > 3 && #charDir < 7set %1 %1 - 1
}if #charDir = 0 || #charDir = 6
set %2 %2 - 1else{
if #charDir > 1 && #charDir < 5set %2 %2 + 1
}click %1 %2 R
}return
}if #sCnt > %_endTime
43
Event commands
returngoto _pathFindOkay
sub _pathFindDistset %1 %1 - %4 absset %2 %2 - %5 absset %3 %3 - %6 absgosub max %1 %2 %3
return
; to be definedsub max
set %return %1for %_idx 2 %0{
if % . %_idx > %returnset %return % . %_idx
}return
See AlsoinitEvents, move
event Property
Nameevent Property — Reads the property description of an item.
Synopsis
event Property {ID}
Description(Added in 1.39)Theevent Propertycommand reads the description and properies of an item and places theinformation in the system variable#property . Each line in the #property variable is seperated by ’$’.
See Also#property
44
Event commands
event SkillLock
Nameevent SkillLock — Changes the skill locks on the different skills.
Synopsis
event SkillLock {skill name} {up | down | locked}
DescriptionTheevent SkillLock command changes the skill lock on the specified skill to either: up, down or locked.
ExampleinitEvents; changes magery to downevent SkillLock mage down; locks armloreevent SkillLock armslore locked
See AlsoinitEvents, chooseSkill, #skillLock
event Sleep
Nameevent Sleep — Suspends the client for a specified time.
Synopsisevent Sleep{ms}
DescriptionTheevent Sleepcommand suspends the client for a specified number of miliseconds. The client will becompletely unresponsive, but will use 0% CPU time.
ExampleinitEvents
if %waitForVendorRespawn = #true{
; sleep for one minute
45
Event commands
event Sleep 60000}...
See Alsosleep, wait
event SysMessage
Nameevent SysMessage — Outputs text to the client as a system message.
Synopsis
event SysMessage{message}
DescriptionTheevent SysMesaagecommand 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.
ExampleinitEvents
event SysMessage Welcome to EasyUO!halt
See AlsoinitEvents
initEvents
NameinitEvents — Initializes all event commands.
46
Event commands
SynopsisinitEvents
DescriptionThe initEvents command initializes all event commands. If it is not run once per script, none of the eventcommands will function.
See Alsoevent Drag, event Macro, event PathFind, event SkillLock, event SysMessage
47
IV. Shop Commands
getShopInfo
NamegetShopInfo — Retrieves information from the client about the currently shown top entry on a shoppinggump.
SynopsisgetShopInfo
DescriptionThegetShopInfocommand retrives information about the currently shown top entry on an open gump.
Note: Every time you scroll to a new entry, you have to call getShopInfo to update the #SHOP*systemvariables.
See AlsosetShopItem, #shopCurPos, #shopCnt, #shopItemType, #shopItemID, #shopItemName, #shopItemPrice,#shopItemMax
setShopItem
NamesetShopItem — Sets the number of items to purchase given by ID.
SynopsissetShopItem{ID} {amount}
DescriptionThesetShopItemcommand sets the amount to purchase given by an items ID. The ID is usually gotten from thesystem variable#shopItemID .
See AlsogetShopInfo, #shopCurPos, #shopCnt, #shopItemType, #shopItemID, #shopItemName, #shopItemPrice,#shopItemMax
49
V. Menu Commands
menu Activate
Namemenu Activate — Activates a window element in the EasyUO menu window.
Synopsismenu Activate {name}
DescriptionThemenu Activatecommand activates the window element given by its name, in the EasyUO menu window.
See Alsomenu Button, 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 Get, menu GetNum, menu Hide, menu HideEUO,menu Show, menu Text, menu Window Color, menu Window Size, menu Window Title, #menuRes
menu Button
Namemenu Button — Creates a button at position x/y with specified size on the EasyUO menu window.
Synopsismenu Button {name} {x} {y} {width} {height} {text}
DescriptionThemenu Button command creates a button on the EasyUO menu window at the specified postion with thespecified size.
See Alsomenu Activate, 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 Get, menu GetNum, menu Hide, menu HideEUO,menu Show, menu Text, menu Window Color, menu Window Size, menu Window Title, #menuRes,#menuButton
51
Menu Commands
menu Clear
Namemenu Clear — Clears all window elements from the EasyUO menu window.
Synopsismenu Clear
DescriptionThemenu Clearcommand clears all window elements (i.e. text, button, edit) from the EasyUO menu window.
See Alsomenu Activate, menu Button, menu Delete, menu Edit, menu Font Align, menu Font BGColor, menu FontColor, menu Font Name, menu Font Size, menu Font Style, menu Get, menu GetNum, menu Hide, menuHideEUO, menu Show, menu Text, menu Window Color, menu Window Size, menu Window Title
menu Delete
Namemenu Delete — Deletes a window element from the EasyUO menu window.
Synopsismenu Delete{name}
DescriptionThemenu Deletecommand deletes a window element (i.e. text, button, edit) from the EasyUO window menu.
See Alsomenu Activate, menu Button, menu Clear, menu Edit, menu Font Align, menu Font BGColor, menu Font Color,menu Font Name, menu Font Size, menu Font Style, menu Get, menu GetNum, menu Hide, menu HideEUO,menu Show, menu Text, menu Window Color, menu Window Size, menu Window Title
52
Menu Commands
menu Edit
Namemenu Edit — Creates a edit field at position x/y with specified width in the EasyUO menu window.
Synopsismenu Edit {name} {x} {y} {width} {height} {text}
DescriptionThemenu Edit command creates an edit field at the specified postion and with the specified dimensions in theEasyUO window menu.
See Alsomenu Activate, menu Button, menu Clear, menu Delete, menu Font Align, menu Font BGColor, menu FontColor, menu Font Name, menu Font Size, menu Font Style, menu Get, menu GetNum, menu Hide, menuHideEUO, menu Show, menu Text, menu Window Color, menu Window Size, menu Window Title,#menuButton
menu Font Align
Namemenu Font Align — Changes the font alignment in the EasyUO menu window.
Synopsismenu Font Align {{left} | {center} | {right}}
DescriptionThemenu Font Align command sets the alignment of the font used in the EasyUO menu window.
See Alsomenu Activate, menu Button, menu Clear, menu Delete, menu Edit, menu Font BGColor, menu Font Color,menu Font Name, menu Font Size, menu Font Style, menu Get, menu GetNum, menu Hide, menu HideEUO,menu Show, menu Text, menu Window Color, menu Window Size, menu Window Title
53
Menu Commands
menu Font BGColor
Namemenu Font BGColor — Changes the font background color in the EasyUO menu window.
Synopsismenu Font BGColor {color-descriptor}
DescriptionThemenu Font BGColor command changes the background color of the font used in the EasyUO menuwindow.
color-descriptor can be a few different things: black, red, btnface or a hexadecial (i.e. $aabbcc).
See Alsomenu Activate, menu Button, menu Clear, menu Delete, menu Edit, menu Font Align, menu Font Color, menuFont Name, menu Font Size, menu Font Style, menu Get, menu GetNum, menu Hide, menu HideEUO, menuShow, menu Text, menu Window Color, menu Window Size, menu Window Title
menu Font Color
Namemenu Font Color — Changes the font color in the EasyUO menu window.
Synopsismenu Font Color {color-descriptor}
DescriptionThemenu 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 Alsomenu Activate, menu Button, menu Clear, menu Delete, menu Edit, menu Font Align, menu Font BGColor,menu Font Name, menu Font Size, menu Font Style, menu Get, menu GetNum, menu Hide, menu HideEUO,menu Show, menu Text, menu Window Color, menu Window Size, menu Window Title
54
Menu Commands
menu Font Name
Namemenu Font Name — Changes the font in the EasyUO menu window.
Synopsismenu Font Name{font-descriptor}
DescriptionThemenu Font Namecommand changes the font used in the EasyUO menu window.
See Alsomenu Activate, menu Button, menu Clear, menu Delete, menu Edit, menu Font Align, menu Font BGColor,menu Font Color, menu Font Size, menu Font Style, menu Get, menu GetNum, menu Hide, menu HideEUO,menu Show, menu Text, menu Window Color, menu Window Size, menu Window Title
menu Font Size
Namemenu Font Size — Changes the font size in the EasyUO menu window.
Synopsismenu Font Size{point-size}
DescriptionThemenu Font Sizecommand changes the font size used in the EasyUO menu window.
See Alsomenu Activate, menu Button, menu Clear, menu Delete, menu Edit, menu Font Align, menu Font BGColor,menu Font Color, menu Font Name, menu Font Style, menu Get, menu GetNum, menu Hide, menu HideEUO,menu Show, menu Text, menu Window Color, menu Window Size, menu Window Title
55
Menu Commands
menu Font Style
Namemenu Font Style — Changes the font style in the EasyUO menu window.
Synopsismenu Font Style{ "b" } | { "i" } | { "u" } | { "s" }
DescriptionThemenu Font Stylecommand 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 Alsomenu Activate, menu Button, menu Clear, menu Delete, menu Edit, menu Font Align, menu Font BGColor,menu Font Color, menu Font Name, menu Font Size, menu Get, menu GetNum, menu Hide, menu HideEUO,menu Show, menu Text, menu Window Color, menu Window Size, menu Window Title
menu Get
Namemenu Get — Returns the text in an edit field in the EasyUO menu window.
Synopsismenu Get{name}
DescriptionThemenu Getcommand returns the text in an edit field in the EasyUO menu window in the#menuRes systemvariable. If the window is closed "Closed" is returned.
See Alsomenu Activate, menu Button, 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 GetNum, menu Hide, menu
56
Menu Commands
HideEUO, menu Show, menu Text, menu Window Color, menu Window Size, menu Window Title, #menuRes
menu GetNum
Namemenu GetNum— Returns the number in an edit field in the EasyUO menu window.
Synopsismenu GetNum{name} {default}
DescriptionThemenu GetNumcommand 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.
See Alsomenu Activate, menu Button, 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 Get, menu Hide, menu HideEUO,menu Show, menu Text, menu Window Color, menu Window Size, menu Window Title, #menuRes
menu Hide
Namemenu Hide — Hides the EasyUO menu window.
Synopsismenu Hide
DescriptionThemenu Hidecommand hides the EasyUO menu window.
See Alsomenu Activate, menu Button, 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 Get, menu GetNum, menuHideEUO, menu Show, menu Text, menu Window Color, menu Window Size, menu Window Title
57
Menu Commands
menu HideEUO
Namemenu HideEUO— Hides the main EasyUO window.
Synopsismenu HideEUO
DescriptionThemenu HideEUOcommand hides the main EasyUO window.
See Alsomenu Activate, menu Button, 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 Get, menu GetNum, menu Hide,menu Show, menu Text, menu Window Color, menu Window Size, menu Window Title
menu Show
Namemenu Show— Shows the EasyUO menu window.
Synopsismenu Show{x} {y}
DescriptionThemenu Showcommand shows the main EasyUO window at the specified position.
See Alsomenu Activate, menu Button, 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 Get, menu GetNum, menu Hide,menu HideEUO, menu Text, menu Window Color, menu Window Size, menu Window Title
58
Menu Commands
menu Text
Namemenu Text — Creates a label at the specifed postion in the EasyUO menu window.
Synopsismenu Text {x} {y} {text}
DescriptionThemenu Textcommand creates a label at the specified position in the EasyUO menu window.
See Alsomenu Activate, menu Button, 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 Get, menu GetNum, menu Hide,menu HideEUO, menu Show, menu Window Color, menu Window Size, menu Window Title
menu Window Color
Namemenu Window Color — Changes the color of the EasyUO menu window.
Synopsismenu Window Color {color-descriptor}
DescriptionThemenu 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 Alsomenu Activate, menu Button, 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 Get, menu GetNum, menu Hide,menu HideEUO, menu Show, menu Text, menu Window Size, menu Window Title
59
Menu Commands
menu Window Size
Namemenu Window Size — Changes the size of the EasyUO menu window.
Synopsismenu Window Size{height} {width}
DescriptionThemenu Window Sizecommand changes the size of the EasyUO menu window.
See Alsomenu Activate, menu Button, 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 Get, menu GetNum, menu Hide,menu HideEUO, menu Show, menu Text, menu Window Color, menu Window Title
menu Window Title
Namemenu Window Title — Changes the title of the EasyUO menu window.
Synopsismenu Window Title {title}
DescriptionThemenu Window Title command changes the window title of the EasyUO menu window.
See Alsomenu Activate, menu Button, 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 Get, menu GetNum, menu Hide,menu HideEUO, menu Show, menu Text, menu Window Color, menu Window Size
60
VI. Namespace commands
nameSpace
NamenameSpace — Selects the current namespace.
SynopsisnameSpace{local | global | clearLocal | clearGlobal} {namespace}
Description(Added in 1.39)ThenameSpacecommand selects the current namespace forlocal variables.
The local namespace is defined as available from the current or called scripts. The global namespace is definedas available from all scripts running in the same instance of EasyUO.
The clearLocal and clearGlobal parameters clear the local and global namespace for a given namespace.
Note: Global namespace is not available in the current EasyUO, but will be available later.
The default namespace is local and named STD. This setting is restored when then script is stopped.
Examplenamespace local ns1set !test test1
namespace local ns2set !test test2
namespace local ns3set !test test3
namespace local ns1display ok !test
namespace local ns2display ok !test
namespace clearlocal ns2namespace local ns2display ok !test
namespace local ns3display ok !test
halt
See Also#nsType, #nsName, the Section calledNamespace Variables and Scopein Chapter 2
62
VII. Miscellaneous commands
deleteVar
NamedeleteVar — Sets a variable to empty content
SynopsisdeleteVar {variable name}
DescriptionThedeleteVarcommand deletes the content of a variable.
Note: The content can only be deleted if the variable has already been assigned to.
Example...; set %test to somethingset %test TEST
; note there is no % char in front.deleteVar test
; %test now holds nothing...
See Alsothe Section calledVariablesin Chapter 2, set
display
Namedisplay — Shows a message
Synopsis
display {ok | okcancel | yesno | yesnocancel} {message}
DescriptionThedisplay command displays a standard Windows messagebox with a set of buttons of your choice.
64
Miscellaneous commands
Exampledisplay yesno You have run out of ingots. Do you want to end the script?if #dispRes = yes
halt...
See Also#dispRes
execute
Nameexecute — Executes an external program.
Synopsis
execute {filename} [argument...]
DescriptionTheexecutecommand executes an external command with the argunments given.
Note: This command does NOT work unless you have enabled the "Allow Execute" configuration option.
Exampleexecute EasyUO.exe healthWatch.euo
execute cmd.exe /c echo >>rail.txt move #charPosX #charPosY 0
linesPerCycle
NamelinesPerCycle — Sets the execution speed.
SynopsislinesPerCycle{linespercycle}
65
Miscellaneous commands
DescriptionThe linespercyclecommand sets the number of lines that the EasyUO parser runs through for every cycle. Thedefault value is 10 and is reset when you stop a script.
playCD
NameplayCD — Starts playing an audio CD in a CD-Rom drive.
SynopsisplayCD {drive-spec}
DescriptionTheplayCD command plays an audio CD in the drive denoted by the drive-spec.
Example...if #hits < 30
playCD D:...
set
Nameset — sets a variable to a value (variable assignment).
Synopsis
set {%localVariable | *globalVariable | #systemVariable} [expression] [abs]
DescriptionThesetcommand, 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.
66
Miscellaneous commands
Exampleset %a 2set %b $a ; we can use hexadecimal tooset %c ( %a * %b ) + 1 ; %c is 21set %d %a * ( %b + 1 ) ; %d is 22set %e %a * %b + 1 ; %e is 21set %f ; set %f to a blank stringhalt
See AlsoExpressions
send
Namesend — Sends a HTTP request to a server and runs the code that is returned.
Synopsissend{{"HTTPPost[port]"} | {"DebugHTTPPost[port]"} {site} {path} {post data}
DescriptionThesendcommand 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.
Example;******************************; EUO Chat V1.0 by Cheffe;******************************;; Allow send must be enabled!!!
menu Clearmenu Window Size 245 120menu Window Title EUO Chat V1.0menu Show 200 200menu HideEUO
menu Text 1 20 20 Please enter your nickname:menu Font BGColor Whitemenu Edit 2 20 40 200menu Font BGColor BtnFacemenu Button 3 130 70 90 25 OK
set #menuButton 0N1:
67
Miscellaneous commands
if #menuButton = closedhalt
if #menuButton <> 3goto N1
menu Get 2set %nickname #menuRes
;******************************
menu Clearmenu Window Size 500 230menu Font BGColor Whitemenu Edit e1 20 180 360menu Font BGColor BtnFacemenu Button b1 400 180 80 25 Send!
set #menuButton 0N2:
N3:if #scnt2 > 30{
send HTTPPost www.easyuo.com /webscripts/euochat.pl Rset #scnt2 0
}
if #menuButton = CLOSEDhalt
if #menuButton <> b1goto N3set #menuButton 0
menu Get e1send HTTPPost www.easyuo.com /webscripts/euochat.pl S %nickname , : #menuResmenu Activate e1
goto N2
shutDown
NameshutDown — Shuts your computer down.
SynopsisshutDown ["force"]
68
Miscellaneous commands
DescriptionTheshutDowncommand shuts your computer down. The optionforce forces non-responsive application toshut down, as well.
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.
sound
Namesound — Plays a wave file or the SystemDefault beep.
Synopsissound[filename]
Description(Added in 1.38, updated with filename in 1.39)Thesoundcommand plays a wave file or the SystemDefault beep.
str
Namestr — performs a operation on a string.
Synopsisstr {"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)Thestr command performs a string operation on the string given and stores the result in#strRes .
Table 1. String Operations
69
Miscellaneous commands
Option Description
Len Stores the length of the string in the#strRes systemvariable.
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, inthe#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.
Exampleset %string HELLOstr Len %string ; #strRes = 5str Pos %string LL ; #strRes = 3str Left %string 4 ; #strRes = HELLstr Right %string 2 ; #strRes = LOstr Mid %string 2 3 ; #strRes = ELLstr Lower %string ; #strRes = hellostr Ins %string I 3 ; #strRes = HELILOstr Del %string 3 2 ; #strRes = HEO
See Also#strRes
70
II. System Variable Reference
VIII. Character Info System Variables
#charPosX
Name#charPosX — (readonly)Determines the characters world X-coordinate.
DescriptionThe#charPosX system variable determines the characters world X-coordinate. It is the same coordinate systemas used in UO Auto Map.
See Also#charPosY, #charPosZ
#charPosY
Name#charPosY — (readonly)Determines the characters world Y-coordinate.
DescriptionThe#charPosY system variable determines the characters world X-coordinate. It is the same coordinate systemas used in UO Auto Map.
See Also#charPosX, #charPosZ
#charPosZ
Name#charPosZ — (readonly)Determines the characters world Z-coordinate.
DescriptionThe#charPosZ system variable determines the characters world Z-coordinate (elevation).
73
Character Info System Variables
See Also#charPosX, #charPosY
#charDir
Name#charDir — (readonly)Determines the direction the character is facing.
DescriptionThe#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
Exampletop:if #CHARDIR = 0
msg : Looking North $wait 2sgoto top
#charStatus
Name#charStatus — (readonly)Determines different states that the character can be in.
DescriptionThe#charStatus system variable determintes a number of different states that the character can be in:
Table 1. #charStatus values.
74
Character Info System Variables
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...return
See Also#charGhost, #sex
#charID
Name#charID — (readonly)Determines the id of the character.
DescriptionThe#charID system variable determines the id of your character. This is a unique identifier, so it can be used toidentify different characters and make specific actions depending on what character it is.
Examplecall specific_char_variables.txtif #charID <> %charID{
event sysmessage You are using this script for the wrong character! Halting Script!halt
}
75
Character Info System Variables
#charGhost
Name#charGhost — (readonly)Determines if your character is dead.
DescriptionThe#charGhost system variable determines if your character is dead. If the character is dead it holds "YES", ifit is alive it holds "NO".
Example...if #charGhost = YES{
gosub logOuthalt
}...
See Also#charStatus
76
IX. Status Bar System Variables
#charName
Name#charName — (readonly)Determines the name of the character.
DescriptionThe#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" toopen it from your script.
Examplemsg My name is #CHARNAME $halt
#str
Name#str — (readonly)Determines the strength of the character.
DescriptionThe#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" toopen it from your script.
See Also#dex, #int, #maxStats, #hits, #maxHits, #stamina, #mana
#dex
Name#dex — (readonly)Determines the dexterity of the character.
78
Status Bar System Variables
DescriptionThe#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" toopen it from your script.
See Also#str, #int, #maxStats, #hits, #maxHits, #stamina, #mana
#int
Name#int — (readonly)Determines the inteligence of the character.
DescriptionThe#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" toopen it from your script.
See Also#str, #dex, #maxStats, #hits, #maxHits, #stamina, #mana
#sex
Name#sex — (readonly)Determines the sex of the character.
DescriptionThe#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" toopen it from your script.
79
Status Bar System Variables
Value Description
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.
DescriptionThe#ARsystem 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" toopen it from your script.
Examplemsg My armor value is #AR $halt
#maxHits
Name#maxHits — (readonly)Determines the maximum number of hitpoints of the character.
DescriptionThe#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" toopen it from your script.
80
Status Bar System Variables
See Also#str, #dex, #int, #maxStats, #hits, #stamina, #mana
#hits
Name#hits — (readonly)Determines the current number of hitpoints of the character.
DescriptionThe#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" toopen it from your script.
Example...if #hits < 30
goto recallHome...
See Also#str, #dex, #int, #maxStats, #maxHits, #stamina, #mana
#mana
Name#mana — (readonly)Determines the current mana pool for the character.
DescriptionThe#mana system variable determines the current 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" toopen it from your script.
81
Status Bar System Variables
Example...if #mana < 30
gosub meditate...
See Also#str, #dex, #int, #maxStats, #maxHits, #stamina, #hits
#stamina
Name#stamina — (readonly)Determines the current stamina level or the character.
DescriptionThe#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" toopen it from your script.
Example...if #stamina < 30
gosub drinkRefresh...
See Also#str, #dex, #int, #maxStats, #maxHits, #mana, #hits
#gold
Name#gold — (readonly)Determines the amount of gold on the character.
82
Status Bar System Variables
DescriptionThe#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" toopen it from your script.
Example...if #gold < 1000
gosub gotoBank...
#weight
Name#weight — (readonly)Determines the current weight of the character.
DescriptionThe#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" toopen it from your script.
Example...if #weight > 350
gosub gotoBank...
See Also#maxWeight
#maxWeight
Name#maxWeight — (readonly)Determines the maximum weight of the character.
83
Status Bar System Variables
DescriptionThe#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" toopen it from your script.
See Also#weight
#maxStats
Name#maxStats — (readonly)Determines the current maximum stats of the character.
DescriptionThe#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" toopen it from your script.
See Also#str, #dex, #int, #stamina, #maxHits, #mana, #hits
#followers
Name#followers — (readonly)Determines the current number of followers of the character.
DescriptionThe#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" toopen it from your script.
84
X. Container Info System Variables
#nextCPosX
Name#nextCPosX — (read/write)Determines the x-coordinate of where the next containter/gump will open.
DescriptionThe#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 (MouseIcon) must be turned on for this to work.
Example; Open bank box at 10,10set #nextCPosX 10set #nextCPosY 10msg bank$halt
See Also#nextCPosY, contPos, nextCPos
#nextCPosY
Name#nextCPosY — (read/write)Determines the y-coordinate of where the next containter/gump will open.
DescriptionThe#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 (MouseIcon) must be turned on for this to work.
Example; Open bank box at 10,10set #nextCPosX 10set #nextCPosY 10msg bank$halt
86
Container Info System Variables
See Also#nextCPosX, contPos, nextCPos
#contSize
Name#contSize — (readonly)Determines the size of the currently selected container/gump.
DescriptionThe#contSize system variable determines the size of the currently selected container/gump. The format is asfollows: "{Width}_{Height}".
See Also#contPosY, #contKind, #contID, #contType
#contPosX
Name#contPosX — (read/write)Determines the x-coordinate of the currently selected container/gump.
DescriptionThe#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.
87
Container Info System Variables
DescriptionThe#contPosY system variable determines the y-coordinate of the currently selected container/gump.
See Also#contSize, #contPosX, #contKind, #contID, #contType
#contKind
Name#contKind — (readonly)Determines the kind of the currently selected container/gump.
DescriptionThe#contKind system variable determines the kind of the currently selected container/gump. Most menus havea 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 standardsdictate that you use variables in top of your script for #contKind’s. This way they can easily be updated if theclient 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.
DescriptionThe#contID system variable determines the id of the currently selected container/gump.
88
Container Info System Variables
See Also#contSize, #contPosX, #contPosY, #contKind, #contType
#contType
Name#contType — (readonly)Determines the object type of the currently selected container/gump.
DescriptionThe#contType system variable determines the object type of the currently selected container/gump.
See Also#contSize, #contPosX, #contPosY, #contKind, #contID
89
XI. Last Action System Variables
#lObjectID
Name#lObjectID — (read/write)Determines the id of the last used object.
DescriptionThe#lObjectID system variable determines the id of the last used object. You can also write to this variableand use it in conjuction with "event Macro17" (LastObject), which will use the object as if it wasdouble-clicked with the mouse.
Exampleset #lObjectID %carpentryToolevent macro 17; crafting menu is now open...
See Alsoevent Macro
#lObjectType
Name#lObjectType — (readonly)Determines the type of the last used object.
DescriptionThe#lObjectType system variable determines the type of the last used object.
#lTargetID
Name#lTargetID — (read/write)Determines the id of the last target used.
DescriptionThe#lTargetID system variable determines the id of the last target used. You can also write to this variableand use it in conjuction with "event Macro22" (LastTarget), which will target the object as if it was clicked withthe mouse.
91
Last Action System Variables
Be aware:#lTargetKind must be set to 1 for event Macro 22 to use the target id.
Example; use the daggerset #lObjectID %daggerevent Macro 17
; wait for target cursortarget 5s
; carve the hides from the corpseset #lTargetID %cowCorpseset #lTargetKind 1 ; make sure it targets an objectevent Macro 22...
See Alsoevent Macro, #lTargetKind
#lTargetX
Name#lTargetX — (read/write)Determines the world x-coordinate of the last target used.
DescriptionThe#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 shovelset #lObjectID %shovelevent Macro 17
; wait for target cursortarget 5s
; mine a spotset #lTargetX 1000set #lTargetY 1000set #lTargetZ -1set #lTargetKind 3event Macro 22...
92
Last Action System Variables
See Alsoevent Macro, #lTargetKind, #lTargetY, #lTargetZ
#lTargetY
Name#lTargetY — (read/write)Determines the world y-coordinate of the last target used.
DescriptionThe#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 shovelset #lObjectID %shovelevent Macro 17
; wait for target cursortarget 5s
; mine a spotset #lTargetX 1000set #lTargetY 1000set #lTargetZ -1set #lTargetKind 3event Macro 22...
event Macro, #lTargetKind, #lTargetX, #lTargetZ
#lTargetZ
Name#lTargetZ — (read/write)Determines the world z-coordinate of the last target used.
DescriptionThe#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.
93
Last Action System Variables
Example; use the shovelset #lObjectID %shovelevent Macro 17
; wait for target cursortarget 5s
; mine a spotset #lTargetX 1000set #lTargetY 1000set #lTargetZ -1set #lTargetKind 3event Macro 22...
event Macro, #lTargetKind, #lTargetX, #lTargetY
#lTargetKind
Name#lTargetKind — (read/write)Determines the kind of what was last targeted.
DescriptionThe#lTargetKind system variable determines the kind of what was last targeted:
Table 1. #lTargetKind values.
Value Description
1 Object.
2 Ground/Mountains/Caves.
3 Resource/Tree.
Object Example; use the daggerset #lObjectID %daggerevent Macro 17
; wait for target cursortarget 5s
; carve the hides from the corpseset #lTargetID %cowCorpseset #lTargetKind 1 ; make sure it targets an objectevent Macro 22...
World Position Example; use the shovel
94
Last Action System Variables
set #lObjectID %shovelevent Macro 17
; wait for target cursortarget 5s
; mine a spotset #lTargetX 1000set #lTargetY 1000set #lTargetZ -1set #lTargetKind 3event Macro 22...
See Also#lTargetID, #lTargetX, #lTargetY, #lTargetZ
#lTargetTile
Name#lTargetTile — (read/write)Determines the tile last targeted.
DescriptionThe#lTargetTile system variable determines the tile last targeted. The number in this variable is determinedby the graphic of the tile.
#lLiftedID
Name#lLiftedID — (readonly)Determines the id of the object last dragged/lifted.
DescriptionThe#lLiftedID system variable determines the id of the object last dragged/lifted.
ExampleinitEvents
finditem JTLevent Drag #findIDwait 20msg The ID of the item you lifted is #lLiftedID $halt
95
Last Action System Variables
#lSkill
Name#lSkill — (read/write)Determines the skill last used.
DescriptionThe#lSkill system variable determines the skill last used. You can also write to this variable and use it inconjuction with "event Macro14" (LastSkill), which will perform the skill as if you clicked the blue diamond inthe 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
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 Alsoevent Macro
96
Last Action System Variables
#lSpell
Name#lSpell — (read/write)Determines the last spell cast.
DescriptionThe#lSpell system variable determines the last spell cast. You can also write to this variable and use it inconjuction with "event Macro16" (LastSpell), which will cast the spell.
Table 1. #lSpell values
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
97
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
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
98
Last Action System Variables
Spell Number Spell Name
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 Alsoevent Macro
99
XII. FindItem System Variables
#findID
Name#findID — (readonly)Determines the id of the object returned byfindItem .
DescriptionThe#findID system variable determines the id of the object returned byfindItem .
ExamplefindAgain:finditem POF
if #findkind = 1{
ignoreitem #findidgoto findAgain
}if findkind = -1
haltmsg #findid is the ID of the gold in my bag. I have exactly #findstack gold on me.$halt
See AlsofindItem, #findType, #findX, #findY, #findZ, #findDist, #findKind, #findStack, #findBagID, #findMod,#findRep, #findCol, #findCnt
#findType
Name#findType — (readonly)Determines the type of the object returned byfindItem .
DescriptionThe#findType system variable determines the type of the object returned byfindItem .
See AlsofindItem, #findID, #findX, #findY, #findZ, #findDist, #findKind, #findStack, #findBagID, #findMod, #findRep,#findCol, #findCnt
101
FindItem System Variables
#findX
Name#findX — (readonly)Determines the x-coordinate of the object returned byfindItem .
DescriptionThe#findX system variable determines the x-coordinate of the object returned byfindItem . If #findKind equals0, the coordinate is a screen coordinate, if #findKind equals 1, the coordinate is a world coordinate.
See AlsofindItem, #findID, #findType, #findY, #findZ, #findDist, #findKind, #findStack, #findBagID, #findMod,#findRep, #findCol, #findCnt
#findY
Name#findY — (readonly)Determines the y-coordinate of the object returned byfindItem .
DescriptionThe#findY system variable determines the x-coordinate of the object returned byfindItem . If #findKind equals0, the coordinate is a screen coordinate, if #findKind equals 1, the coordinate is a world coordinate.
See AlsofindItem, #findID, #findType, #findX, #findZ, #findDist, #findKind, #findStack, #findBagID, #findMod,#findRep, #findCol, #findCnt
#findZ
Name#findZ — (readonly)Determines the z-coordinate of the object returned byfindItem .
DescriptionThe#findZ system variable determines the x-coordinate of the object returned byfindItem . If #findKind equals0, the coordinate is not valid, if #findKind equals 1, the coordinate is a world coordinate.
102
FindItem System Variables
See AlsofindItem, #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 byfindItem .
DescriptionThe#findDist system variable determines the distance from the character to the object returned byfindItem .
See AlsofindItem, #findID, #findType, #findX, #findY, #findZ, #findKind, #findStack, #findBagID, #findMod, #findRep,#findCol, #findCnt
#findKind
Name#findKind — (readonly)Determines the kind of the object returned byfindItem .
DescriptionThe#findKind system variable determines the kind of the object returned byfindItem .
Table 1. #charDir values.
Value Description
-1 No objects found.
0 Object is in a container.
1 Object is on the ground.
See AlsofindItem, #findID, #findType, #findX, #findY, #findZ, #findDist, #findStack, #findBagID, #findMod, #findRep,#findCol, #findCnt
103
FindItem System Variables
#findStack
Name#findStack — (readonly)Determines the number of stacked items in the object returned byfindItem .
DescriptionThe#findStack system variable determines the number of stacked items in the object returned byfindItem .
See AlsofindItem, #findID, #findType, #findX, #findY, #findZ, #findDist, #findKind, #findBagID, #findMod, #findRep,#findCol, #findCnt
#findBagID
Name#findBagID — (readonly)Determines the bag the object returned byfindItem is contained in.
DescriptionThe#findBagID system variable determines the bag the object returned byfindItem is contained in.
See AlsofindItem, #findID, #findType, #findX, #findY, #findZ, #findDist, #findKind, #findStack, #findMod, #findRep,#findCol, #findCnt
#findMod
Name#findMod — (read/write)Determines displacement for#findX and#findY .
DescriptionThe#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.
104
FindItem System Variables
See AlsofindItem, #findID, #findType, #findX, #findY, #findZ, #findDist, #findKind, #findStack, #findBagID, #findRep,#findCol, #findCnt
#findRep
Name#findRep — (readonly)Determines the reputation of the object returned byfindItem .
DescriptionThe#findRep system variable determines the reputation of the object returned byfindItem :
Table 1. #findRep values.
Value Description
1 Innocent (Blue)
2 Friend (Green)
3 Grey (Grey - Animal)
4 Criminal (Grey)
5 Enemy (Orange)
6 Murderer (Red)
See AlsofindItem, #findID, #findType, #findX, #findY, #findZ, #findDist, #findKind, #findStack, #findBagID, #findMod,#findCol, #findCnt
#findCol
Name#findCol — (readonly)Determines the color of the object returned byfindItem .
DescriptionThe#findCol system variable determines the color of the object returned byfindItem .
See AlsofindItem, #findID, #findType, #findX, #findY, #findZ, #findDist, #findKind, #findStack, #findBagID, #findMod,#findCnt
105
FindItem System Variables
#findCnt
Name#findCnt — (readonly)Determines the number of objects that matches what was searched for with thefindItem command.
DescriptionThe#findCnt system variable determines the number of objects that matches what was searched for with thefindItem command.
See AlsofindItem, #findID, #findType, #findX, #findY, #findZ, #findDist, #findKind, #findStack, #findBagID, #findMod,#findCol
106
XIII. Shop Info System Variables
#shopCurPos
Name#shopCurPos — (readonly)Determines the current position on the shop menu
DescriptionThe#shopCurPos system variable determines the current position on the shop menu.
See AlsogetShopInfo, #shopCnt, #shopItemType, #shopItemID, #shopItemName, #shopItemPrice, #shopItemMax
#shopCnt
Name#shopCnt — (readonly)Determines the total number of lines on the shop menu.
DescriptionThe#shopCnt system variable determines the total number of lines on the shop menu.
See AlsogetShopInfo, #shopCurPos, #shopItemType, #shopItemID, #shopItemName, #shopItemPrice, #shopItemMax
#shopItemType
Name#shopItemType — (readonly)Determines the item type of the current line on the shop menu.
DescriptionThe#shopItemType
Note: To initialize this variable, you need to call getShopInfo.
108
Shop Info System Variables
See AlsogetShopInfo, #shopCurPos, #shopCnt, #shopItemID, #shopItemName, #shopItemPrice, #shopItemMax
#shopItemID
Name#shopItemID — (readonly)Determines the item ID of the current line on the shop menu.
DescriptionThe#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 AlsogetShopInfo, #shopCurPos, #shopCnt, #shopItemType, #shopItemName, #shopItemPrice, #shopItemMax
#shopItemName
Name#shopItemName — (readonly)Determines the name of the item the current line on the shop menu.
DescriptionThe#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 AlsogetShopInfo, #shopCurPos, #shopCnt, #shopItemType, #shopItemID, #shopItemPrice, #shopItemMax
109
Shop Info System Variables
#shopItemPrice
Name#shopItemPrice — (readonly)Determines the price of the current line in the shop menu.
DescriptionThe#shopItemPrice system variable determines the price of the current line in the shop menu.
Note: To initialize this variable, you need to call getShopInfo.
See AlsogetShopInfo, #shopCurPos, #shopCnt, #shopItemType, #shopItemID, #shopItemName, #shopItemMax
#shopItemMax
Name#shopItemMax — (readonly)Determines the number of items in the stack of the current line in the shopmenu.
DescriptionThe#shopItemMax system variable determines the number of items in the stack of the current line in the shopmenu.
Note: To initialize this variable, you need to call getShopInfo.
See AlsogetShopInfo, #shopCurPos, #shopCnt, #shopItemType, #shopItemID, #shopItemName, #shopItemPrice
110
XIV. Extended Info System Variables
#skill
Name#skill — (readonly)Determines the current skill level for a skill chosen withchooseSkillcommand.
DescriptionThe#skill system variable determines the current skill level for a skill chosen withchooseSkillcommand.
ExamplechooseSkill tamingif #skill < 1000
event SysMessage You need to tame bulls.if #skill >= 1000
event SysMessage You need to tame ridgebacks.
See AlsochooseSkill, event SkillLock, #skillLock
#skillCap
Name#skillCap — (readonly)Determines the current skill cap for a skill chosen withchooseSkillcommand.
DescriptionThe#skillCap system variable determines the current skill cap for a skill chosen withchooseSkillcommand.
See AlsochooseSkill, event SkillLock, #skillLock
#skillLock
Name#skillLock — (readonly)Determines the current lock status of the skill chosen withchooseSkillcommand.
112
Extended Info System Variables
DescriptionThe#skillLock system variable determines the current lock status of the skill chosen withchooseSkillcommand.
Table 1. #skillLock values.
Value Description
up Skill lock is pointing up.
down Skill lock is pointing down.
locked Skill lock is locked.
ExamplechooseSkill tamingif #skillLock = locked{
event SysMessage Your taming is locked. Cannot continue.halt
}
See AlsochooseSkill, event SkillLock, #skill
#journal
Name#journal — (readonly)Determines the journal line selected using thescanJournalcommand.
DescriptionThe#journal system variable determines the journal line selected using thescanJournalcommand.
Exampleloop:scanJournal 1if is_attacking_you in #journal{
msg Guards$call recallme
}delteJournalgoto loop
113
Extended Info System Variables
See AlsodeleteJournal, scanJournal, #jColor
#jColor
Name#jColor — (read/write)Determines the color of the text in the journal.
DescriptionThe#jColor system variable determines the color of the text in the journal.
See AlsodeleteJournal, scanJournal, #journal
#sysMsg
Name#sysMsg — (readonly)Determines the current system message.
DescriptionThe#sysMsg system variable determines the current system message.
See Also#sysMsgCol
#sysMsgCol
Name#sysMsgCol — (read/write)Determines the current system message color.
DescriptionThe#sysMsgCol system variable determines the current system message color.
114
Extended Info System Variables
Exampleset #sysmsgcol 1264halt
See Also#sysMsg
#targCurs
Name#targCurs — (read/write)Determines if cursor is a target cursor.
DescriptionThe#targCurs system variable determines if cursor is a target cursor. It can also be written to, to get a targetcursor.
Table 1. #targCurs values.
Value Description
0 Cursor is a normal cursor.
1 Cursor is a target cursor.
Exampleinitevents
event SysMessage Target something!
set #targCurs 1targLoopif #targCurs = 1
goto targLoop
event SysMessage The ID of the target is #lTargetIDhalt
See Alsotarget
115
Extended Info System Variables
#cursKind
Name#cursKind — (readonly)Determines the facet where the character is.
DescriptionThe#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
116
XV. Client Info System Variables
#cliVer
Name#cliVer — (readonly)Determines the version of the client.
DescriptionThe#cliVer system variable determines the version of the client.
Exampleif #cliVer <> 4.0.0e{
event SysMessage This script was developed for client 4.0.0e. Be aware of any changes.pause
}
#cliCnt
Name#cliCnt — (readonly)Determines the number of clients currently running.
DescriptionThe#cliCnt system variable determines the number of clients currently running.
See AlsouoXL, terminate, #cliNr
#cliNr
Name#cliNr — (readonly)Determines which client is currently active for EasyUO.
DescriptionThe#cliNr system variable determines which client is currently active for EasyUO.
118
Client Info System Variables
See AlsouoXL, terminate, #cliCnt
#cliXRes
Name#cliXRes — (read/write)Determines the width of the gameplay window.
DescriptionThe#cliXRes system variable determines the width of the gameplay window.
Example; Make the game play window smallset #cliXRes 100set #cliYRes 100halt
See Also#cliYRes, #cliLeft, #cliTop
#cliYRes
Name#cliYRes — (read/write)Determines the height of the gameplay window.
DescriptionThe#cliYRes system variable determines the height of the gameplay window.
Example; Make the game play window smallset #cliXRes 100set #cliYRes 100halt
119
Client Info System Variables
See Also#cliXRes, #cliLeft, #cliTop
#cliLeft
Name#cliLeft — (read/write)Determines the X coordinate of the left edge of the gameplay window.
DescriptionThe#cliLeft system variable determines the X coordinate of the left edge of the gameplay window.
Example; Move the gameplay window to the top/left cornerset #cliLeft 0set #cliTop 0halt
See Also#cliXRes, #cliYRes, #cliTop
#cliTop
Name#cliTop — (read/write)Determines the Y coordinate of the top edge of the gameplay window.
DescriptionThe#cliTop system variable determines the Y coordinate of the top edge of the gameplay window.
Example; Move the gameplay window to the top/left cornerset #cliLeft 0set #cliTop 0halt
120
Client Info System Variables
See Also#cliXRes, #cliYRes, #cliLeft
121
XVI. Combat Info System Variables
#lHandID
Name#lHandID — (read/write)Determines the ID of the item currently armed/to be armed in the left hand.
DescriptionThe#lHandID system variable determines the ID of the item currently armed/to be armed in the left hard.
ExampleinitEvents
set #lHandID %daggerevent Macro 24 1halt
See Alsoevent Macro, #rHandID
#rHandID
Name#rHandID — (read/write)Determines the ID of the item currently armed/to be armed in the right hand.
DescriptionThe#rHandID system variable determines the ID of the item currently armed/to be armed in the right hand.
ExampleinitEvents
set #rHandID %shieldevent Macro 24 2halt
See Alsoevent Macro, #lHandID
123
Combat Info System Variables
#enemyHits
Name#enemyHits — (readonly)Determines the percentage of hit points left on the current enemy.
DescriptionThe#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.
DescriptionThe#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 havemore than one enemy, the variable will switch around by random. Instead a solution like below can be used:
; constantsset %_NORTHWEST 0set %_NORTH 1set %_NORTHEAST 2set %_EAST 3set %_SOUTHEAST 4set %_SOUTH 5set %_SOUTHWEST 6set %_WEST 7set %_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
124
Combat Info System Variables
set %_objectTypes %1set %_idx 0
_findEnemyArray:set %_idx %_idx + 1findItem %_objectTypes %_idxif #findKind = 1{
set %enemyArray1 . %_idx #findIDset %enemyArray2 . %_idx #findTypeset %enemyArray3 . %_idx #findDistset %enemyArray4 . %_idx #findRepgosub findDirectionTo #findX #findYset %enemyArray5 . %_idx %thingsDirectiongoto _findEnemyArray
}set %enemyArray1 . %_idx 0 ;put a 0 after valid spotsset %enemyArray9 %_idx - 1 ;puts total found enemy position 9return
;===========================================================; 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 < #charPosYset %thingsDirection %_NORTHWEST
if %2 > #charPosYset %thingsDirection %_SOUTHWEST
if %2 = #charPosYset %thingsDirection %_WEST
}if %1 > #charPosX{
if %2 < #charPosYset %thingsDirection %_NORTHEAST
if %2 > #charPosYset %thingsDirection %_SOUTHEAST
if %2 = #charPosYset %thingsDirection %_EAST
}if %1 = #charPosX{
if %2 < #charPosYset %thingsDirection %_NORTH
if %2 > #charPosYset %thingsDirection %_SOUTH
if %2 = #charPosYset %thingsDirection %_SAMETILE
}return
125
Combat Info System Variables
See Also#enemyHits
126
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 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. Thisvariable is either LOCAL or GLOBAL.
See Also#nsName, nameSpace, Local Variables
Note: Global namespace is not available in the current EasyUO, but will be available later.
128
XVIII. Miscellaneous System Variables
#shard
Name#shard — (readonly)Determines which shard you are logged into.
DescriptionThe#shard system variable determines which shard you are logged into.
#date
Name#date — (readonly)Determines the local date on your computer.
DescriptionThe#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.
Exampleif #date = 24122003{
event SysMessage Merry christmas!pause
}
See Also#sCnt, #sCnt2, #time
#time
Name#time — (readonly)Determines the local time on your computer.
130
Miscellaneous System Variables
DescriptionThe#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.
Exampleif #time = 120000{
event SysMessage Time for lunch!pause
}
See Also#date, #sCnt, #sCnt2
#sCnt
Name#sCnt — (read/write)Timer in seconds since Windows boot.
DescriptionThe#sCnt system variable is a timer in seconds since Windows boot.
Example...set %timeOut #sCnt + 10waitForSomething:
...if #scnt < %timeOut
goto waitForSomething...
See Also#date, #time, #sCnt2
131
Miscellaneous System Variables
#sCnt2
Name#sCnt2 — (read/write)Timer in tenths of seconds since Windows boot.
DescriptionThe#sCnt2 system variable is a timer in tenths of seconds since Windows boot.
See Also#date, #time, #sCnt
#pixCol
Name#pixCol — (readonly)Determines the color of the pixel last saved withsavePix.
DescriptionThe#pixCol system variable determines the color of the pixel last saved with thesavePixcommand.
See AlsocmpPix, savePix
#cursorX
Name#cursorX — (readonly)Determines the x-coordinate of the cursor.
DescriptionThe#cursorX system variable determines the x-coordinate of the cursor.
See Also#cursorY
132
Miscellaneous System Variables
#cursorY
Name#cursorY — (readonly)Determines the y-coordinate of the cursor.
DescriptionThe#cursorY system variable determines the y-coordinate of the cursor.
See Also#cursorX
#random
Name#random — (readonly)Holds a random number.
DescriptionThe#random system variable holds a random number.
Example; make a random number between 0 and 99.set %a #random % 100
#dispRes
Name#dispRes — (readonly)Determines button clicked in last call todisplay.
DescriptionThe#dispRes system variable determines button clicked in last call todisplay.
133
Miscellaneous System Variables
Value Description
Table 1. #dispRep values.
Value Description
ok "Ok" was clicked.
cancel "Cancel" was clicked.
yes "Yes" was clicked.
no "No" was clicked.
Example
See Alsodisplay
#menuButton
Name#menuButton — (read/write)Determines the name of the last menu button clicked.
DescriptionThe#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 candistinguish between two seperate clicks
See Alsomenu Button, menu Get, menu GetNum
#menuRes
Name#menuRes — (readonly)Determines the content of lastmenu Getor menu GetNum.
134
Miscellaneous System Variables
DescriptionThe#menuRes system variable determines the content of lastmenu Getor menu GetNum.
See Alsomenu Get, menu GetNum
#sendHeader
Name#sendHeader — (read/write)Determines http header information for thesendcommand.
DescriptionThe system variable#sendHeader is a variable that lets you add additional header lines to the post request sentby thesendcommand. 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.
First let’s look at EUO default format for http requests:
; test1send debugHTTPPost localhost /euo/action.php?getVar=getValue postVar=postValuehalt
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:
; test2set #sendHeader User-Agent: , #spc , EasyUO , #spc , #cliVer , $send debugHTTPPost localhost /euo/action.php?getVar=getValue postVar=postValuehalt
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.
135
Miscellaneous System Variables
• it must be terminated by a single end-of-line symbol ’$’. Without this symbol, #sendHeader value will beignored 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
set #sendHeader User-Agent: , #spc , EasyUO , #spc , #cliVer , $set #sendHeader #sendHeader , Content-type: , #spc , application/x-www-form-urlencoded$
In order to reset #sendHeader, try any of these:
set #sendHeader N/Aset #sendHeader invalid content
Exampleset #sendHeader Content-type: , #spc , application/x-www-form-urlencoded$
See Alsosend
#strRes
Name#strRes — (read/write)Determines the result of laststr command.
DescriptionThe#strRes system variable determines the result of laststr command.
See Alsostr
136
Miscellaneous System Variables
#property
Name#property — (readonly)Determines the result of lastevent Propertycommand.
Description(Added in 1.39)The#property system variable determines the result of lastevent Propertycommand. Eachproperty line is seperated by ’$’.
See Alsoevent Property
137
XIX. Constants System Variables
#dot
Name#dot — (readonly)A constant that represents adot character.
DescriptionThe constant#dot is used to assign or compare a variable or an expression with thedot character.
See Also#smc, #spc
#false
Name#false — (readonly)A constant that represents booleanfalse.
DescriptionThe constant#false is used to assign or compare a variable or an expression with the booleanfalsevalue.
Internally,#false is represented by the integer value 0.
Exampledisplay yesno Do you have a pet?if #dispRes = yes{
set %petOwner #true}else{
set %petOwner #false}
See Also#true
139
Constants System Variables
#smc
Name#smc — (readonly)A constant that representssemi-coloncharacter.
DescriptionThe constant#smc is used to assign or compare a variable or an expression with thesemi-coloncharacter.
This constant is needed since the the semi-colon character ’;’ is used for inline comments.
Exampleset %var #smc ; value of user variable is now the semi-colon character
See Also#spc, #dot
#spc
Name#spc — (readonly)A constant that representsspacecharacter.
DescriptionThe constant#spc is used to assign or compare a variable or an expression with thespacecharacter.
Exampleset %message hello , #spc , world
See Also#smc, #dot
#true
Name#true — (readonly)A constant that represents booleantrue.
140
Constants System Variables
DescriptionThe constant#true is used to assign or compare a variable or an expression with the booleantruevalue.
Internally,#true is represented by the integer value -1.
Exampledisplay yesno Do you have a pet?if #dispRes = yes{
set %petOwner #true}else{
set %petOwner #false}
See Also#false
141
Appendix A. Design Hotkey ManagerThe 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 replacedwith their current value
Consider this extremely easy, rail maker:
move <#charPosX> <#charPosY>
142
Appendix B. GNU Free Documentation License
Copyright (C) 2000,2001,2002 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is notallowed.
PREAMBLEThe purpose of this License is to make a manual, textbook, or other functional and useful document "free" in thesense of freedom: to assure everyone the effective freedom to copy and redistribute it, with or without modifyingit, either commercially or noncommercially. Secondarily, this License preserves for the author and publisher away 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 freein the same sense. It complements the GNU General Public License, which is a copyleft license designed for freesoftware.
We have designed this License in order to use it for manuals for free software, because free software needs freedocumentation: 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 subjectmatter or whether it is published as a printed book. We recommend this License principally for works whosepurpose is instruction or reference.
APPLICABILITY AND DEFINITIONSThis License applies to any manual or other work, in any medium, that contains a notice placed by the copyrightholder 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". Youaccept 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, eithercopied 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 exclusivelywith the relationship of the publishers or authors of the Document to the Document’s overall subject (or torelated matters) and contains nothing that could fall directly within that overall subject. (Thus, if the Documentis in part a textbook of mathematics, a Secondary Section may not explain any mathematics.) The relationshipcould be a matter of historical connection with 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 InvariantSections, in the notice that says that the Document is released under this License. If a section does not fit theabove definition of Secondary then it is not allowed to be designated as Invariant. The Document may containzero 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, inthe notice that says that the Document is released under this License. A Front-Cover Text may be at most 5words, 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 whosespecification is available to the general public, that is suitable for revising the document straightforwardly withgeneric text editors or (for images composed of pixels) generic paint programs or (for drawings) some widelyavailable drawing editor, and that is suitable for input to text formatters or for automatic translation to a varietyof formats suitable for input to text formatters. A copy made in an otherwise Transparent file format whosemarkup, or absence of markup, has been arranged to thwart or discourage subsequent modification by readers is
143
Appendix B. GNU Free Documentation License
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, XCFand JPG. Opaque formats include proprietary formats that can be read and edited only by proprietary wordprocessors, SGML or XML for which the DTD and/or processing tools are not generally available, and themachine-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 anytitle page as such, "Title Page" means the text near the most prominent appearance of the work’s title, precedingthe beginning of the body of the text.
A section "Entitled XYZ" means a named subunit of the Document whose title either is precisely XYZ orcontains XYZ in parentheses following text that translates XYZ in another language. (Here XYZ stands for aspecific 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 asection "Entitled XYZ" according to this definition.
The Document may include Warranty Disclaimers next to the notice which states that this License applies to theDocument. These Warranty Disclaimers are considered to be included by reference in this License, but only asregards disclaiming warranties: any other implication that these Warranty Disclaimers may have is void and hasno effect on the meaning of this License.
VERBATIM COPYINGYou may copy and distribute the Document in any medium, either commercially or noncommercially, providedthat this License, the copyright notices, and the license notice saying this License applies to the Document arereproduced in all copies, and that you add no other conditions whatsoever to those of this License. You may notuse 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 ofcopies 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 QUANTITYIf 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 copiesin covers that carry, clearly and legibly, all these Cover Texts: Front-Cover Texts on the front cover, andBack-Cover Texts on the back cover. Both covers must also clearly and legibly identify you as the publisher ofthese 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 asthey preserve the title of the Document and satisfy these conditions, can be treated as verbatim copying in otherrespects.
If the required texts for either cover are too voluminous to fit legibly, you should put the first ones listed (as manyas 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 amachine-readable Transparent copy along with each Opaque copy, or state in or with each Opaque copy acomputer-network location from which the general network-using public has access to download usingpublic-standard network protocols a complete Transparent copy of the Document, free of added material. If youuse the latter option, you must take reasonably prudent steps, when you begin distribution of Opaque copies inquantity, to ensure that this Transparent copy will remain thus accessible at the stated location until at least one
144
Appendix B. GNU Free Documentation License
year after the last time you distribute an Opaque copy (directly or through your agents or retailers) of that editionto the public.
It is requested, but not required, that you contact the authors of the Document well before redistributing any largenumber of copies, to give them a chance to provide you with an updated version of the Document.
MODIFICATIONSYou may copy and distribute a Modified Version of the Document under the conditions of sections 2 and 3above, provided that you release the Modified Version under precisely this License, with the Modified Versionfilling the role of the Document, thus licensing distribution and modification of the Modified Version to whoeverpossesses 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 ofprevious versions (which should, if there were any, be listed in the History section of the Document). Youmay 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 themodifications 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 theModified 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 theDocument’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 asgiven 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 theDocument, 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 waspublished at least four years before the Document itself, or if the original publisher of the version it refers togives permission.
K. For any section Entitled "Acknowledgements" or "Dedications", Preserve the Title of the section, andpreserve in the section all the substance and tone of each of the contributor acknowledgements and/ordedications given therein.
L. Preserve all the Invariant Sections of the Document, unaltered in their text and in their titles. Sectionnumbers 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 InvariantSection.
O. Preserve any Warranty Disclaimers.
If the Modified Version includes new front-matter sections or appendices that qualify as Secondary Sections andcontain no material copied from the Document, you may at your option designate some or all of these sections asinvariant. 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.
145
Appendix B. GNU Free Documentation License
You may add a section Entitled "Endorsements", provided it contains nothing but endorsements of your ModifiedVersion by various parties--for example, statements of peer review or that the text has been approved by anorganization 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 aBack-Cover Text, to the end of the list of Cover Texts in the Modified Version. Only one passage of Front-CoverText and one of Back-Cover Text may be added by (or through arrangements made by) any one entity. If theDocument already includes a cover text for the same cover, previously added by you or by arrangement made bythe same entity you are acting on behalf of, you may not add another; but you may replace the old one, onexplicit 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 forpublicity for or to assert or imply endorsement of any Modified Version.
COMBINING DOCUMENTSYou may combine the Document with other documents released under this License, under the terms defined insection 4above for modified versions, provided that you include in the combination all of the Invariant Sectionsof all of the original documents, unmodified, and list them all as Invariant Sections of your combined work in itslicense 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 bereplaced 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 originalauthor or publisher of that section if known, or else a unique number. Make the same adjustment to the sectiontitles 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 anysections Entitled "Dedications". You must delete all sections Entitled "Endorsements".
COLLECTIONS OF DOCUMENTSYou may make a collection consisting of the Document and other documents released under this License, andreplace the individual copies of this License in the various documents with a single copy that is included in thecollection, provided that you follow the rules of this License for verbatim copying of each of the documents inall 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 otherrespects regarding verbatim copying of that document.
AGGREGATION WITH INDEPENDENT WORKSA compilation of the Document or its derivatives with other separate and independent documents or works, in oron a volume of a storage or distribution medium, is called an "aggregate" if the copyright resulting from thecompilation is not used to limit the legal rights of the compilation’s users beyond what the individual workspermit. When the Document is included in an aggregate, this License does not apply to the other works in theaggregate 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 isless than one half of the entire aggregate, the Document’s Cover Texts may be placed on covers that bracket theDocument 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.
146
Appendix B. GNU Free Documentation License
TRANSLATIONTranslation is considered a kind of modification, so you may distribute translations of the Document under theterms of section 4. Replacing Invariant Sections with translations requires special permission from theircopyright holders, but you may include translations of some or all Invariant Sections in addition to the originalversions of these Invariant Sections. You may include a translation of this License, and all the license notices inthe Document, and any Warranty Disclaimers, provided that you also include the original English version of thisLicense and the original versions of those notices and disclaimers. In case of a disagreement between thetranslation 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.
TERMINATIONYou may not copy, modify, sublicense, or distribute the Document except as expressly provided for under thisLicense. Any other attempt to copy, modify, sublicense or distribute the Document is void, and will automaticallyterminate your rights under this License. However, parties who have received copies, or rights, from you underthis License will not have their licenses terminated so long as such parties remain in full compliance.
FUTURE REVISIONS OF THIS LICENSEThe Free Software Foundation may publish new, revised versions of the GNU Free Documentation License fromtime to time. Such new versions will be similar in spirit to the present version, but may differ in detail to addressnew 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 particularnumbered version of this License "or any later version" applies to it, you have the option of following the termsand conditions either of that specified version or of any later version that has been published (not as a draft) bythe Free Software Foundation. If the Document does not specify a version number of this License, you maychoose any version ever published (not as a draft) by the Free Software Foundation.
147