# EasyUO Reforged v26.11.16: documentation for AI agents Pages based on the EasyUO wiki say so at their foot and are available under the GNU Free Documentation License 1.2 (https://ilpersi.github.io/EasyUOReforged/agent/euo-script/LICENSE-GFDL-1.2.txt). # EasyUO language rules What you need to know before writing or changing an EasyUO script (`.euo`): the rules scripts break most often, the patterns that work, and how to get the values only the game knows. EasyUO is a small language of its own. It looks like BASIC but its rules are different, and **it reports no errors**: a line it can't understand is skipped, and the script goes on. Follow these rules exactly. Generated from the documentation of EasyUO Reforged v26.11.16. Command names are in [commands.md](commands.md), `#variables` in [variables.md](variables.md), and the details of each in `reference/`. ## Common mistakes EasyUO reports no errors. A line it can't understand is skipped, and the script goes on. So a mistake shows up only as a script that does the wrong thing, or nothing. This page lists the rules behind most such scripts. In the examples, a comment that starts with `=>` shows what a variable holds when the script has stopped. These examples are run through the interpreter every time EasyUO Reforged is tested, so they show what really happens. ### The rules that matter most 1. **A name that doesn't exist gives no error.** A line that starts with a word that is not a [command](https://ilpersi.github.io/EasyUOReforged/commands/) is skipped, and a [`#variable`](https://ilpersi.github.io/EasyUOReforged/variables/) that doesn't exist reads `N/A`. Take every command and every `#variable` from the lists, never from memory or from another language. 2. **Every word needs spaces around it,** operators and parentheses included: `if ( %a > 1 )`, `set %a %b + 1`. `(%a > 1)` and `%b+1` are not understood. 3. **Only a few commands calculate:** `set`, `if`, `while`, `until`, `return` and `waitfor`. Every other command takes its words as they are: `wait %a + 1` waits `%a` ticks. Calculate with `set` first. 4. **True is `-1`, false is `0`.** Use [`#true`](https://ilpersi.github.io/EasyUOReforged/variables/true/) and [`#false`](https://ilpersi.github.io/EasyUOReforged/variables/false/). `if %flag` is true only when `%flag` holds `-1`: `if 1` and `if yes` are false. 5. **A value is one word.** `set %a hello world` stores `hello`. Write spaces as `_`, or glue words with a comma: `set %a hello , #spc , world`. 6. **A block's `{` is alone on the very next line** after its command, and `}` is alone on its line. Without a block, the command controls only the next line. 7. **End the script with [`halt`](https://ilpersi.github.io/EasyUOReforged/commands/halt/).** Reaching the last line starts the script again from the top, and [`exit`](https://ilpersi.github.io/EasyUOReforged/commands/exit/) in the main script does the same. Only `halt` and `stop` stop it. 8. **Put subs after the `halt`,** where the normal flow never reaches them. Leave a sub with `return`, never with `goto`. 9. **A time is in ticks of 50 ms:** `wait 20` is one second. Or write seconds with an `s`: `wait 5s`. Only [`sleep`](https://ilpersi.github.io/EasyUOReforged/commands/sleep/) counts in milliseconds. 10. **Game values are your own.** Item types (`POF`), IDs (`YKLMNOP`), gump names, journal texts and screen positions differ between shards, clients and characters. Don't take them from someone else's script without checking: [Finding IDs and types](https://ilpersi.github.io/EasyUOReforged/guides/finding-ids/) shows how to read yours. 11. **The client holds back speech that comes too fast.** Lines sent with [`msg`](https://ilpersi.github.io/EasyUOReforged/commands/msg/) or the speech macros past its spam limit arrive late, and so do their answers in the journal. Allow about a second for every 12 characters: see [the spam limit](https://ilpersi.github.io/EasyUOReforged/commands/msg/#the-spam-limit). Each rule in a script: ```euo set %a 1 nosuchcommand %a 2 ; rule 1: not a command, so the line is skipped set %v #nosuchvariable ; => %v = N/A set %b %a + 1 ; => %b = 2 set %c %a+1 ; => %c = %a+1 halt ; => %a = 1 ``` `%a+1` in the third `set` is one word (rule 2), so nothing is replaced and nothing is added. ```euo set %a 2 set %right no set %wrong no if ( %a > 1 ) set %right yes ; => %right = yes if (%a > 1) set %wrong yes ; => %wrong = no halt ``` ```euo set %a 5 gosub count %a + 1 ; rule 3: gosub doesn't calculate, it passes three words halt sub count set %words %0 ; => %words = 3 set %first %1 ; => %first = 5 return ``` ```euo set %x 0 if 1 set %x %x + 1 ; rule 4: skipped, 1 is not true if yes set %x %x + 1 ; skipped if #true set %x %x + 10 ; runs set %t 2 > 1 ; => %t = -1 set %f 2 < 1 ; => %f = 0 halt ; => %x = 10 ``` ```euo set %a hello world ; => %a = hello set %b hello_world ; => %b = hello_world set %c hello , #spc , world ; => %c = hello world halt ``` ```euo set %n 0 if 1 = 2 { set %n %n + 1 ; rule 6: skipped with its block } if 1 = 2 { set %n %n + 10 ; runs: the blank line was the one line the if controls } halt ; => %n = 10 ``` ```euo set %runs %runs + 1 if %runs < 3 exit ; rule 7: back to the first line, the variables keep their values halt ; => %runs = 3 ``` ### Which commands do what | | Commands | |---|---| | Calculate their parameters | `set` `if` `while` `until` `return` `waitfor` | | Take a `{ }` block, or else the next line | `if` `else` `for` `while` `sub` `onhotkey` `cmppix` | | Take a time in ticks, or in seconds with `s` | `wait` `waitfor` `findjournal` `target` `move` `path` | ### Lines - One command per line. The first word is the command, the rest are its parameters. - `;` starts a comment, anywhere on a line. For a `;` in a text use [`#smc`](https://ilpersi.github.io/EasyUOReforged/variables/smc/), for a `.` [`#dot`](https://ilpersi.github.io/EasyUOReforged/variables/dot/), for a space [`#spc`](https://ilpersi.github.io/EasyUOReforged/variables/spc/). - Case doesn't matter, for commands, variables, sub names and text comparisons. - A line starting with `+` continues the line before it. The pieces join **without** a space, so write `+ more` where you want one. - A label is a name followed by `:` on a line of its own (`mainloop:`). `goto mainloop` jumps to it. ```euo set %text abc +def halt ; => %text = abcdef ``` ### Variables - A variable that was never set reads `N/A`. - A variable is replaced by its value only when it is a word of its own. Glue it to other text with a comma. - `%0`, `%1`, `%2`, … are the parameters of the last `gosub` or `call`. They are ordinary variables shared by the whole script, so a sub that calls another sub loses its own. Copy them first. - Numbers are whole numbers. `$1A` is hexadecimal. Text counts as `0` in arithmetic. - `%a , %b` joins two values into one word. `%item . %i` builds a variable name: with `%i` holding `2` it reads `%item2`. That is how scripts make lists. ```euo set %a %never ; => %a = N/A set %count 3 set %text gold:%count ; => %text = gold:%count set %glued gold: , %count ; => %glued = gold:3 set %hex $1A + 0 ; => %hex = 26 set %sum abc + 5 ; => %sum = 5 set %item1 sword set %item2 shield set %i 2 set %name %item . %i ; => %name = shield halt ``` ```euo gosub outer A halt sub outer gosub inner B set %mine %1 ; => %mine = B return sub inner return ``` ### Conditions - `=` and `<>` compare as text, ignoring case, when either side is not a number. - `<` `>` `<=` `>=` are **always false** when either side is not a number, `N/A` included. - `in` and `notin` test whether the left text is inside the right one. - `&&` binds tighter than `||`. - `!` turns around only the value right after it. Write `if ! ( %a = 2 )` or `if %a <> 2`, never `if ! %a = 2`. - `/` drops the remainder, and dividing by 0 gives `0`. ```euo set %a hello set %r1 %a = HELLO ; => %r1 = -1 set %r2 %a > 33 ; => %r2 = 0 set %r3 %a < 33 ; => %r3 = 0 set %r4 ell in %a ; => %r4 = -1 set %r5 1 = 1 || 1 = 2 && 1 = 3 ; => %r5 = -1 set %b 1 set %r6 ! ( %b = 2 ) ; => %r6 = -1 set %r7 ! %b = 2 ; => %r7 = 0 set %r8 7 / 2 ; => %r8 = 3 set %r9 7 / 0 ; => %r9 = 0 set %r10 2 + 3 * 4 ; => %r10 = 14 halt ``` ### Loops and subs - [`for`](https://ilpersi.github.io/EasyUOReforged/commands/for/) counts **down** when its start is larger than its end. So `for %i 1 #FindCnt` runs twice, for 1 and for 0, when [`finditem`](https://ilpersi.github.io/EasyUOReforged/commands/finditem/) found nothing. Test `#FindCnt > 0` first. - A [`gosub`](https://ilpersi.github.io/EasyUOReforged/commands/gosub/) to a sub that doesn't exist does nothing, and so does a [`call`](https://ilpersi.github.io/EasyUOReforged/commands/call/) of a file that isn't found. - `return %x` puts `%x` in [`#Result`](https://ilpersi.github.io/EasyUOReforged/variables/result/). - Old scripts write `if %a > 1 2` to make the `if` control the next 2 lines. Read it that way when you meet it, and write blocks in new scripts. ```euo set %runs 0 for %i 1 0 set %runs %runs + 1 halt ; => %runs = 2 ``` ```euo gosub add 2 3 set %sum #Result ; => %sum = 5 set %after before gosub nosuchsub set %after after ; => %after = after halt sub add return %1 + %2 ``` ## Common patterns Most scripts are built from the same few moves. Each one here is a whole script you can run and change. The item types (`ZLF`, `POF`), IDs and journal texts in them are only examples: yours are different, and [Finding IDs and types](https://ilpersi.github.io/EasyUOReforged/guides/finding-ids/) shows how to read them. ### How a script sees and acts - **Objects have an ID and a type.** An ID (6 to 8 letters, `YKLMNOP`) is one object. A type (2 or 3 letters, `POF`) is a kind of object. Both are text, never numbers. - **[`finditem`](https://ilpersi.github.io/EasyUOReforged/commands/finditem/) is how a script sees objects.** It fills the `#Find…` variables. When nothing matched, `#FindCnt` is `0` and `#FindID` reads `X`: always test `#FindCnt`. - **[`event macro`](https://ilpersi.github.io/EasyUOReforged/commands/event/macro/) runs the client's own macros:** speech, skills, spells, gumps, last object, last target. Look the numbers up on its page. - **Commands that act on the client need one.** Without a client they do nothing, and the variables that describe it read `N/A`. ### Report what the script is doing [`log`](https://ilpersi.github.io/EasyUOReforged/commands/log/) writes a line to the editor's Output panel and the script goes on. It needs no client and the lines stay, so it is the way to follow a script while it runs. It is new in EasyUO Reforged. [`event sysmessage`](https://ilpersi.github.io/EasyUOReforged/commands/event/sysmessage/) shows a line in the game window instead. [`display`](https://ilpersi.github.io/EasyUOReforged/commands/display/) opens a message box and the script waits until you close it: use it for a final result or a question, not inside a loop. ```euo log Counting the gold... finditem POF C_ , #BackpackID log finditem found #FindCnt stacks display ok Stacks of gold in the backpack: #FindCnt halt ``` ### Find an item and use it Using an object is two lines: put its ID in [`#LObjectID`](https://ilpersi.github.io/EasyUOReforged/variables/lobjectid/) and run the client's *Last Object* macro. ```euo finditem ZLF C_ , #BackpackID ; bandages, in the backpack if #FindCnt = 0 { event sysmessage No bandages left halt } set #LObjectID #FindID event macro 17 0 ; use it target 3s if #TargCurs = 1 event macro 23 0 ; target yourself halt ``` ### Go through every match Set [`#FindIndex`](https://ilpersi.github.io/EasyUOReforged/variables/findindex/) to look at the matches one after the other. Test `#FindCnt` first: `for` counts down when its end is smaller than its start, so with no match it would run for 1 and for 0. ```euo finditem POF G_3 ; gold on the ground, within 3 tiles if #FindCnt > 0 { for #FindIndex 1 #FindCnt { exevent drag #FindID #FindStack wait 10 exevent dropc #BackpackID wait 10 } } halt ``` ### Target something Wait for the target cursor with [`target`](https://ilpersi.github.io/EasyUOReforged/commands/target/), check that it came, say what to target and run the *Last Target* macro. Set [`#LTargetKind`](https://ilpersi.github.io/EasyUOReforged/variables/ltargetkind/) every time. ```euo set %bandages ABCDEFG ; the ID of your bandages set %pet HIJKLMN ; the ID of your pet set #LObjectID %bandages event macro 17 0 ; use the bandages target 3s if #TargCurs = 1 { set #LTargetID %pet set #LTargetKind 1 ; 1: an object event macro 22 0 ; target it } halt ``` ### Move items [`moveitem`](https://ilpersi.github.io/EasyUOReforged/commands/moveitem/) moves an item into a container in one line: it picks it up, drops it, waits, tries again when that is safe, and says in [`#MoveRes`](https://ilpersi.github.io/EasyUOReforged/variables/moveres/) whether it arrived (`ok`). Without an amount it moves the whole stack. `moveitem` is new in EasyUO Reforged. A container outside your backpack must have been opened, or the result is `left` even when the move worked. ```euo set %bag ABCDEFG ; the ID of a bag in your backpack finditem POF C_ , #BackpackID if #FindCnt > 0 { moveitem #FindID %bag if #MoveRes <> ok event sysmessage The gold did not arrive: #MoveRes } halt ``` In EasyUO 1.5, [`exevent drag`](https://ilpersi.github.io/EasyUOReforged/commands/exevent/drag/) picks an item up and [`exevent dropc`](https://ilpersi.github.io/EasyUOReforged/commands/exevent/dropc/) drops it into a container, with no check. The amount is `1` unless you give one, so pass `#FindStack` to move a whole stack. Don't mix `event drag` with the `exevent drop…` commands. ```euo set %bag ABCDEFG ; the ID of the bag to fill; it has to be open finditem POF C_ , #BackpackID if #FindCnt > 0 { exevent drag #FindID #FindStack wait 10 exevent dropc %bag wait 10 } halt ``` ### Wait for the client instead of guessing After an action, the client needs time. [`waitfor`](https://ilpersi.github.io/EasyUOReforged/commands/waitfor/) waits until a condition is true or a timeout passes, and [`#WaitRes`](https://ilpersi.github.io/EasyUOReforged/variables/waitres/) says which happened. It is new in EasyUO Reforged: the original EasyUO needs a loop with `wait`. ```euo event macro 8 7 ; open the backpack waitfor #ContName = container_gump 3s if #WaitRes = #false display ok The backpack did not open. halt ``` ### Wait for a journal line Save [`#JIndex`](https://ilpersi.github.io/EasyUOReforged/variables/jindex/) before you act, then let [`findjournal`](https://ilpersi.github.io/EasyUOReforged/commands/findjournal/) look through everything that came in after it. The journal writes spaces as `_`. `findjournal` is new in EasyUO Reforged too. ```euo set %j #JIndex ; where the journal is now event macro 15 28 ; cast Greater Heal findjournal %j * 3s fizzles you_must_wait if #JFound = 0 event sysmessage No answer in 3 seconds if fizzles in #Journal event sysmessage Fizzled halt ``` ### Answer a gump the server sent A gump the server sends (a menu, a confirmation) is recognised by its type ID, which is the same every time it opens: read it once with [`scangumps`](https://ilpersi.github.io/EasyUOReforged/commands/scangumps/) ([Finding IDs](https://ilpersi.github.io/EasyUOReforged/guides/finding-ids/) has a probe). In EasyUO Reforged, [`exevent GumpReply`](https://ilpersi.github.io/EasyUOReforged/commands/exevent/gumpreply/) presses one of its buttons without a click, with the checkboxes and text fields it needs, and closes the window. Wait for the gump with `scangumps T_`, and read [`#GumpReplyRes`](https://ilpersi.github.io/EasyUOReforged/variables/gumpreplyres/) afterwards: `nogump` means it was not open, and nothing was sent. The button numbers come from the shard, not from the client. ```euo set %confirm JHEIIPI ; the gump's #GumpTypeID on your shard set %t #SCnt + 5 repeat scangumps T_ , %confirm wait 2 until #GumpCnt > 0 || #SCnt > %t exevent GumpReply %confirm 1 ; button 1: OKAY if #GumpReplyRes <> sent event sysmessage The confirmation did not open. halt ``` ### Walk somewhere [`path go`](https://ilpersi.github.io/EasyUOReforged/commands/path/go/) plans a route around walls and water and walks it. Always read [`#PathState`](https://ilpersi.github.io/EasyUOReforged/variables/pathstate/) afterwards. In the original EasyUO, [`move`](https://ilpersi.github.io/EasyUOReforged/commands/move/) walks in a straight line and [`event pathfind`](https://ilpersi.github.io/EasyUOReforged/commands/event/pathfind/) lets the client find a short way. ```euo path go 1434 1699 if #PathState <> arrived display ok Did not get there: #PathState halt ``` ### Work on a text [`str`](https://ilpersi.github.io/EasyUOReforged/commands/str/) puts its result in [`#StrRes`](https://ilpersi.github.io/EasyUOReforged/variables/strres/), and the next `str` replaces it: copy the result first. ```euo set %list iron_gold_agapite str count %list _ set %fields #StrRes + 1 ; => %fields = 3 str part %list _ 2 set %second #StrRes ; => %second = gold str len %second set %length #StrRes ; => %length = 4 halt ``` ### Ask with a window [`menu`](https://ilpersi.github.io/EasyUOReforged/commands/menu/) builds a window of your own. A click on a button puts its name in [`#MenuButton`](https://ilpersi.github.io/EasyUOReforged/variables/menubutton/), so set that to something else before you wait for it. There are two `menu` systems, EasyUO 1.5's and 1.6's, and a script runs under one of them: read [MENU: EasyUO 1.5 and 1.6](https://ilpersi.github.io/EasyUOReforged/commands/menu/versions/) before you write or change `menu` lines, and don't mix their sub-commands. ```euo menu Clear menu Window Size 160 45 menu Button ok 10 10 60 25 OK menu Show set #MenuButton N/A while #MenuButton = N/A wait 1 if #MenuButton = closed display ok You closed the window. else display ok You clicked #MenuButton halt ``` ### Run until you stop it A script that keeps working is a label, the work, a wait and a `goto` back. Keep the work in subs, after the loop. ```euo set %rounds 0 mainloop: gosub oneRound wait 1s goto mainloop sub oneRound set %rounds %rounds + 1 event sysmessage Round %rounds return ``` ### Keep data between runs A `*` variable keeps its value when the script and EasyUO Reforged are closed. For more than a few values, [`sql`](https://ilpersi.github.io/EasyUOReforged/commands/sql/) keeps them in a database file. [SQL or * variables?](https://ilpersi.github.io/EasyUOReforged/guides/sql-or-persistent-variables/) compares the two. ```euo if *runs = N/A set *runs 0 set *runs *runs + 1 display ok This script has run *runs times. halt ``` ## Finding IDs and types A script needs values that only your game knows: the ID of your bag, the type of the item you look for, the name of the gump it waits for, the text your shard writes in the journal. They differ between shards, clients and characters, so a value copied from someone else's script may be wrong for you, and a value somebody guessed always is. Read them from your own game. - An **ID** (6 to 8 letters, `YKLMNOP`) is one object: this bag, this horse. - A **type** (2 or 3 letters, `POF`) is a kind of object: any pile of gold. In a script, put such values in `set` lines at the top, with a comment, so they are easy to find and change: ```euo set %lootbag ABCDEFG ; the ID of your loot bag set %goldtype POF ; the type of gold on your shard finditem %goldtype C_ , %lootbag display ok Stacks of gold in the bag: #FindCnt halt ``` ### With the variable inspector The variable inspector on the right of the editor shows the `#variables` of the client while you play. | Do this in the game | Then read | |---|---| | Double-click an item | [`#LObjectID`](https://ilpersi.github.io/EasyUOReforged/variables/lobjectid/) and [`#LObjectType`](https://ilpersi.github.io/EasyUOReforged/variables/lobjecttype/) | | Target something | [`#LTargetID`](https://ilpersi.github.io/EasyUOReforged/variables/ltargetid/), or [`#LTargetX`](https://ilpersi.github.io/EasyUOReforged/variables/ltargetx/) and [`#LTargetY`](https://ilpersi.github.io/EasyUOReforged/variables/ltargety/) for a place | | Open a container or a gump | [`#ContID`](https://ilpersi.github.io/EasyUOReforged/variables/contid/), [`#ContName`](https://ilpersi.github.io/EasyUOReforged/variables/contname/), [`#ContKind`](https://ilpersi.github.io/EasyUOReforged/variables/contkind/), [`#ContSize`](https://ilpersi.github.io/EasyUOReforged/variables/contsize/) | | Stand somewhere | [`#CharPosX`](https://ilpersi.github.io/EasyUOReforged/variables/charposx/) and [`#CharPosY`](https://ilpersi.github.io/EasyUOReforged/variables/charposy/) | Your own character and backpack need no looking up: they are [`#CharID`](https://ilpersi.github.io/EasyUOReforged/variables/charid/) and [`#BackpackID`](https://ilpersi.github.io/EasyUOReforged/variables/backpackid/). ### With a probe script A probe is a short script that shows a value and stops. This one asks you to click an object and shows its ID and type. Ctrl+C copies the text of the box. ```euo event sysmessage Click the object. set #TargCurs 1 while #TargCurs = 1 wait 1 finditem #LTargetID display ok ID: #FindID $Type: #FindType $Stack: #FindStack halt ``` This one shows the gump on top, for a script that waits for a gump or clicks in one: ```euo display ok Name: #ContName $Kind: #ContKind $Size: #ContSize $Position: #ContPosX #ContPosY halt ``` A gump the server sends (a menu, a confirmation, a quest window) is told apart by its type ID, which is the same every time the server opens that gump, unlike `#ContKind`, which changes with each client update. Open the gump, then run this probe. In EasyUO Reforged [`scangumps`](https://ilpersi.github.io/EasyUOReforged/commands/scangumps/) lists every open window, and the server's have the name `generic_gump`: ```euo scangumps for #GumpIndex 1 #GumpCnt if #GumpName = generic_gump display ok Type ID: #GumpTypeID $Position: #GumpPosX #GumpPosY $Size: #GumpSizeX #GumpSizeY halt ``` A script then finds that gump with `scangumps T_` followed by the type ID: `#GumpCnt` is `0` until it is open. To answer it, a script needs the button number, and the IDs of its checkboxes and text fields. Click the button once yourself, then read [`#GumpReply`](https://ilpersi.github.io/EasyUOReforged/variables/gumpreply/): it holds what the click sent, in the words [`exevent GumpReply`](https://ilpersi.github.io/EasyUOReforged/commands/exevent/gumpreply/) takes. Run this probe first, then click: ```euo set %n #GumpReplyCnt event sysmessage Now click the button in the gump. set %t #SCnt + 60 repeat wait 5 until #GumpReplyCnt <> %n || #SCnt > %t display ok exevent GumpReply #GumpReply halt ``` And this one shows the newest line of the journal as a script sees it, with `_` for spaces, and its colour: ```euo scanjournal 1 display ok Text: #Journal $Colour: #JColor halt ``` # Commands Every script command of EasyUO Reforged v26.11.16, generated from its documentation. One line each: the syntax, what it does, and flags. - `{x}` is a parameter you fill in, `[x]` is optional, `a|b` is a choice. - `[client]` works only with a UO client attached; without one the line does nothing. - `[new]` was added by EasyUO Reforged: the original EasyUO 1.5 ignores the line. On a form listed under a command, such as `str replace`, only that form is new: EasyUO 1.5 has the command. - `[changed]` behaves differently from EasyUO 1.5: read its "Reforged notes". - `[menu 1.5 only]` / `[menu 1.6 only]` exists in only one of the two MENU logics (see `reference/commands/menu/versions.md`). The details of a command are in `reference/commands/.md`, with spaces in the name as folders: `finditem` is `reference/commands/finditem.md`, `event macro` is `reference/commands/event/macro.md`. Read that file before you use a command for the first time. A word that is not in this list is not a command: the interpreter ignores the line without an error. ## Client - `chooseskill {skill} [real]`: Selects the skill that #Skill, #SkillCap and #SkillLock report. [client] - `click {x} {y} [option...]`: Clicks the mouse at a position in the client window. [client] - `cmppix {slot} [t|f] [lines]`: Runs a line or block depending on whether a saved pixel still has the same colour. [client] - `contpos {x} {y}`: Moves the top gump to a position on the screen. [client] - `deletejournal`: Hides the journal lines read so far from later scanjournal calls. [client] - `finditem {type|id}[_{type|id}...] [index] [G|G_{range}|C|C_{container}|A|CA_{container}]`: Finds items and characters by type or ID and fills the #Find… variables with the first match. [client] [changed] - `findjournal {since} {color} {timeout} {text} [text...]`: Searches the journal lines since a bookmark for a colour and any of several texts, waiting up to a timeout. [client] [new] - `getshopinfo`: Reads the entry shown at the top of the shop gump into the #Shop… variables. [client] - `getuotitle`: Puts the title of the client window in #StrRes. [client] - `hideitem {id}`: Hides an item from your screen; nothing changes on the server. [client] - `ignorecont {gump name|gump kind|reset}`: Makes the #Cont… variables skip a gump, by name or kind; reset empties the list. [client] - `ignoreitem {id|type}[_{id|type}...] [list]` / `ignoreitem reset [list]`: Makes FindItem skip items by ID or type; the same call again un-ignores them. [client] - `key {key} [ctrl] [alt] [shift]`: Presses a key in the client, optionally with Ctrl, Alt or Shift. [client] - `move {x} {y} [tolerance] [timeout]`: Walks the character towards a position with the arrow keys; no pathfinding. [client] - `moveitem {id} {destination} [amount] [x y]`: Moves an item, or part of a stack, into a container and reports in #MoveRes whether it arrived. [client] [new] - `msg {text}`: Types text into the client as if on the keyboard; $ presses Enter. [client] - `nextcpos {x} {y}`: Sets where the next container will open. [client] - `onhotkey {key} [ctrl] [alt] [shift]`: Runs a line or block only if a key is held down at that moment. - `savepix {x} {y} {slot} [colour]`: Reads the colour of a pixel into #PixCol and a numbered slot for cmppix. [client] - `scanbuffs [iconID]`: Reads the client's buff bar into the #Buff… variables, optionally only one buff icon. [client] [new] - `scangumps [T_typeIDs] [A_artIDs]`: Lists every gump window open in the client, front to back, into the #Gump… variables. [client] [new] - `scanjournal [line]`: Reads one journal line into #Journal and #JColor. [client] - `setshopitem {id} {amount}`: Sets how many of an item to buy in the shop’s buy list. [client] - `setuotitle {title}`: Sets the title of the client window. [client] - `target [timeout]`: Waits until a target cursor appears, or the timeout passes. [client] - `terminate {uo|euo}`: Closes the client, or the EasyUO Reforged window. - `uoxl {new|swap}`: Starts another client, or switches the script to the next running one. ## Data (SQL) - `sql {open|close|exec|query|row|save|load|delete} [arguments...]`: Keeps data in an SQLite database file: raw SQL, or a quick save and load of variables. [new] - `sql close`: Closes the database; an open transaction is rolled back. [new] - `sql delete {%var|!var} [...]`: Removes saved variables from the database. [new] - `sql exec {statement}`: Runs one SQL statement and discards any rows it returns. [new] - `sql load {%var|!var} [...]`: Restores % and ! variables saved with sql save. [new] - `sql open {file|:memory:}`: Opens an SQLite database file, creating it if needed. [new] - `sql query {statement}`: Runs one SQL statement, keeps its rows and loads row 1 into variables. [new] - `sql row {n}`: Loads one row of the last sql query into variables. [new] - `sql save {%var|!var} [...]`: Stores the values of % and ! variables in the database. [new] ## Event - `event {type} [parameters...]`: Makes the client do something with its own internal functions: macros, dragging, messages and more. [client] - `event ContTop {index}`: Brings a gump to the front, counted from the top gump. [client] - `event Drag {id}`: Picks up an item, as if you dragged it with the mouse. [client] - `event ExMsg {id} {font} {colour} {message}`: Shows a message above an object, in a chosen font and colour. [client] - `event Macro {macro} [parameter] [text]`: Runs one of the client's built-in macros: speech, gumps, skills, spells, targeting, dress sets, potions. [client] - `event PathFind {x} {y} [z]`: Walks to a nearby spot, letting the client find a way around obstacles. [client] - `event Property {id}`: Reads the property tooltip of an item or character into #Property. [client] - `event SkillLock {skill|all} {up|down|locked}`: Sets the lock of a skill, or of all skills; the same as exevent SkillLock. [client] - `event Sleep {milliseconds}`: Not implemented in EasyUO Reforged: accepted, but does nothing. [client] - `event StatBar {id}`: Opens the health bar of a character by its ID. [client] - `event SysMessage {message}`: Shows a system message in the client; only you see it. [client] ## ExEvent - `exevent {type} [parameters...]`: Sends actions straight to the server as packets: drag, drop, context menus, locks and more. [client] - `exevent Drag {id} [amount]`: Picks up an item, or a given amount of a stack, through the server. [client] - `exevent DropC {container id} [x y]`: Drops the held item into a container, or onto a stack to combine them. [client] - `exevent DropG {x} {y} [z]`: Drops the held item on the ground at a world position. [client] - `exevent DropPD`: Puts the held item on: drops it on your paperdoll. [client] - `exevent Equip {id} [id...]`: Asks the server to equip one or more items by ID, in one request. [client] - `exevent GumpReply {gump} {button} [switches] [id:text ...]`: Answers a gump the server sent, the way a click on one of its buttons does. [client] [new] - `exevent PopUp {id}`: Opens the context menu of an item or character. [client] - `exevent RenamePet {id} {name}`: Renames one of your pets. [client] - `exevent SkillLock {skill|all} {up|down|locked}`: Sets the lock of a skill, or of all skills. [client] - `exevent StatLock {str|dex|int} {up|down|locked}`: Sets the lock of strength, dexterity or intelligence. [client] ## Flow control - `break`: Leaves the loop it is in and goes on after the loop. - `call {file} [parameter...]`: Runs another script file, then comes back when it exits. - `continue`: Skips the rest of the loop body and goes on with the next round of the loop. - `else` / `else {lines}`: Runs a line or a block when the if before it was false. - `exit`: Ends a called script, or starts the main script over from the top. - `for {variable} {start} {end}`: Repeats a line or block while a variable counts from one number to another. - `gosub {sub name} [parameter...]`: Runs a sub and comes back when it returns, optionally passing parameters. - `goto {label}`: Jumps to a label; the nearest label with that name wins. - `halt`: Stops the script. - `if {condition}` / `if {condition} {lines}`: Runs a line or a block only when a condition is true. - `{name}:`: Marks a line that goto can jump to. - `pause`: Pauses the script until Play is pressed. - `repeat` / `...` / `until {condition}`: Repeats lines until a condition is true, testing it after each round. (`reference/commands/repeat.md`) - `return [value]`: Ends a sub and goes back to the line after its gosub, optionally with a value. - `sleep {milliseconds}`: Pauses the script for a number of milliseconds. - `stop`: Stops the script; exactly the same as halt. - `sub {name}` / `...` / `return [value]`: Starts a named block of lines that gosub can call. - `wait {time} [random]`: Pauses the script for a time, in 50 ms ticks or seconds, plus an optional random extra. - `waitfor {condition} [timeout]`: Waits until a condition is true or a timeout passes, and reports which happened in #WaitRes. [new] - `while {condition}`: Repeats a line or block as long as a condition is true, testing it first. ## Menu - `menu {element} [parameters...]`: Builds a window of buttons, text, fields, lists and images that a script can show and read. - `menu Activate {name}`: Gives a control the keyboard focus. - `menu Button {name} {x} {y} {width} {height} {text}`: Places a button in the menu window; a click puts its name in #MenuButton. - `menu Check {name} {x} {y} {width} {height} {checked} {text}`: Places a check box in the menu window. - `menu Clear`: Removes every control from the menu window and resets the font settings. - `menu Combo Create {name} {x} {y} {width}` / `menu Combo Add {name} {text}` / `menu Combo Select {name} {number}` / `menu Combo Clear {name}`: Places a drop-down list in the menu window, and fills or selects its entries. - `menu Delete {name}`: Removes one control from the menu window. - `menu Edit {name} {x} {y} {width} {text}`: Places a one-line text field in the menu window. - `menu Form {name} {x} {y} {width} {height} [title...]`: Creates another menu window, hidden, that the controls created after it go into. [menu 1.6 only] - `menu Get {name}`: Reads the value of a control into #MenuRes. - `menu GetDef {key}`: Reads one of the defaults new menu controls are created with into #MenuRes. [menu 1.6 only] - `menu GetNum {name} [default]`: Reads a control into #MenuRes, with a default when it is not a number. - `menu GetProp {name} {property}`: Reads a property of a menu control or window, such as its position, text or colour, into #MenuRes. [menu 1.6 only] - `menu Hide`: Hides the menu window, as if it had been closed. - `menu HideEUO`: Minimises the EasyUO Reforged window and shows only the menu window. [menu 1.5 only] - `menu List Create {name} {x} {y} {width} {height}` / `menu List Add {name} {text}` / `menu List Select {name} {number}` / `menu List Clear {name}`: Places a list box in the menu window, and fills or selects its entries. - `menu Memo {name} {x} {y} {width} {height} {text}`: Creates a multi-line, scrollable text field in the EasyUO menu window, which can wrap its long lines. [new] - `menu Panel {name} {x} {y} {width} {height}`: Creates a borderless area that holds other controls; the controls created after it go into it. [menu 1.6 only] - `menu PopDef`: Brings back defaults for new menu controls saved by menu PushDef. [menu 1.6 only] - `menu PushDef`: Saves a copy of the current defaults for new menu controls, for menu PopDef to bring back. [menu 1.6 only] - `menu Radio {name} {x} {y} {width} {height} {checked} {text...}`: Creates a radio button; checking one unchecks the others in the same window or panel. [menu 1.6 only] - `menu Set {name} {value}`: Changes the text or state of a control. - `menu SetDef {key} {value...}`: Changes one of the defaults new menu controls are created with, such as the window or panel they go into. [menu 1.6 only] - `menu SetProp {name} {property} {value...}`: Changes a property of a menu control or window: show or hide it, move it, recolour it, give it a tooltip. [menu 1.6 only] - `menu Shape {name} {x} {y} {width} {height} {shape} {line style} {line width} {line colour} {fill style} {fill colour}`: Draws a rectangle, circle or other shape in the menu window. - `menu Show [x y]`: Shows the menu window, optionally at a position on the screen. - `menu Text {name} {x} {y} {text}`: Places a label in the menu window; $ starts a new line. - `menu Font Align {left|center|right}`: Sets how the text of labels and check boxes created after it is aligned. - `menu Font BGColor {colour}`: Sets the background colour of the controls created after it. - `menu Font Color {colour}`: Sets the text colour of the controls created after it. - `menu Font Name {font}`: Sets the font of the controls created after it. - `menu Font Size {points}`: Sets the font size of the controls created after it. - `menu Font Style [b][i][u][s]`: Sets bold, italic, underline or strikeout for the controls created after it. - `menu Font Transparent {#true|#false}`: Draws the labels created after it without a background. [menu 1.5 only] - `menu Image Create {name} {x} {y} {width} {height}`: Places an empty, transparent image in the menu window to draw in. - `menu Image Ellipse {name} {x1} {y1} {x2} {y2} {colour} {fill} [width]`: Draws an ellipse or circle in an image, outlined or filled. - `menu Image File {name} {x} {y} {file}`: Draws a picture file into an image. - `menu Image FloodFill {name} {x} {y} {colour}`: Fills an area of one colour in an image with another, like a paint bucket. - `menu Image Line {name} {x1} {y1} {x2} {y2} {colour} [width]`: Draws a line in an image. - `menu Image Pix {name} {x} {y} {colour}`: Paints one pixel of an image. - `menu Image PixLine {name} {x} {y} {data}`: Paints a row of pixels of an image from a compact text code. [menu 1.5 only] - `menu Image Pos {name} {x} {y} [width height]`: Moves an image, and optionally resizes it, stretching what is drawn in it. - `menu Image Rectangle {name} {x1} {y1} {x2} {y2} {colour} {fill} [width]`: Draws a rectangle in an image, outlined or filled. - `menu Reforge IncludeCall {#true|#false}`: Makes Reforged's choice of MENU system look at the files the script calls, too. [new] - `menu Reforge Mode {1.5|1.6}`: Chooses which MENU system the script runs under: EasyUO 1.5's or 1.6's. [new] - `menu Window Color {colour}`: Sets the background colour of the menu window. - `menu Window Size {width} {height}`: Sets the size of the menu window. - `menu Window Title {title}`: Sets the title of the menu window. - `menu Window Transparent {opacity}`: Makes the whole menu window see-through, from 0 to 100 percent opaque. ## Miscellaneous - `display [ok|okcancel|yesno|yesnocancel] {message}`: Shows a message box and waits for the user; the answer goes to #DispRes. [changed] - `execute {file} [arguments...]`: Opens a program, file or web address, as if you had double-clicked it. - `linespercycle {lines}`: Sets how many lines the script runs before each 50 ms pause; the same as set #LPC. - `log [text]`: Writes a line to the editor's Output panel, or to EUOCli's output, without stopping the script. [new] - `send [debug]httppost[port] {host} {path} {data}`: Sends an HTTP POST request and runs the reply as an EasyUO script. - `set {variable} [value]`: Gives a variable a value, or the result of an expression. - `shutdown [force]`: Shuts down and powers off the computer. - `sound [file]`: Plays a .wav file, or the Windows default beep. - `str {operation} {text} [parameters...]`: Works on a piece of text (length, position, part, case, replace, split, trim, join, insert, delete, count); the result goes to #StrRes. [changed] - `str len {text}`: The number of characters. - `str pos {text} {part} [n]`: Where `part` starts in `text`, counting from 1; with `n`, where its `n`-th occurrence starts. `0` when it is not there. - `str count {text} {part}`: How many times `part` occurs in `text`. - `str left {text} {n}`: The first `n` characters. - `str right {text} {n}`: The last `n` characters. - `str mid {text} {start} {n}`: `n` characters starting at character `start`. - `str lower {text}`: The text in lower case. - `str upper {text}`: The text in upper case. - `str ins {text} {part} {start}`: The text with `part` inserted at character `start`. - `str del {text} {start} {n}`: The text with `n` characters removed, starting at character `start`. - `str replace {text} {search} [with]`: The text with every `search` replaced by `with`, or removed when `with` is left out. [new] - `str part {text} {separator} {n}`: The `n`-th field between separators, counting from 1. `N/A` when there is no such field. [new] - `str trim {text} [chars]`: The text without those characters at either end. Without `chars`: spaces and `_`. [new] - `str join {separator} {text} [text...]`: The texts in order, with the separator between them. [new] - `str concat {text} [text...]`: The texts in order, with nothing between them. [new] - `tile init [nooverrides]` / `tile cnt {x} {y} [facet]` / `tile get {x} {y} {n} [facet]`: Reads the map: how many tiles are at a spot, and the type, height, name and flags of each. [client] [changed] - `tile cnt {x} {y} [facet]`: Puts the number of tiles at `x`, `y` in `#TileCnt`. - `tile get {x} {y} {n} [facet]`: Reads tile `n` (from 1 to `#TileCnt`) at `x`, `y` into `#TileType`, `#TileZ`, `#TileName` and `#TileFlags`. ## Namespace - `namespace {local|global|clear|push|pop|copy} [parameters...]`: Switches the set of ! variables a script uses: private to the script, or shared with other scripts. - `namespace clear`: Deletes every ! variable of the current namespace. - `namespace copy {pattern} {from|to} {local|global} {name}`: Copies variables matching a pattern between the current namespace and another. - `namespace global {name}`: Makes a global namespace, shared with every running script, the current one. - `namespace local {name}`: Makes a local namespace, private to this script, the current one. - `namespace pop`: Goes back to the namespace last remembered with namespace push. - `namespace push`: Remembers the current namespace, to come back to it with namespace pop. ## Pathfinding - `path {go|walk|step|stop|find|get|can|check|from|set|block|unblock|avoid|link|clear} [arguments...]`: Plans a walking route across the map, around walls, water and buildings, with stairs and bridges, and walks it. [client] [new] - `path avoid {x} {y} {x2} {y2} {cost} [facet]`: Marks an area routes should go around if they can: a guarded zone, a spawn. [new] - `path block {x} {y} [{x2} {y2}] [facet]`: Marks a place or a rectangle that routes must never use. [new] - `path can {x} {y} [z]`: Says whether a character can stand at a place, and at what height. [client] [new] - `path check {n}` / `path check {x} {y} [z] [dir]`: Asks the client itself whether the character can take a step, and at what height it lands. [client] [new] - `path clear [blocks|avoid|links|learned|all]`: Forgets the path blocks, avoid areas, links and refused places, or one kind of them. [new] - `path find {x} {y} [z]`: Plans a walking route from your character to a place on the same facet. [client] [new] - `path from [{x} {y} {z} [facet]]`: Plans routes from another place instead of your character's position. [new] - `path get {n}`: Loads one step of the last planned route into #PathX, #PathY, #PathZ and #PathDir. [new] - `path go {x} {y} [z] [accuracy] [timeout]`: Plans a route to a place and walks it, waiting until the character gets there. [client] [new] - `path link {x} {y} {z} {x2} {y2} {z2} [cost] [facet]`: Adds a teleporter, gate or ladder that routes may use: a one-way jump between two places. [new] - `path set {option} {value}`: Changes an option of the pathfinder: accuracy, search limits, how to walk, doors, creatures and more. [new] - `path step`: Moves a walk on and returns at once, so the script can do other things while the character walks. [client] [new] - `path stop`: Ends the walk that path step is moving on. [new] - `path unblock {x} {y} [{x2} {y2}] [facet]`: Removes the path blocks that cover a place or a rectangle. [new] - `path walk [timeout]`: Walks the route the last path find planned, waiting until the character gets there. [client] [new] ## Obsolete - `deletevar {name}`: Obsolete: empties a % variable; set %x with no value does the same. [obsolete] - `initevents`: Obsolete: event commands set themselves up; the line is ignored. [obsolete] - `playcd`: Obsolete: a leftover from early EasyUO versions that does nothing. [obsolete] - `stopcd`: Obsolete: a leftover from early EasyUO versions that does nothing. [obsolete] ## Licence The summaries come from the reference pages. Those of pages based on the EasyUO wiki are available under the GNU Free Documentation License 1.2 (`LICENSE-GFDL-1.2.txt`), like the pages; the rest is under the BSD 2-Clause licence of EasyUO Reforged. # Variables Every system variable (`#name`) of EasyUO Reforged v26.11.16, generated from its documentation. - The word in parentheses is the kind of value: `number`, `string`, `boolean` (`-1` or `0`) or `id` (an object ID or type, written in letters, such as `YKLMNOP` or `POF`). - `[rw]` can be set with `set`; every other variable is read-only. - `[client]` needs a UO client attached; without one it reads `N/A`. - `[new]` was added by EasyUO Reforged: the original EasyUO 1.5 does not have it. The details of `#Name` are in `reference/variables/name.md` (lower case, without the `#`). A `#name` that is not in this list does not exist. The `%`, `!` and `*` variables are the script's own: see `language.md`. ## Buffs - `#BuffBarOpen` (boolean): #true when the client’s buff bar window is open, #false when it is closed. [client] [new] - `#BuffCliloc` (number): Cliloc number of the selected buff’s title. [client] [new] - `#BuffCnt` (number): Number of buffs on the buff bar, counted live. [client] [new] - `#BuffDesc` (string): Second line of the selected buff’s tooltip. [client] [new] - `#BuffID` (number): Icon ID of the selected buff, a plain number (Bless is 30018). [client] [new] - `#BuffIndex` (number): Selects which buff the #Buff… variables describe; 1 is the first. [rw] [client] [new] - `#BuffName` (string): Title of the selected buff, as its tooltip shows it. [client] [new] - `#BuffTime` (number): Seconds left on the selected buff; -1 when it has no timer. [client] [new] ## Character - `#BackpackID` (id): ID of your character’s backpack. [client] - `#CharDir` (number): Direction your character is facing, 0 (north) to 7. [client] - `#CharGhost` (string): yes when your character is dead (a ghost), no otherwise. [client] - `#CharID` (id): ID of your character. [client] - `#CharPosX` (number): Your character’s X position in the world (west–east). [client] - `#CharPosY` (number): Your character’s Y position in the world (north–south). [client] - `#CharPosZ` (number): Your character’s height (Z coordinate). [client] - `#CharStatus` (string): Letters for your character’s states: frozen, female, flying or poisoned, yellow health bar, war mode, hidden. [client] - `#CharType` (id): Body type of your character, as a Sys26 type. [client] - `#MountID` (id): ID of the mount item your character rides, or N/A while it is on foot. [client] [new] - `#MountType` (id): Type of the mount item your character rides, or N/A while it is on foot. [client] [new] ## Client - `#CliCnt` (number): Number of supported UO clients running. - `#CliLang` (string): Language code of the client, such as ENU. [client] - `#CliLeft` (number): X position of the game area inside the client window; set it to move the game area. [rw] [client] - `#CliLogged` (boolean): 1 when a character is logged in, 0 at the login screens. [client] - `#CliNr` (number): Which of the running clients the script drives, counting from 1. - `#CliTitle` (string): Title of the client window; set it to rename the window. [rw] [client] - `#CliTop` (number): Y position of the game area inside the client window; set it to move the game area. [rw] [client] - `#CliVer` (string): Version of the attached client, such as 7.0.117.1. [client] - `#CliXRes` (number): Width of the game area in pixels; set it to resize the game area. [rw] [client] - `#CliYRes` (number): Height of the game area in pixels; set it to resize the game area. [rw] [client] - `#LShard` (number): Number of the last shard chosen; set it before logging in to preselect a shard. [rw] [client] - `#Shard` (string): Name of the shard the client is logged in to. [client] ## Combat - `#EnemyHits` (number): Health in percent of the enemy in #EnemyID. [client] [changed] - `#EnemyID` (id): ID of the enemy whose health bar the client shows, or N/A. [client] - `#LHandID` (id): ID of the item for the left hand; set it, then event Macro 24 1 arms it. [rw] [client] - `#RHandID` (id): ID of the item for the right hand; set it, then event Macro 24 2 arms it. [rw] [client] ## Constants - `#DOT` (string): A full stop, which could not be typed alone because . joins words. - `#False` (boolean): The value false: 0. - `#SMC` (string): A semicolon, which could not be typed directly because ; starts a comment. - `#SPC` (string): A space; glue it between words with commas. - `#True` (boolean): The value true: -1. ## Container - `#ContHP` (number): Health in percent of the creature whose health bar is the top gump. [client] - `#ContID` (id): ID of the item a container gump on top belongs to. [client] - `#ContKind` (id): Kind of the gump on top, as a code; tells crafting menus, runebooks and more apart. [client] - `#ContName` (string): Name of the gump on top, such as container_gump or paperdoll_gump. [client] - `#ContPosX` (number): X position of the gump on top; set it to move the gump. [rw] [client] - `#ContPosY` (number): Y position of the gump on top; set it to move the gump. [rw] [client] - `#ContSize` (string): Width and height of the gump on top, as width_height. [client] - `#ContSizeX` (number): Width of the top gump in pixels. [client] - `#ContSizeY` (number): Height of the top gump in pixels. [client] - `#ContType` (id): Type of the item a container gump on top belongs to. [client] - `#NextCPosX` (number): X position where the next container will open. [rw] [client] - `#NextCPosY` (number): Y position where the next container will open. [rw] [client] ## Cursor & targeting - `#CursKind` (number): Facet you are on: 0 Felucca, 1 Trammel, 2 Ilshenar, 3 Malas, 4 Tokuno, 5 Ter Mur. [client] - `#CursorX` (number): Mouse cursor X position relative to the game area. [client] - `#CursorY` (number): Mouse cursor Y position relative to the game area. [client] - `#TargCurs` (boolean): 1 while a target cursor is showing; set it to 1 to let the user pick a target. [rw] [client] ## FindItem - `#FindBagID` (id): ID of the container holding the object FindItem selected. [client] - `#FindCnt` (number): How many objects the last FindItem found. [client] - `#FindCol` (number): Colour (hue) of the object FindItem selected. [client] - `#FindDist` (number): Distance in tiles to the object FindItem selected, for objects on the ground. [client] - `#FindID` (id): ID of the object FindItem selected, or X when nothing was found. [client] - `#FindIndex` (number): Selects which FindItem match the #Find… variables describe, without searching again. [rw] [client] - `#FindKind` (number): Where the object FindItem selected is: 0 in a container, 1 on the ground, -1 not found. [client] - `#FindLayer` (number): Layer a character wears the object FindItem selected in, or N/A when nobody wears it. [client] [new] - `#FindMod` (string): Offset added to #FindX and #FindY for objects in containers, written x_y. [rw] [client] - `#FindRep` (number): Notoriety of the character FindItem selected: 1 innocent to 7 invulnerable. [client] - `#FindStack` (number): Number of items in the stack FindItem selected; 0 for characters. [client] - `#FindType` (id): Type of the object FindItem selected. [client] - `#FindX` (number): X position of the object FindItem selected: world position on the ground, screen position in a container. [client] - `#FindY` (number): Y position of the object FindItem selected: world position on the ground, screen position in a container. [client] - `#FindZ` (number): Height of the object FindItem selected. [client] ## Gumps - `#GumpArt` (id): Graphic of the selected gump window, as an ID: the backpack is YE. [client] [new] - `#GumpCnt` (number): Number of gump windows ScanGumps found. [client] [new] - `#GumpIndex` (number): Selects which gump the #Gump… variables describe; 1 is the window in front. [rw] [client] [new] - `#GumpKind` (id): Kind of the selected gump window, the same code as #ContKind. [client] [new] - `#GumpMin` (boolean): Whether the selected gump window is minimized: #true or #false. [client] [new] - `#GumpName` (string): The client's own name for the selected gump window, e.g. container_gump. [client] [new] - `#GumpObjID` (id): ID of the object the selected gump window belongs to: a container or a character. [client] [new] - `#GumpPosX` (number): X position of the selected gump window, in pixels. [client] [new] - `#GumpPosY` (number): Y position of the selected gump window, in pixels. [client] [new] - `#GumpReply` (string): The last answer exevent GumpReply sent, type ID first, ready to send again. [new] - `#GumpReplyCnt` (number): How many gump answers were recorded: clicks by hand and exevent GumpReply. Goes up by one with each. [new] - `#GumpReplyRes` (string): What the last exevent GumpReply did: sent, nogump or error. [new] - `#GumpSerial` (id): Serial of the selected server gump, new each time the server opens it. [client] [new] - `#GumpSizeX` (number): Width of the selected gump window, in pixels. [client] [new] - `#GumpSizeY` (number): Height of the selected gump window, in pixels. [client] [new] - `#GumpTypeID` (id): Type ID of the selected server gump: which gump it is, the same every time. [client] [new] ## Journal & messages - `#JColor` (number): Colour of the journal line read by the last scanjournal. [client] - `#JFound` (number): Running number of the journal line the last findjournal found, or 0 if it found none. [client] [new] - `#JIndex` (number): Running number of the newest journal line; follow it to read every new line once. [client] - `#Journal` (string): Journal line read by the last scanjournal. [client] - `#SysMsg` (string): The last system message the client showed. [client] - `#SysMsgCol` (number): Colour that event SysMessage writes in. [rw] ## Last action - `#LLiftedID` (id): ID of the object last picked up (dragged). [client] - `#LLiftedKind` (number): 1 while something hangs on the cursor, 0 otherwise. [client] - `#LLiftedType` (id): Type of the object last picked up (dragged). [client] - `#LObjectID` (id): ID of the last object used; set it, then event Macro 17 uses that object. [rw] [client] - `#LObjectType` (id): Type of the last object used. [client] - `#LSkill` (number): Number of the last skill used; set it, then event Macro 14 uses that skill. [rw] [client] - `#LSpell` (number): Number of the last spell cast; set it, then event Macro 16 casts that spell. [rw] [client] - `#LTargetID` (id): ID of the last object targeted; set it, then event Macro 22 targets that object. [rw] [client] - `#LTargetKind` (number): What the last target was: 1 object, 2 ground, 3 resource such as a tree or water. [rw] [client] - `#LTargetTile` (number): Map graphic of the tile last targeted; used for resources such as trees. [rw] [client] - `#LTargetX` (number): World X position of the last target; used when targeting the ground or a resource. [rw] [client] - `#LTargetY` (number): World Y position of the last target; used when targeting the ground or a resource. [rw] [client] - `#LTargetZ` (number): World height of the last target; used when targeting the ground or a resource. [rw] [client] ## Pathfinding - `#PathCnt` (number): Number of steps of the route the last path find planned. [new] - `#PathDir` (number): Direction of a step of the planned route, 0 (north) to 7, or 8 for a link. [new] - `#PathState` (string): How the last path command went: ok, how a walk ended, a reason no route was found, or the error. [new] - `#PathX` (number): X position of a step of the planned route: the last one after path find, step n after path get. [new] - `#PathY` (number): Y position of a step of the planned route: the last one after path find, step n after path get. [new] - `#PathZ` (number): Height of a step of the planned route, or where path can found a place to stand. [new] ## Result - `#DispRes` (string): Button the user pressed in the last display box: Ok, Yes, No or Cancel. - `#MenuButton` (string): Name of the last menu button clicked, in capitals; CLOSED when the menu window was closed. [rw] - `#MenuRes` (string): Value read by the last menu Get or menu GetNum. [rw] - `#MoveRes` (string): How the last moveitem ended: ok, left, refused, nolift, noitem, nodest, held or error. [new] - `#PixCol` (number): Colour of the pixel last read by savepix, a $BBGGRR number. [client] - `#Property` (string): Property tooltip read by the last event Property; lines end with $. [client] - `#Result` (string): Value given to the last return; N/A when it had none. [rw] - `#StrRes` (string): Result of the last str command; also set by getuotitle. [rw] - `#WaitRes` (boolean): How the last waitfor ended: #true if its condition was met, #false if the time ran out. [new] ## Script - `#CurPath` (string): Folder of EasyUOReforged.exe, ending with a backslash. - `#EUOVer` (string): Always 1_50_00, the EasyUO version Reforged is ported from; see #ReforgedVer. - `#LPC` (number): Lines run per 50 ms cycle; 10 by default. [rw] - `#NSName` (string): Name of the current namespace; std when the script starts. - `#NSType` (string): Whether the current namespace is local or global. - `#Opts` (string): Active options: always SYS, EXEC and SEND, plus DMC when Don’t Move Cursor is on. - `#OSVer` (string): Windows version, as platform_major_minor. - `#Random` (number): A new random number from 0 to 999 each time it is read. - `#ReforgedVer` (string): Build version of EasyUO Reforged, such as 26.10.22.3c144de. [new] - `#SendHeader` (string): Extra HTTP header lines for send; end each line with $. [rw] ## Shop - `#ShopCnt` (number): Number of entries in the shop gump. [client] - `#ShopCurPos` (number): Position of the shop entry shown at the top, counting from 1. [client] - `#ShopItemID` (id): ID of the shop entry’s item, for setshopitem. [client] - `#ShopItemMax` (number): How many of the shop entry’s item the vendor has. [client] - `#ShopItemName` (string): Name of the shop entry shown at the top of the shop gump. [client] - `#ShopItemPrice` (number): Price of the shop entry shown at the top of the shop gump. [client] - `#ShopItemType` (id): Type of the shop entry’s item. [client] ## Skills - `#Skill` (number): Value of the skill chosen with chooseskill, in tenths (700 = 70.0). [client] - `#SkillCap` (number): Cap of the skill chosen with chooseskill, in tenths. [client] - `#SkillLock` (string): Lock of the skill chosen with chooseskill: up, down or locked. [client] ## SQL - `#SqlChanges` (number): Rows changed by the last sql exec or query, or variables handled by save / load / delete. [new] - `#SqlCnt` (number): Number of rows the last sql query returned. [new] - `#SqlLastID` (number): Rowid of the last row inserted on this connection. [new] - `#SqlRes` (string): OK after a successful sql command, otherwise the error text. [new] ## Status bar - `#AR` (number): Your character’s physical resistance (armour rating before Age of Shadows). [client] - `#CharName` (string): Your character’s name. [client] - `#CR` (number): Your character’s cold resistance. [client] - `#Dex` (number): Your character’s dexterity. [client] - `#ER` (number): Your character’s energy resistance. [client] - `#Followers` (number): How many follower slots your pets and summons use. [client] - `#FR` (number): Your character’s fire resistance. [client] - `#Gold` (number): Gold your character carries, as the status window shows it. [client] - `#Hits` (number): Your character’s current hit points. [client] - `#Int` (number): Your character’s intelligence. [client] - `#Luck` (number): Your character’s luck. [client] - `#Mana` (number): Your character’s current mana. [client] - `#MaxDmg` (number): Most damage of the weapon in your hands. [client] - `#MaxFol` (number): How many follower slots your character has. [client] - `#MaxHits` (number): The most hit points your character can have. [client] - `#MaxMana` (number): The most mana your character can have. [client] - `#MaxStam` (number): The most stamina your character can have. [client] - `#MaxStats` (number): Your character’s stat cap: the most strength, dexterity and intelligence together. [client] - `#MaxWeight` (number): Most weight your character can carry, calculated from strength: 3.5 × Str + 40. [client] - `#MinDmg` (number): Least damage of the weapon in your hands. [client] - `#PR` (number): Your character’s poison resistance. [client] - `#Sex` (number): Your character’s sex: 0 male, 1 female. [client] - `#Stamina` (number): Your character’s current stamina. [client] - `#Str` (number): Your character’s strength. [client] - `#TP` (number): Your character’s tithing points. [client] - `#Weight` (number): Weight your character carries, in stones. [client] ## Tile - `#TileCnt` (number): Number of tiles at a map position, from tile cnt. [client] - `#TileFlags` (string): Properties of the tile read by tile get, as names joined by _. [client] - `#TileName` (string): Name of the tile read by tile get, such as tree or water. [client] - `#TileType` (number): Graphic number of the tile read by tile get. [client] - `#TileZ` (number): Height of the tile read by tile get. [client] ## Time - `#Date` (string): Local date of the computer as yymmdd. - `#SCnt` (number): A seconds counter; set it to start counting from that value. [rw] - `#SCnt2` (number): A tenths-of-a-second counter; set it to start counting from that value. [rw] - `#SysTime` (number): Milliseconds since 1 January 1980 UTC; for timing. - `#Time` (string): Local time of the computer as hhmmss, 24-hour clock. ## Licence The summaries come from the reference pages. Those of pages based on the EasyUO wiki are available under the GNU Free Documentation License 1.2 (`LICENSE-GFDL-1.2.txt`), like the pages; the rest is under the BSD 2-Clause licence of EasyUO Reforged. --- # Control structures > Labels, goto, subs and the other statements that control the flow of a script. - **Online:** https://ilpersi.github.io/EasyUOReforged/language/control-structures/ A script runs from its first line down. These commands change that order. Each has its own page with the details. ## Choosing: `if` and `else` [`if`](https://ilpersi.github.io/EasyUOReforged/commands/if/) runs a line or block only when a condition is true; [`else`](https://ilpersi.github.io/EasyUOReforged/commands/else/) runs another when it is false. Only `#true` (`-1`) counts as true. ```euo if #Hits < 50 display ok Heal first. else display ok Ready to fight. halt ``` ## Repeating | Loop | Use it to | |---|---| | [`for`](https://ilpersi.github.io/EasyUOReforged/commands/for/) | Count through numbers. | | [`while`](https://ilpersi.github.io/EasyUOReforged/commands/while/) | Repeat while a condition holds; test first. | | [`repeat … until`](https://ilpersi.github.io/EasyUOReforged/commands/repeat/) | Repeat until a condition holds; test after each round. | [`break`](https://ilpersi.github.io/EasyUOReforged/commands/break/) leaves a loop; [`continue`](https://ilpersi.github.io/EasyUOReforged/commands/continue/) skips to its next round. ```euo for %i 1 3 display ok Round %i set %n 1 while %n < 100 set %n %n * 2 display ok %n ; 128 halt ``` ## Jumping: labels and `goto` A [label](https://ilpersi.github.io/EasyUOReforged/commands/label/) is a name followed by a colon, on a line of its own. [`goto`](https://ilpersi.github.io/EasyUOReforged/commands/goto/) jumps to it. It is the simplest way to build the main loop of a script: ```euo set %rounds 0 mainloop: set %rounds %rounds + 1 wait 5 if %rounds < 3 goto mainloop display ok %rounds rounds done. halt ``` Use `goto` within a part of the script, but never to leave a sub: that leaves the sub open. ## Subs: `sub`, `gosub` and `return` A [sub](https://ilpersi.github.io/EasyUOReforged/commands/sub/) is a named group of lines ending with [`return`](https://ilpersi.github.io/EasyUOReforged/commands/return/). [`gosub`](https://ilpersi.github.io/EasyUOReforged/commands/gosub/) runs it and comes back to the line after the `gosub`. Subs keep scripts short and readable: write something once, use it from many places. ```euo gosub greet Jim halt sub greet display ok Hello %1 return ``` - Parameters after the sub name arrive in `%1`, `%2`, …, and `%0` holds how many there are. These are ordinary variables shared by the whole script, so a sub that calls another sub loses its own `%1`, `%2`; copy them into variables of their own first. - `return %value` hands a value back in [`#Result`](https://ilpersi.github.io/EasyUOReforged/variables/result/). - Put subs after the main part of the script, where the normal flow never reaches them; see [`sub`](https://ilpersi.github.io/EasyUOReforged/commands/sub/) for why. - To give a sub variables of its own, switch [namespace](https://ilpersi.github.io/EasyUOReforged/commands/namespace/) inside it. ## Other scripts: `call` and `exit` [`call`](https://ilpersi.github.io/EasyUOReforged/commands/call/) runs another script file and comes back when it ends or reaches [`exit`](https://ilpersi.github.io/EasyUOReforged/commands/exit/). In the main script, `exit` and reaching the last line both start the script over; [`halt`](https://ilpersi.github.io/EasyUOReforged/commands/halt/) stops it. *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # Expressions > Calculations and conditions: which commands evaluate them, how words are separated, and how lines and blocks are built. - **Online:** https://ilpersi.github.io/EasyUOReforged/language/expressions/ An expression is a calculation or a condition: `%a + 1`, `( 2 + 2 ) * 3`, `#Hits < 50`, `%a = 1 && %b = 2`. It is built from values, variables, [operators](https://ilpersi.github.io/EasyUOReforged/language/operators/) and parentheses. ```euo set %var 1337 ; a value set %temp %var ; a variable set %next %var + 1 ; an operator set %calc ( 2 + 2 ) * ( 3 - 1 ) ; parentheses: 8 set %flag ! #true ; an operator before a value: 0 display ok %next %calc %flag halt ``` ## Which commands calculate **Only six commands work out expressions:** [`set`](https://ilpersi.github.io/EasyUOReforged/commands/set/), [`if`](https://ilpersi.github.io/EasyUOReforged/commands/if/), [`while`](https://ilpersi.github.io/EasyUOReforged/commands/while/), [`until`](https://ilpersi.github.io/EasyUOReforged/commands/repeat/), [`return`](https://ilpersi.github.io/EasyUOReforged/commands/return/) and, new in EasyUO Reforged, [`waitfor`](https://ilpersi.github.io/EasyUOReforged/commands/waitfor/). Every other command takes its parameters as they are: `wait %a + 1` waits `%a` ticks and ignores the rest. To pass a calculated value to another command, calculate it with `set` first: ```euo set %a 19 set %delay %a + 1 wait %delay ; 20 ticks: one second halt ``` ## Spaces matter A line is split into words at spaces, and **every operator and parenthesis has to be a word of its own**: ```euo set %b 1 set %a %b + 1 ; right: 2 set %c %b+1 ; wrong: "%b+1" is one word, so nothing is added display ok %a %c if ( %a > 1 ) ; right display ok %a is bigger than 1 if (%a > 1) ; wrong: "(%a" and "1)" are not understood display ok never shown halt ``` Calculations use whole numbers only. A value that is not a number counts as `0` in arithmetic. See [Operators](https://ilpersi.github.io/EasyUOReforged/language/operators/) for every operator and the order they are worked out in. ## Lines and blocks A script is a list of lines. Each line holds one command and its parameters, and runs from the first word to the end of the line or to a `;`, which starts a comment. - **A long line** can continue on the next lines: start each continuation with `+`. The pieces are joined without a space, so write `+ more text` (with a space after `+`) where you want one. - **A block** is a group of lines between a `{` line and a `}` line. Blocks belong to [`if`](https://ilpersi.github.io/EasyUOReforged/commands/if/), [`else`](https://ilpersi.github.io/EasyUOReforged/commands/else/), [`for`](https://ilpersi.github.io/EasyUOReforged/commands/for/), [`while`](https://ilpersi.github.io/EasyUOReforged/commands/while/), [`sub`](https://ilpersi.github.io/EasyUOReforged/commands/sub/) and a few others. The braces go on lines of their own, and the `{` has to be the line right after the command it belongs to. ```euo set %a 3 if %a > 2 { set %b %a * 2 display ok %b } display ok This is a long message that + goes on over two lines. halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # Operators > Arithmetic, comparison, logical and text operators, and the order they are worked out in. - **Online:** https://ilpersi.github.io/EasyUOReforged/language/operators/ Operators are worked out by the six commands that calculate: [`set`](https://ilpersi.github.io/EasyUOReforged/commands/set/), [`if`](https://ilpersi.github.io/EasyUOReforged/commands/if/), [`while`](https://ilpersi.github.io/EasyUOReforged/commands/while/), [`until`](https://ilpersi.github.io/EasyUOReforged/commands/repeat/), [`return`](https://ilpersi.github.io/EasyUOReforged/commands/return/) and [`waitfor`](https://ilpersi.github.io/EasyUOReforged/commands/waitfor/). Every operator has to be a separate word, with spaces around it; see [Expressions](https://ilpersi.github.io/EasyUOReforged/language/expressions/). ## Arithmetic | Example | Operator | Result | |---|---|---| | `%a + %b` | Addition | | | `%a - %b` | Subtraction | | | `%a * %b` | Multiplication | | | `%a / %b` | Division | Whole numbers only: the remainder is dropped, `7 / 2` is `3`. Dividing by 0 gives `0`. | | `%a % %b` | Remainder | What is left over after dividing: `7 % 2` is `1`. By 0 it gives `0`. | | `abs %a` | Absolute value | The value without its sign: `abs -5` is `5`. | Arithmetic works on whole numbers. A value that is not a number (`hello`, `N/A`) counts as `0`. ## Comparison Comparisons give `-1` ([`#true`](https://ilpersi.github.io/EasyUOReforged/variables/true/)) or `0` ([`#false`](https://ilpersi.github.io/EasyUOReforged/variables/false/)). | Example | Operator | True when | |---|---|---| | `%a = %b` | Equal | Both are the same. When either is not a number they are compared as text, ignoring case. | | `%a <> %b` | Not equal | They are not the same, by the same rule. | | `%a < %b` | Less than | `%a` is smaller. | | `%a > %b` | Greater than | `%a` is larger. | | `%a <= %b` | Less than or equal | Also written `=<`. | | `%a >= %b` | Greater than or equal | Also written `=>`. | | `%a in %b` | Contained in | The text `%a` appears inside `%b`, ignoring case. | | `%a notin %b` | Not contained in | It does not. | `<`, `>`, `<=` and `>=` are **always false** when either side is not a number: `hello > 33` is false, and so is `hello < 33`. That makes a quick test for "is this a number?": ```euo set %cnt hello if ! ( %cnt > 0 || %cnt < 1 ) set %cnt 0 ; %cnt was not a number display ok %cnt halt ``` ## Logical | Example | Operator | True when | |---|---|---| | `%a && %b` | And | Both are true. | | `%a \|\| %b` | Or | At least one is true. | | `! %a` | Not | `%a` is false (it turns `-1` into `0` and `0` into `-1`). | These are meant for true/false values (`-1` and `0`), such as the results of comparisons. On other numbers they work bit by bit (`! 5` is `-6`), which is rarely what you want. Both sides of `&&` and `||` are always worked out. ## Text and lines These are handled while the line is read, before the command runs, so they work with every command, not just the six above. | Example | Operator | What it does | |---|---|---| | `%a , %b` | Join | Joins the two values into one word: with `%a` = `A` and `%b` = `B`, `%a , %b` is `AB`. | | `%a . %b` | Glue a name | Glues the word on the left to the **value** on the right, then reads the result as a variable. See below. | | `+` at the start of a line | Continue | The line continues the previous one, joined without a space. | Joining works on any word, even command names: `h , a , l , t` is `halt`. ### Building variable names with `.` `.` works from right to left: the right side is replaced by its value first, then glued to the left word, and the result is read as a variable. That builds variable names from other values, a little like arrays: ```euo set %a 3 set %item3 sword set %x %item . %a ; %item . 3 -> %item3 -> sword set %y %item , %a ; "%item" has no value, so N/A , 3 -> N/A3 display ok %x %y halt ``` ```euo set %slot1 sword set %slot2 shield set %slot3 helmet for %i 1 3 { set %name %slot . %i ; %slot1, %slot2, %slot3 display ok %name } halt ``` A `.` or `,` only works as a separate word. To put a full stop or a comma into text, use [`#DOT`](https://ilpersi.github.io/EasyUOReforged/variables/dot/) or glue the pieces with `,`. ## Order of operations Within each pair of parentheses, starting with the innermost, operators are worked out in this order. Operators on the same row are worked out from left to right. | Order | Operators | |---|---| | 1 | `!` and `abs`, from right to left | | 2 | `*` `/` `%` | | 3 | `+` `-` | | 4 | `=` `<>` `<` `>` `<=` `>=` `in` `notin` | | 5 | `&&` | | 6 | `\|\|` | Before any of this, while the line is read, `.` (right to left) and then `,` (left to right) have already been applied, and variables have been replaced by their values. ```euo set %r 5 + 3 * 2 ; 5 + ( 3 * 2 ) = 11 set %r 8 - 3 - 2 ; ( 8 - 3 ) - 2 = 3 set %r ( 1 + 2 ) * 2 * 4 ; 24 set %a 1 set %b 2 if %a = 1 && %b = 2 ; ( %a = 1 ) && ( %b = 2 ) display ok Both are true. if ! ( %a = 1 ) ; parentheses needed: ! %a = 1 means ( ! %a ) = 1 display ok Not shown: %a is 1. halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # Variables > The four kinds of variables (%, !, * and #), how names and values work, and who can see which. - **Online:** https://ilpersi.github.io/EasyUOReforged/language/variables/ A variable is a name that holds a value. Its first character says what kind it is: | Kind | Example | Belongs to | Kept until | |---|---|---|---| | **Standard** | `%count` | The script, and scripts it starts with [`call`](https://ilpersi.github.io/EasyUOReforged/commands/call/). | The script starts again. | | **Namespace** | `!count` | The current [namespace](https://ilpersi.github.io/EasyUOReforged/commands/namespace/): this script only, or shared with other scripts. | The script starts again (local) or EasyUO Reforged closes (global). | | **Persistent** | `*count` | Every script, in this and the original EasyUO. | You change or delete it: it is saved in the registry. | | **System** | `#CharName` | EasyUO and the client. | Built in; see the [variable reference](https://ilpersi.github.io/EasyUOReforged/variables/). | ## Names - A name is made of letters, digits and `_`: `%loot_bag`, `%x2`. Nothing else, not even a `-`. - Case does not matter: `%Count` and `%COUNT` are the same variable. - `%0`, `%1`, `%2`, … hold the parameters of the last [`gosub`](https://ilpersi.github.io/EasyUOReforged/commands/gosub/) or [`call`](https://ilpersi.github.io/EasyUOReforged/commands/call/), so avoid names made of digits only. ```euo set %var Bob set %Var Joe display ok %var ; Joe: %var and %Var are the same variable halt ``` ## Values - **A value is one word.** `set %a hello world` stores only `hello`. To store several words, write `_` between them, or glue them with commas and [`#SPC`](https://ilpersi.github.io/EasyUOReforged/variables/spc/): `set %a hello , #spc , world`. - **Numbers and text are both just values.** A value that looks like a whole number (`42`, `-7`, `$1A`) can be used in calculations; anything else counts as `0` there. See [Expressions](https://ilpersi.github.io/EasyUOReforged/language/expressions/). - **A variable that was never set reads `N/A`.** - Use a variable anywhere in a line and its value is put in its place before the command runs. The one exception is the variable [`set`](https://ilpersi.github.io/EasyUOReforged/commands/set/) and [`for`](https://ilpersi.github.io/EasyUOReforged/commands/for/) assign to. ## Standard variables: `%` Standard variables are the everyday kind. They belong to the running script and are shared with scripts it starts with `call`. They are all cleared when the script starts again. ## Namespace variables: `!` `!x` is the variable `x` of the current [namespace](https://ilpersi.github.io/EasyUOReforged/commands/namespace/). A script starts in the local namespace `std`, so until you switch, `!` variables behave like `%` variables. Switch namespaces to give a sub its own variables ([`namespace local`](https://ilpersi.github.io/EasyUOReforged/commands/namespace/local/)) or to share variables with other scripts running in EasyUO Reforged ([`namespace global`](https://ilpersi.github.io/EasyUOReforged/commands/namespace/global/)). ## Persistent variables: `*` Persistent variables survive restarts: they are saved in the Windows registry, under `HKEY_CURRENT_USER\Software\EasyUO`, and every script on the computer can read them. EasyUO Reforged uses the same place as the original EasyUO, so the two share them. ```euo if *runs = N/A set *runs 0 set *runs *runs + 1 display ok This script has run *runs times. halt ``` For more data, or data you want to keep in a file of your own, there is also [`SQL`](https://ilpersi.github.io/EasyUOReforged/commands/sql/). [SQL or * variables?](https://ilpersi.github.io/EasyUOReforged/guides/sql-or-persistent-variables/) compares the two. ## System variables: `#` System variables are built in. Most describe the client and your character (`#CharPosX`, `#Hits`, `#FindID`); a few describe EasyUO itself (`#Time`, `#LPC`). Most are read-only; the writable ones are marked **Read / write**. They are listed in the [variable reference](https://ilpersi.github.io/EasyUOReforged/variables/). *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # Break > Leaves the loop it is in and goes on after the loop. - **Syntax:** `break` - **Needs a client:** no - **Related:** continue, for, while, repeat - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/break/ `break` leaves the [`for`](https://ilpersi.github.io/EasyUOReforged/commands/for/), [`while`](https://ilpersi.github.io/EasyUOReforged/commands/while/) or [`repeat … until`](https://ilpersi.github.io/EasyUOReforged/commands/repeat/) loop it is in. The script goes on with the line after the loop. Only the innermost loop is left. A `break` outside any loop does nothing. ## Example ```euo set %test 1 while %test < 10 { if %test = 7 break set %test %test + 1 } display ok %test ; shows 7 halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # Call > Runs another script file, then comes back when it exits. - **Syntax:** `call {file} [parameter...]` - **Needs a client:** no - **Related:** exit, gosub, #CurPath - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/call/ `call` runs another script file. When that script reaches [`exit`](https://ilpersi.github.io/EasyUOReforged/commands/exit/) or its last line, the calling script goes on with the line after the `call`. ## Parameters | Parameter | Meaning | |---|---| | `file` | The script to run. A relative path starts from [`#CurPath`](https://ilpersi.github.io/EasyUOReforged/variables/curpath/), the folder of `EasyUOReforged.exe`. When the file is not found as written, `.txt` and then `.euo` are added. | | `parameter` | Optional values passed to the script. In it, `%1`, `%2`, … hold them and `%0` holds how many there are, as with [`gosub`](https://ilpersi.github.io/EasyUOReforged/commands/gosub/). | ## Details - **File not found:** nothing happens and the script goes on with the next line. - **Variables are shared** between the two scripts. A called script cannot return a value, so set a variable; see [`exit`](https://ilpersi.github.io/EasyUOReforged/commands/exit/) for an example. - **Spaces in the path:** a space separates parameters, so `C:\My Scripts\a.euo` is read as two words. Glue the parts together with commas and `#spc`: `call C:\My , #spc , Scripts\a.euo`. ## Example ```euo call greet.euo Jim Bob halt ``` `greet.euo`, in the folder of `EasyUOReforged.exe`: ```euo title="greet.euo" display ok Hello %1 and %2 exit ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # ChooseSkill > Selects the skill that #Skill, #SkillCap and #SkillLock report. - **Syntax:** `chooseskill {skill} [real]` - **Needs a client:** yes - **Sets:** #Skill, #SkillCap, #SkillLock - **Related:** exevent SkillLock, #Skill - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/chooseskill/ `chooseskill` selects the skill that [`#Skill`](https://ilpersi.github.io/EasyUOReforged/variables/skill/), [`#SkillCap`](https://ilpersi.github.io/EasyUOReforged/variables/skillcap/) and [`#SkillLock`](https://ilpersi.github.io/EasyUOReforged/variables/skilllock/) describe. The variables are read from the client each time you use them, so they always show the current value; you do not need to run `chooseskill` again to refresh them. ## Parameters | Parameter | Meaning | |---|---| | `skill` | The skill. Only the first four letters count, so `mage` and `magery` both work. See the table below. | | `real` | Optional. `#Skill` reports the base value, without bonuses from items and stats. | Skill values are in tenths: `700` is 70.0. `#SkillLock` is `up`, `down` or `locked`. An unknown name gives `0` everywhere. ## Skill codes The code is the first four letters of the skill's name, with two exceptions: **Animal Lore** is `ANIL` (`ANIM` is Animal Taming) and **Stealth** is `STLT` (`STEA` is Stealing). | Code | Skill | Code | Skill | |---|---|---|---| | `ALCH` | Alchemy | `LUMB` | Lumberjacking | | `ANAT` | Anatomy | `MACE` | Mace Fighting | | `ANIL` | Animal Lore | `MAGE` | Magery | | `ANIM` | Animal Taming | `MEDI` | Meditation | | `ARCH` | Archery | `MINI` | Mining | | `ARMS` | Arms Lore | `MUSI` | Musicianship | | `BEGG` | Begging | `MYST` | Mysticism | | `BLAC` | Blacksmithy | `NECR` | Necromancy | | `BOWC` | Bowcraft / Fletching | `NINJ` | Ninjitsu | | `BUSH` | Bushido | `PARR` | Parrying | | `CAMP` | Camping | `PEAC` | Peacemaking | | `CARP` | Carpentry | `POIS` | Poisoning | | `CART` | Cartography | `PROV` | Provocation | | `CHIV` | Chivalry | `REMO` | Remove Trap | | `COOK` | Cooking | `RESI` | Resisting Spells | | `DETE` | Detecting Hidden | `SNOO` | Snooping | | `DISC` | Discordance | `SPEL` | Spellweaving | | `EVAL` | Evaluating Intelligence | `SPIR` | Spirit Speak | | `FENC` | Fencing | `STEA` | Stealing | | `FISH` | Fishing | `STLT` | Stealth | | `FOCU` | Focus | `SWOR` | Swordsmanship | | `FORE` | Forensic Evaluation | `TACT` | Tactics | | `HEAL` | Healing | `TAIL` | Tailoring | | `HERD` | Herding | `TAST` | Taste Identification | | `HIDI` | Hiding | `THRO` | Throwing | | `IMBU` | Imbuing | `TINK` | Tinkering | | `INSC` | Inscription | `TRAC` | Tracking | | `ITEM` | Item Identification | `VETE` | Veterinary | | `LOCK` | Lockpicking | `WRES` | Wrestling | ## Example ```euo chooseskill mage if #Skill < 700 { display ok You need at least 70 Magery for this script. halt } display ok Enough Magery: let's go. halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # Click > Clicks the mouse at a position in the client window. - **Syntax:** `click {x} {y} [option...]` - **Needs a client:** yes - **Related:** event Drag, Move, #CursorX - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/click/ `click` sends mouse clicks to the client window at the given position. ## Parameters | Parameter | Meaning | |---|---| | `x`, `y` | Position in the client window, in pixels from its top-left corner. | | `option` | Any of the options below, in any order. | | Option | Effect | |---|---| | `d` | Double click. | | `x {count}` | Click `count` times. Combined with `d`, each of them is a double click. | | `r` | Use the right button. | | `f` | Fast: no pause before each click. Without it, each click waits 150 ms first. | | `g` | Press the button but don't release it: the start of a drag. | | `p` | Release the button without pressing it: the end of a drag. | | `n` | Neither press nor release. With `mc`, this only moves the cursor. | | `mc` | Move the real mouse cursor to the position first. | | `dmc` | Don't move the real mouse cursor. | Whether the real cursor moves by default depends on **Tools → Don't Move Cursor**, which is on by default. Some client actions, double clicks in particular, can be less reliable when the cursor does not move. To move items, [`event Drag`](https://ilpersi.github.io/EasyUOReforged/commands/event/drag/) is simpler and more reliable than `click g` and `click p`. ## Examples ```euo ; close the gump under 150,150 with a right click click 150 150 r ; drag something from 100,100 and drop it at 200,300 click 100 100 g wait 5 click 200 300 p halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # CmpPix > Runs a line or block depending on whether a saved pixel still has the same colour. - **Syntax:** `cmppix {slot} [t|f] [lines]` - **Needs a client:** yes - **Related:** SavePix, #PixCol - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/cmppix/ `cmppix` reads the pixel saved in a slot by [`savepix`](https://ilpersi.github.io/EasyUOReforged/commands/savepix/) again and compares it with the colour saved there. Depending on the result, it runs the next line or block, or skips it, like an [`if`](https://ilpersi.github.io/EasyUOReforged/commands/if/). ## Parameters | Parameter | Meaning | |---|---| | `slot` | The slot `savepix` used, `0` to `1000`. | | `t` / `f` | Optional. `t` (the default): run the next line or block when the colour is the **same**. `f`: run it when the colour is **different**. | | `lines` | Optional. Without a block, how many of the following lines are controlled. Default: 1. | As with `if`, a block's `{` has to be the very next line. Pixels are read from the screen, so the client window has to be visible, not covered by another window. ## Example ```euo ; wait until the colour at 580,13 changes, then press Alt+F4 savepix 580 13 1 check: cmppix 1 f { key F4 alt halt } wait 5 goto check ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # Continue > Skips the rest of the loop body and goes on with the next round of the loop. - **Syntax:** `continue` - **Needs a client:** no - **Related:** break, for, while, repeat - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/continue/ `continue` skips the rest of the body of the [`for`](https://ilpersi.github.io/EasyUOReforged/commands/for/), [`while`](https://ilpersi.github.io/EasyUOReforged/commands/while/) or [`repeat … until`](https://ilpersi.github.io/EasyUOReforged/commands/repeat/) loop it is in. The loop then goes on as if the body had ended: a `for` moves its counter to the next value, a `while` or an `until` tests its condition again. Only the innermost loop is affected. A `continue` outside any loop does nothing. ## Example ```euo for %i 1 10 { if %i % 2 = 1 continue ; skip the odd numbers event sysmessage %i is even } halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # ContPos > Moves the top gump to a position on the screen. - **Syntax:** `contpos {x} {y}` - **Needs a client:** yes - **Related:** #ContPosX, #ContPosY, NextCPos, IgnoreCont - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/contpos/ `contpos` moves the gump on top (the one the `#Cont…` variables describe) so that its top-left corner is at `x`, `y` in the client window. It does the same as setting [`#ContPosX`](https://ilpersi.github.io/EasyUOReforged/variables/contposx/) and [`#ContPosY`](https://ilpersi.github.io/EasyUOReforged/variables/contposy/). Gumps on the [`IgnoreCont`](https://ilpersi.github.io/EasyUOReforged/commands/ignorecont/) list are skipped when finding the top one. ## Example ```euo msg bank$ wait 20 contpos 10 10 halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # DeleteJournal > Hides the journal lines read so far from later scanjournal calls. - **Syntax:** `deletejournal` - **Needs a client:** yes - **Related:** ScanJournal, FindJournal, #JIndex, #Journal - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/deletejournal/ `deletejournal` hides the line last read by [`scanjournal`](https://ilpersi.github.io/EasyUOReforged/commands/scanjournal/), and every older line, from later `scanjournal` calls: they then read `N/A`. It marks text you have already handled, so it is not handled twice. > **Tip** > > Following [`#JIndex`](https://ilpersi.github.io/EasyUOReforged/variables/jindex/) is simpler and never skips or repeats a line, and > [`findjournal`](https://ilpersi.github.io/EasyUOReforged/commands/findjournal/) searches that way in one line. `deletejournal` is kept for older scripts. > Lines it hides are not searched by `findjournal` either. `deletejournal` takes no line number on purpose. If new lines arrive between `scanjournal` and `deletejournal`, every line moves up, and a number would point at the wrong one. `deletejournal` remembers which line `scanjournal` last read instead. ## Example Check the last 10 lines, oldest first, and answer each "hail" once: ```euo for %i 10 1 { scanjournal %i if hail in #Journal { msg Farewell$ deletejournal } } halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # DeleteVar > Obsolete: empties a % variable; set %x with no value does the same. - **Syntax:** `deletevar {name}` - **Needs a client:** no - **Obsolete.** - **Related:** Set, namespace clear - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/deletevar/ `deletevar` deletes the `%` variable with the given name, written **without** the `%`. Only `%` variables can be deleted this way. It is kept for older scripts: `set %name` with no value empties a variable just as well. ## Example ```euo set %test TEST deletevar test ; no % in front display ok %test ; N/A: the variable is gone set %test TEST set %test ; the same, the usual way display ok %test ; N/A again halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # Display > Shows a message box and waits for the user; the answer goes to #DispRes. - **Syntax:** `display [ok|okcancel|yesno|yesnocancel] {message}` - **Needs a client:** no - **Changed in Reforged:** see "Reforged notes" below. - **Sets:** #DispRes - **Related:** #DispRes, event SysMessage - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/display/ `display` shows a Windows message box with the message and waits until the user closes it. The button that was pressed goes into [`#DispRes`](https://ilpersi.github.io/EasyUOReforged/variables/dispres/). ## Parameters | Parameter | Meaning | |---|---| | buttons | Optional. `ok` (the default), `okcancel`, `yesno` or `yesnocancel`. | | `message` | The text. `$` starts a new line. | `#DispRes` is `Ok`, `Yes`, `No` or `Cancel`. Comparisons ignore case, so `#DispRes = yes` works. The script waits while the box is open, but the rest of EasyUO Reforged keeps working. ## Example ```euo display yesno You have run out of ingots.$Stop the script? if #DispRes = yes halt display ok Going on without ingots. halt ``` ## Reforged notes - The message box's title is *Reforged Message* instead of EasyUO 1.5's *EUO Message*. The buttons, the text and `#DispRes` are unchanged. A program that looks for the box by its title has to look for the new one. *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # Else > Runs a line or a block when the if before it was false. - **Syntax:** ``` else else {lines} ``` - **Needs a client:** no - **Related:** if - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/else/ `else` runs the line or block after it only when the [`if`](https://ilpersi.github.io/EasyUOReforged/commands/if/) before it was false. When the `if` was true, the script skips it. ## Parameters | Parameter | Meaning | |---|---| | `lines` | Optional. Without a block, how many of the following lines belong to the `else`. Default: 1. | ## Where it goes Put `else` right after the line or block of its `if`. Blank lines in between are fine; any other line in between breaks the pairing. A block is a `{` line, the lines to run, and a matching `}` line. The `{` has to be **the very next line**: a blank line or a comment in between means only that line belongs to the command, and the block after it runs every time. Braces go on lines of their own. ## Example ```euo set %a #false if %a display ok a is true else display ok a is false ; this one is shown halt ``` See [`if`](https://ilpersi.github.io/EasyUOReforged/commands/if/) for blocks, the line-count form and nesting. *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # event ContTop > Brings a gump to the front, counted from the top gump. - **Syntax:** `event ContTop {index}` - **Needs a client:** yes - **Related:** IgnoreCont, #ContName, ContPos - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/event/conttop/ `event ContTop` brings one of the open gumps to the front, as if you had clicked it. `index` counts the gumps from the top, the same way the `#Cont…` variables see them: `0` is the gump already on top, `1` the next one down, and so on. Gumps on the [`IgnoreCont`](https://ilpersi.github.io/EasyUOReforged/commands/ignorecont/) list are skipped. After it, the `#Cont…` variables describe the gump you brought forward. ## Example ```euo ; bring the second gump forward and see what it is event ContTop 1 wait 5 display ok Now on top: #ContName halt ``` ## Notes The command needs the client function it calls to be known for your client version. On a client where it is not, nothing happens. --- # event Drag > Picks up an item, as if you dragged it with the mouse. - **Syntax:** `event Drag {id}` - **Needs a client:** yes - **Related:** exevent Drag, Click, #LLiftedID - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/event/drag/ `event Drag` picks up the item with the given ID, as if you had started dragging it with the mouse. The item then hangs on the cursor until you drop it, for example with [`click`](https://ilpersi.github.io/EasyUOReforged/commands/click/) and `p`. - The item has to be known to the client: on screen, or in an open container. - Nothing happens while you are already holding something. To drop through the server instead, pick the item up with [`exevent Drag`](https://ilpersi.github.io/EasyUOReforged/commands/exevent/drag/), not `event Drag`: mixing `event Drag` with the `exevent Drop…` commands can leave a ghost item on the cursor. The command calls a function inside the client. On a client version where that function's address is not known, it does nothing. ## Example ```euo finditem DWJ_EWJ_GWJ_TVJ C_ , #BackpackID ; ore set %ore #FindID event Drag %ore wait 20 click 100 100 p halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # event ExMsg > Shows a message above an object, in a chosen font and colour. - **Syntax:** `event ExMsg {id} {font} {colour} {message}` - **Needs a client:** yes - **Related:** event SysMessage, #CharID - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/event/exmsg/ `event ExMsg` shows a message above an object or character, like the text that appears above people when they speak. Only you see it; nothing is sent to the server. ## Parameters | Parameter | Meaning | |---|---| | `id` | The object or character, for example [`#CharID`](https://ilpersi.github.io/EasyUOReforged/variables/charid/) for yourself. | | `font` | Font number, see the table below. | | `colour` | Colour (hue) number. `0` is the default. | | `message` | The text. `$` starts a new line. | | Font | Look | |---|---| | 0 | Big, with dark edges. | | 1 | Small, with a white drop shadow. | | 2 | Big, with a white drop shadow. | | 3 | Small, with dark edges. | | 4 | Big and fancy. | | 5 | Medium. | | 6 | Tiny. | | 7 | Small, recessed. | | 8 | Runic letters for A–Z and some symbols; moon phases for a few others. | | 9 | Tiny. | The command calls a function inside the client. On a client version where that function's address is not known, it does nothing. ## Example ```euo event ExMsg #CharID 3 0 Welcome to my world! halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # Event > Makes the client do something with its own internal functions: macros, dragging, messages and more. - **Syntax:** `event {type} [parameters...]` - **Needs a client:** yes - **Related:** ExEvent, event Macro - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/event/ `event` makes the client do something by calling its own internal functions, as if you had done it in the client yourself: run one of its macros, pick up an item, show a message, walk to a spot. Because the client does the work, what it shows stays in step with what it does. | Command | What it does | |---|---| | [event ContTop](https://ilpersi.github.io/EasyUOReforged/commands/event/conttop/) | Brings a gump to the front. | | [event Drag](https://ilpersi.github.io/EasyUOReforged/commands/event/drag/) | Picks up an item, as if dragged with the mouse. | | [event ExMsg](https://ilpersi.github.io/EasyUOReforged/commands/event/exmsg/) | Shows a message above an object. | | [event Macro](https://ilpersi.github.io/EasyUOReforged/commands/event/macro/) | Runs one of the client's built-in macros. | | [event PathFind](https://ilpersi.github.io/EasyUOReforged/commands/event/pathfind/) | Walks to a nearby spot, finding a way around obstacles. | | [event Property](https://ilpersi.github.io/EasyUOReforged/commands/event/property/) | Reads an item's property tooltip into `#Property`. | | [event SkillLock](https://ilpersi.github.io/EasyUOReforged/commands/event/skilllock/) | Sets a skill's lock; the same as `exevent SkillLock`. | | [event Sleep](https://ilpersi.github.io/EasyUOReforged/commands/event/sleep/) | Not implemented in EasyUO Reforged. | | [event StatBar](https://ilpersi.github.io/EasyUOReforged/commands/event/statbar/) | Opens a character's health bar. | | [event SysMessage](https://ilpersi.github.io/EasyUOReforged/commands/event/sysmessage/) | Shows a system message in the client. | Every `event` type needs at least one parameter after it. Each one calls a function inside the client. On a client version where that function's address is not known, the command does nothing rather than risk the client. [`exevent`](https://ilpersi.github.io/EasyUOReforged/commands/exevent/) commands work differently: they send packets to the server directly. *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # event Macro > Runs one of the client's built-in macros: speech, gumps, skills, spells, targeting, dress sets, potions. - **Syntax:** `event Macro {macro} [parameter] [text]` - **Needs a client:** yes - **Related:** #LObjectID, #LTargetID, #LTargetKind, #LSkill, #LSpell, #LHandID, #RHandID, Target, Msg - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/event/macro/ `event Macro` makes the client run one of its built-in macros, the same ones you can bind to keys in the client's options: speak, open a gump, use a skill, cast a spell, target, and so on. ## Parameters | Parameter | Meaning | |---|---| | `macro` | Which macro, `1` to `67`: see the tables below. Any other number does nothing. | | `parameter` | Optional. Selects a variant: which gump to open, which skill or spell. Default: `0`. Macros without variants ignore it. | | `text` | Optional. Only macros `1` to `4` (speech), `28`, `38` and `39` read it. When you give text, write the `parameter` too, even if it is `0`. | The macros that use something "last" ([`#LObjectID`](https://ilpersi.github.io/EasyUOReforged/variables/lobjectid/), [`#LTargetID`](https://ilpersi.github.io/EasyUOReforged/variables/ltargetid/), [`#LSkill`](https://ilpersi.github.io/EasyUOReforged/variables/lskill/), [`#LSpell`](https://ilpersi.github.io/EasyUOReforged/variables/lspell/), [`#LHandID`](https://ilpersi.github.io/EasyUOReforged/variables/lhandid/), [`#RHandID`](https://ilpersi.github.io/EasyUOReforged/variables/rhandid/)) read those variables, so set them first to choose what the macro acts on. The command calls a function inside the client. On a client version where that function's address is not known, it does nothing. ## Macro numbers ### Speech | Macro | Parameter | Text | Description | |---|---|---|---| | 1 | 0 | text | Say | | 2 | 0 | text | Emote | | 3 | 0 | text | Whisper | | 4 | 0 | text | Yell | The parameter is not used. The client sends these lines no faster than typed speech: see [the spam limit](https://ilpersi.github.io/EasyUOReforged/commands/msg/#the-spam-limit). ### Movement | Macro | Parameter | Description | |---|---|---| | 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 | One step in that direction. The parameter is [`#CharDir`](https://ilpersi.github.io/EasyUOReforged/variables/chardir/) plus one: north is `1` here and `0` there, north-west `0` here and `7` there. If your character is following someone, it stops first. ### War/Peace & Paste | Macro | Parameter | Description | |---|---|---| | 6 | 0 | Toggle war/peace | | 7 | 0 | Paste the clipboard | ### Gump Control Macros `8` to `11` open, close, minimize and maximize a gump. The parameter says which: | Parameter | Gump | Open (8) | Close (9) | Minimize (10) | Maximize (11) | |---|---|---|---|---|---| | 0 | Configuration | yes | yes | closes it | opens it | | 1 | Paperdoll | yes | yes | yes | yes | | 2 | Status | yes | yes | yes | yes | | 3 | Journal | yes | yes | yes | yes | | 4 | Skills | yes | yes | yes | yes | | 5 | Spellbook (Magery) | yes | yes | yes | yes | | 6 | Chat (the old chat) | — | yes | yes | yes | | 7 | Backpack | yes | yes | yes | yes | | 8 | Overview | yes | yes | yes | yes | | 9 | Mail | yes | yes | yes | yes | | 10 | Party Manifest | yes | yes | closes it | opens it | | 11 | Party Chat | yes | — | yes | yes | | 12 | Necro Spellbook | yes | yes | yes | yes | | 13 | Paladin Spellbook | yes | yes | yes | yes | | 14 | Combat Book | yes | yes | yes | yes | | 15 | Bushido Spellbook | yes | yes | yes | yes | | 16 | Ninjitsu Spellbook | yes | yes | yes | yes | | 17 | Guild | yes | — | — | — | | 18 | Spellweaving Spellbook | yes | yes | yes | yes | | 19 | Questlog | yes | — | — | — | | 20 | Mysticism Spellbook | yes | yes | yes | yes | | 21 | Racial Abilities Book | yes | yes | yes | yes | | 22 | Bard Spellbook (Masteries) | yes | yes | yes | yes | | 23 | Global Chat | yes | yes | yes | yes | "—" means the client does nothing for that combination. Close, minimize and maximize act on the gump only while it is open. Opening the status (`2`) or skills (`4`) gump also asks the server for fresh values. ### Open Door | Macro | Parameter | Description | |---|---|---| | 12 | 0 | Open the door next to you | ### Use Skills | Macro | Parameter | Description | |---|---|---| | 13 | 1 | Use Skill Anatomy | | 13 | 2 | Use Skill Animal Lore | | 13 | 35 | Use Skill Animal Taming | | 13 | 4 | Use Skill Arms Lore | | 13 | 6 | Use Skill Begging | | 13 | 12 | Use Skill Cartography | | 13 | 14 | Use Skill Detecting Hidden | | 13 | 15 | Use Skill Discordance | | 13 | 16 | Use Skill Evaluating Intelligence | | 13 | 19 | Use Skill Forensic Evaluation | | 13 | 21 | Use Skill Hiding | | 13 | 23 | Use Skill Inscription | | 13 | 3 | Use Skill Item Identification | | 13 | 46 | Use Skill Meditation | | 13 | 9 | Use Skill Peacemaking | | 13 | 30 | Use Skill Poisoning | | 13 | 22 | Use Skill Provocation | | 13 | 48 | Use Skill Remove Trap | | 13 | 32 | Use Skill Spirit Speak | | 13 | 33 | Use Skill Stealing | | 13 | 47 | Use Skill Stealth | | 13 | 36 | Use Skill Taste Identification | | 13 | 38 | Use Skill Tracking | | 13 | 56 | Use Skill Imbuing | | 14 | 0 | Last Skill: uses [`#LSkill`](https://ilpersi.github.io/EasyUOReforged/variables/lskill/) again | The parameter is the skill's number, sent to the server as it is. The list shows the skills that can be used; the server refuses the others. ### Casting | Macro | Parameter | Description | |---|---|---| | 15 | spell | Cast the spell: the numbers are under [Spells](#spells) | | 16 | 0 | Last Spell: casts [`#LSpell`](https://ilpersi.github.io/EasyUOReforged/variables/lspell/) again | ### Miscellaneous | Macro | Parameter | Text | Description | |---|---|---|---| | 17 | 0 | | Last Object: double-clicks [`#LObjectID`](https://ilpersi.github.io/EasyUOReforged/variables/lobjectid/) | | 18 | 0 | | Bow | | 19 | 0 | | Salute | | 20 | 0 | | Quit Game: opens the "Quit Ultima Online?" box | | 21 | 0 | | All Names: shows the names of the mobiles and corpses on screen | | 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: selects the next mobile on screen, one after the other | | 27 | 0 | | Attack Last: attacks [`#LTargetID`](https://ilpersi.github.io/EasyUOReforged/variables/ltargetid/) | | 28 | 0 | number | Delay | | 29 | 0 | | Circletrans: toggles the circle of transparency | | 31 | 0 | | Close Gumps | | 32 | 0 | | Always Run: toggles it | | 33 | 0 | | Save Desktop | | 34 | 0 | | Kill Gump Open: cancels the containers still waiting to open | | 35 | 0 | | Primary Ability: your weapon's primary special move | | 36 | 0 | | Secondary Ability: your weapon's secondary special move | | 37 | 0 | | Equip Last Weapon | - **Last Target** (`22`) and **Target Self** (`23`) only work while a target cursor is up. Last Target targets what [`#LTargetKind`](https://ilpersi.github.io/EasyUOReforged/variables/ltargetkind/) says: `1` the object [`#LTargetID`](https://ilpersi.github.io/EasyUOReforged/variables/ltargetid/), `2` the ground at [`#LTargetX`](https://ilpersi.github.io/EasyUOReforged/variables/ltargetx/), [`#LTargetY`](https://ilpersi.github.io/EasyUOReforged/variables/ltargety/), [`#LTargetZ`](https://ilpersi.github.io/EasyUOReforged/variables/ltargetz/), `3` the static [`#LTargetTile`](https://ilpersi.github.io/EasyUOReforged/variables/ltargettile/) at that spot. - **Arm/Disarm** (`24`): `1` is the left hand (shield or two-handed weapon), `2` the right hand. With something in that hand, the client saves its ID in [`#LHandID`](https://ilpersi.github.io/EasyUOReforged/variables/lhandid/) or [`#RHandID`](https://ilpersi.github.io/EasyUOReforged/variables/rhandid/) and takes it off; with the hand empty, it equips the item whose ID is saved there. - **Wait For Target** (`25`) and **Delay** (`28`) only affect the macro sequences the client plays itself. From a script they have no visible effect: use [`Target`](https://ilpersi.github.io/EasyUOReforged/commands/target/) and [`Wait`](https://ilpersi.github.io/EasyUOReforged/commands/wait/) instead. - `30` is in the client's list of macros, but the client does nothing for it. ### Client's Range Control | Macro | Parameter | Text | Description | |---|---|---|---| | 38 | 0 | number | Set Update Range to the number | | 39 | 0 | number | Modify Update Range: adds the number (negative lowers it) | | 40 | 0 | | Increase Update Range by 1 | | 41 | 0 | | Decrease Update Range by 1 | | 42 | 0 | | Maximum Update Range: 24 if the game window is bigger than 800×600, otherwise 18 | | 43 | 0 | | Minimum Update Range: 5 | | 44 | 0 | | Default Update Range: the same as `42` | | 45 | 0 | | Update Range Info: shows the current range in the system messages | | 46 | 0 | | Enable Update Range Color | | 47 | 0 | | Disable Update Range Color | | 48 | 0 | | Toggle Update Range Color | ### Invoke Virtues | Macro | Parameter | Description | |---|---|---| | 49 | 1 | Invoke Honor Virtue | | 49 | 2 | Invoke Sacrifice Virtue | | 49 | 3 | Invoke Valor Virtue | These are the virtues the client offers. It sends any other number to the server as it is: what that does depends on the server. ### Targeting System | Macro | Parameter | Description | |---|---|---| | 50 | 1-5\* | select next | | 51 | 1-5\* | select previous | | 52 | 1-5\* | select nearest | | 53 | 0 | attack selected | | 54 | 0 | use selected: double-clicks it | | 55 | 0 | current target: targets the selected one, while a target cursor is up | | 56 | 0 | targeting system on/off | | 57 | 0 | toggle buff window (open/close), see [`#BuffBarOpen`](https://ilpersi.github.io/EasyUOReforged/variables/buffbaropen/) | | 58 | 0 | bandage self | | 59 | 0 | bandage target: bandages the selected one | The targeting system macros set [`#LTargetID`](https://ilpersi.github.io/EasyUOReforged/variables/ltargetid/) and show the current target's health bar. \*Parameter 2 chooses what to cycle through: `1` hostile, `2` party members, `3` followers, `4` objects, `5` mobiles. `0` is the same as `1`. While the targeting system is off (`56`), macros `50` to `55`, `58` and `59` do nothing. While you are dragging an item, `50` to `55` do nothing either. The bandage macros use a bandage from your backpack. ### Gargoyle | Macro | Parameter | Description | |---|---|---| | 60 | 0 | toggle gargoyle fly (gargoyles only) | ### Dress and Arm Sets | Macro | Parameter | Description | |---|---|---| | 61 | 1-4 | Record Dress: saves what you wear now as that dress set | | 62 | 0 | Undress: takes off what you wear | | 63 | 1-4 | Dress: puts on the items of that dress set | | 64 | 1-4 | Record Arm: saves what you hold in both hands as that arm set | | 65 | 0 | Disarm: takes off what you hold in both hands | | 66 | 1-4 | Arm: equips the items of that arm set | The client keeps four dress sets and four arm sets in its macros file, so they last after a restart. A dress set holds your clothes, armor and jewelry, not what you hold, your hair or your backpack. Undress also leaves your hands as they are. The sets save item IDs: they work with those very items. ### Use Object | Macro | Parameter | Description | |---|---|---| | 67 | 1 | Heal potion: greater, else normal, else lesser | | 67 | 2 | Cure potion: greater, else normal, else lesser | | 67 | 3 | Refresh potion: greater (total refresh), else normal | | 67 | 4 | Strength potion: greater, else normal | | 67 | 5 | Agility potion: greater, else normal | | 67 | 6 | Explosion potion: greater, else normal, else lesser | | 67 | 7 | Conflagration potion: greater, else normal | | 67 | 8 | Enchanted apple | | 67 | 9 | Petal of the Rose of Trinsic | | 67 | 10 | Orange petals | | 67 | 11 | Trapped box: a small crate or wooden box | | 67 | 12 | Smoke bomb | | 67 | 13 | Healing stone | | 67 | 14 | Spell stone (Spell Trigger) | The client looks for the item in your backpack, not in the bags inside it, and double-clicks it. It finds the items by name; for the trapped box it takes any small crate or wooden box, trapped or not. Arm/Disarm (`24`), the bandage macros (`58`, `59`) and macros `61` to `67` do nothing while you are dragging an item. ## Spells `event Macro 15` casts the spell with the number in these tables. *Words* are the words of power the client's spellbook shows; the words your character says aloud come from the server, and some servers use other ones. [`#LSpell`](https://ilpersi.github.io/EasyUOReforged/variables/lspell/) and `event Macro 16` use the client's own numbers, which differ in three schools: Magery counts from `1` there (Clumsy is `1`, Water Elemental `64`), Bushido from `401` and Ninjitsu from `501`. `event Macro 15` accepts Bushido and Ninjitsu either way. ### Magery | Parameter | Spell | Words | Reagents | |---|---|---|---| | 0 | Clumsy | Uus Jux | Bloodmoss, Nightshade | | 1 | Create Food | In Mani Ylem | Garlic, Ginseng, Mandrake Root | | 2 | Feeblemind | Rel Wis | Ginseng, Nightshade | | 3 | Heal | In Mani | Garlic, Ginseng, Spiders' Silk | | 4 | Magic Arrow | In Por Ylem | Sulfurous Ash | | 5 | Night Sight | In Lor | Spiders' Silk, Sulfurous Ash | | 6 | Reactive Armor | Sanct Flam | Garlic, Sulfurous Ash, Spiders' Silk | | 7 | Weaken | Des Mani | Garlic, Nightshade | | 8 | Agility | Ex Uus | Bloodmoss, Mandrake Root | | 9 | Cunning | Uus Wis | Mandrake Root, Nightshade | | 10 | Cure | An Nox | Garlic, Ginseng | | 11 | Harm | An Mani | Nightshade, Spiders' Silk | | 12 | Magic Trap | In Jux | Garlic, Sulfurous Ash, Spiders' Silk | | 13 | Magic Untrap | An Jux | Bloodmoss, Sulfurous Ash | | 14 | Protection | Uus Sanct | Garlic, Ginseng, Sulfurous Ash | | 15 | Strength | Uus Mani | Mandrake Root, Nightshade | | 16 | Bless | Rel Sanct | Garlic, Mandrake Root | | 17 | Fireball | Vas Flam | Black Pearl | | 18 | Magic Lock | An Por | Sulfurous Ash, Bloodmoss, Garlic | | 19 | Poison | In Nox | Nightshade | | 20 | Telekinesis | Ort Por Ylem | Bloodmoss, Mandrake Root | | 21 | Teleport | Rel Por | Bloodmoss, Mandrake Root | | 22 | Unlock | Ex Por | Bloodmoss, Sulfurous Ash | | 23 | Wall of Stone | In Sanct Ylem | Bloodmoss, Garlic | | 24 | Arch Cure | Vas An Nox | Garlic, Ginseng, Mandrake Root | | 25 | Arch Protection | Vas Uus Sanct | Garlic, Ginseng, Mandrake Root, Sulfurous Ash | | 26 | Curse | Des Sanct | Garlic, Nightshade, Sulfurous Ash | | 27 | Fire Field | In Flam Grav | Black Pearl, Spiders' Silk, Sulfurous Ash | | 28 | Greater Heal | In Vas Mani | Garlic, Ginseng, Mandrake Root, Spiders' Silk | | 29 | Lightning | Por Ort Grav | Mandrake Root, Sulfurous Ash | | 30 | Mana Drain | Ort Rel | Black Pearl, Mandrake Root, Spiders' Silk | | 31 | Recall | Kal Ort Por | Black Pearl, Bloodmoss, Mandrake Root | | 32 | Blade Spirits | In Jux Hur Ylem | Black Pearl, Mandrake Root, Nightshade | | 33 | Dispel Field | An Grav | Garlic, Black Pearl, Spiders' Silk, Sulfurous Ash | | 34 | Incognito | Kal In Ex | Bloodmoss, Garlic, Nightshade | | 35 | Magic Reflection | In Jux Sanct | Garlic, Mandrake Root, Spiders' Silk | | 36 | Mind Blast | Por Corp Wis | Black Pearl, Mandrake Root, Nightshade, Sulfurous Ash | | 37 | Paralyze | An Ex Por | Garlic, Mandrake Root, Spiders' Silk | | 38 | Poison Field | In Nox Grav | Black Pearl, Nightshade, Spiders' Silk | | 39 | Summon Creature | Kal Xen | Bloodmoss, Mandrake Root, Spiders' Silk | | 40 | Dispel | An Ort | Garlic, Mandrake Root, Sulfurous Ash | | 41 | Energy Bolt | Corp Por | Black Pearl, Nightshade | | 42 | Explosion | Vas Ort Flam | Bloodmoss, Mandrake Root | | 43 | Invisibility | An Lor Xen | Bloodmoss, Nightshade | | 44 | Mark | Kal Por Ylem | Black Pearl, Bloodmoss, Mandrake Root | | 45 | Mass Curse | Vas Des Sanct | Garlic, Mandrake Root, Nightshade, Sulfurous Ash | | 46 | Paralyze Field | In Ex Grav | Black Pearl, Ginseng, Spiders' Silk | | 47 | Reveal | Wis Quas | Bloodmoss, Sulfurous Ash | | 48 | Chain Lightning | Vas Ort Grav | Black Pearl, Mandrake Root, Bloodmoss, Sulfurous Ash | | 49 | Energy Field | In Sanct Grav | Black Pearl, Mandrake Root, Spiders' Silk, Sulfurous Ash | | 50 | Flame Strike | Kal Vas Flam | Spiders' Silk, Sulfurous Ash | | 51 | Gate Travel | Vas Rel Por | Black Pearl, Mandrake Root, Sulfurous Ash | | 52 | Mana Vampire | Ort Sanct | Black Pearl, Bloodmoss, Mandrake Root, Spiders' Silk | | 53 | Mass Dispel | Vas An Ort | Black Pearl, Garlic, Mandrake Root, Sulfurous Ash | | 54 | Meteor Swarm | Kal Des Flam Ylem | Bloodmoss, Spiders' Silk, Mandrake Root, Sulfurous Ash | | 55 | Polymorph | Vas Ylem Rel | Bloodmoss, Mandrake Root, Spiders' Silk | | 56 | Earthquake | In Vas Por | Bloodmoss, Ginseng, Mandrake Root, Sulfurous Ash | | 57 | Energy Vortex | Vas Corp Por | Black Pearl, Bloodmoss, Mandrake Root, Nightshade | | 58 | Resurrection | An Corp | Bloodmoss, Garlic, Ginseng | | 59 | Air Elemental | Kal Vas Xen Hur | Bloodmoss, Mandrake Root, Spiders' Silk | | 60 | Summon Daemon | Kal Vas Xen Daem | Bloodmoss, Mandrake Root, Spiders' Silk, Sulfurous Ash | | 61 | Earth Elemental | Kal Vas Xen Tera | Bloodmoss, Mandrake Root, Spiders' Silk | | 62 | Fire Elemental | Kal Vas Xen Flam | Bloodmoss, Mandrake Root, Spiders' Silk, Sulfurous Ash | | 63 | Water Elemental | Kal Vas Xen Aqua | Bloodmoss, Mandrake Root, Spiders' Silk | ### Necromancy | Parameter | Spell | Words | Reagents | |---|---|---|---| | 101 | Animate Dead | Uus Corp | Daemon Blood, Grave Dust | | 102 | Blood Oath | In Jux Mani Xen | Daemon Blood | | 103 | Corpse Skin | In Aglo Corp Ylem | Batwing, Grave Dust | | 104 | Curse Weapon | An Sanct Gra Char | Pig Iron | | 105 | Evil Omen | Pas Tym An Sanct | Batwing, Nox Crystal | | 106 | Horrific Beast | Rel Xen Vas Bal | Batwing, Daemon Blood | | 107 | Lich Form | Rel Xen Corp Ort | Nox Crystal, Daemon Blood, Grave Dust | | 108 | Mind Rot | Wis An Ben | Batwing, Daemon Blood, Pig Iron | | 109 | Pain Spike | In Sar | Grave Dust, Pig Iron | | 110 | Poison Strike | In Vas Nox | Nox Crystal | | 111 | Strangle | In Bal Nox | Nox Crystal, Daemon Blood | | 112 | Summon Familiar | Kal Xen Bal | Batwing, Grave Dust, Daemon Blood | | 113 | Vampiric Embrace | Rel Xen An Sanct | Batwing, Nox Crystal, Pig Iron | | 114 | Vengeful Spirit | Kal Xen Bal Beh | Batwing, Grave Dust, Pig Iron | | 115 | Wither | Kal Vas An Flam | Nox Crystal, Grave Dust, Pig Iron | | 116 | Wraith Form | Rel Xen Um | Nox Crystal, Pig Iron | | 117 | Exorcism | Ort Corp Grav | Nox Crystal, Grave Dust | ### Chivalry | Parameter | Spell | Words | Reagents | |---|---|---|---| | 201 | Cleanse by Fire | Expor Flamus | — | | 202 | Close Wounds | Obsu Vulni | — | | 203 | Consecrate Weapon | Consecrus Arma | — | | 204 | Dispel Evil | Dispiro Malas | — | | 205 | Divine Fury | Divinum Furis | — | | 206 | Enemy of One | Forul Solum | — | | 207 | Holy Light | Augus Luminos | — | | 208 | Noble Sacrifice | Dium Prostra | — | | 209 | Remove Curse | Extermo Vomica | — | | 210 | Sacred Journey | Sanctum Viatas | — | ### Bushido | Parameter | Spell | Words | Reagents | |---|---|---|---| | 145 or 401 | Honorable Execution | — | — | | 146 or 402 | Confidence | — | — | | 147 or 403 | Evasion | — | — | | 148 or 404 | Counter Attack | — | — | | 149 or 405 | Lightning Strike | — | — | | 150 or 406 | Momentum Strike | — | — | ### Ninjitsu | Parameter | Spell | Words | Reagents | |---|---|---|---| | 245 or 501 | Focus Attack | — | — | | 246 or 502 | Death Strike | — | — | | 247 or 503 | Animal Form | — | — | | 248 or 504 | Ki Attack | — | — | | 249 or 505 | Surprise Attack | — | — | | 250 or 506 | Backstab | — | — | | 251 or 507 | Shadowjump | — | — | | 252 or 508 | Mirror Image | — | — | ### Spellweaving | Parameter | Spell | Words | Reagents | |---|---|---|---| | 601 | Arcane Circle | Myrshalee | — | | 602 | Gift of Renewal | Olorisstra | — | | 603 | Immolating Weapon | Thalshara | — | | 604 | Attunement | Haeldril | — | | 605 | Thunderstorm | Erelonia | — | | 606 | Nature's Fury | Rauvvrae | — | | 607 | Summon Fey | Alalithra | — | | 608 | Summon Fiend | Nylisstra | — | | 609 | Reaper Form | Tarisstree | — | | 610 | Wildfire | Haelyn | — | | 611 | Essence of Wind | Anathrae | — | | 612 | Dryad Allure | Rathril | — | | 613 | Ethereal Voyage | Orlavdra | — | | 614 | Word of Death | Nyraxle | — | | 615 | Gift of Life | Illorae | — | | 616 | Arcane Empowerment | Aslavdra | — | ### Mysticism | Parameter | Spell | Words | Reagents | |---|---|---|---| | 678 | Nether Bolt | In Corp Ylem | Black Pearl, Sulfurous Ash | | 679 | Healing Stone | Kal In Mani | Bone, Garlic, Ginseng, Spiders' Silk | | 680 | Purge Magic | An Ort Sanct | Fertile Dirt, Garlic, Mandrake Root, Sulfurous Ash | | 681 | Enchant | In Ort Ylem | Spiders' Silk, Mandrake Root, Sulfurous Ash | | 682 | Sleep | In Zu | Nightshade, Spiders' Silk, Black Pearl | | 683 | Eagle Strike | Kal Por Xen | Bloodmoss, Bone, Spiders' Silk, Mandrake Root | | 684 | Animated Weapon | In Jux Por Ylem | Bone, Black Pearl, Mandrake Root, Nightshade | | 685 | Stone Form | In Rel Ylem | Bloodmoss, Fertile Dirt, Garlic | | 686 | Spell Trigger | In Vas Ort Ex | Dragon's Blood, Garlic, Mandrake Root, Spiders' Silk | | 687 | Mass Sleep | Vas Zu | Ginseng, Nightshade, Spiders' Silk | | 688 | Cleansing Winds | In Vas Mani Hur | Dragon's Blood, Garlic, Ginseng, Mandrake Root | | 689 | Bombard | Corp Por Ylem | Bloodmoss, Dragon's Blood, Garlic, Sulfurous Ash | | 690 | Spell Plague | Vas Rel Jux Ort | Daemon Bone, Dragon's Blood, Nightshade, Sulfurous Ash | | 691 | Hail Storm | Kal Des Ylem | Dragon's Blood, Bloodmoss, Black Pearl, Mandrake Root | | 692 | Nether Cyclone | Grav Hur | Mandrake Root, Nightshade, Sulfurous Ash, Bloodmoss | | 693 | Rising Colossus | Kal Vas Xen Corp Ylem | Daemon Bone, Dragon's Blood, Fertile Dirt, Nightshade | ### Masteries | Parameter | Spell | Words | Reagents | |---|---|---|---| | 701 | Inspire | Uus Por | — | | 702 | Invigorate | An Zu | — | | 703 | Resilience | Kal Mani Tym | — | | 704 | Perseverance | Uus Jux Sanct | — | | 705 | Tribulation | In Jux Hur Rel | — | | 706 | Despair | Kal Des Mani Tym | — | | 707 | Death Ray | In Grav Corp | Black Pearl, Bloodmoss, Spiders' Silk | | 708 | Ethereal Burst | Uus Ort Grav | Bloodmoss, Ginseng, Mandrake Root | | 709 | Nether Blast | In Vas Xen Por | Dragon's Blood, Daemon Bone | | 710 | Mystic Weapon | Vas Ylem Wis | Fertile Dirt, Bone | | 711 | Command Undead | In Corp Xen Por | Daemon Blood, Pig Iron, Batwing | | 712 | Conduit | Uus Corp Grav | Nox Crystal, Batwing, Grave Dust | | 713 | Mana Shield | Faerkulggen | — | | 714 | Summon Reaper | Lartarisstree | — | | 715 | Enchanted Summoning (passive) | — | — | | 716 | Anticipate Hit (passive) | — | — | | 717 | Warcry | — | — | | 718 | Intuition (passive) | — | — | | 719 | Rejuvenate | — | — | | 720 | Holy Fist | — | — | | 721 | Shadow | — | — | | 722 | White Tiger Form | — | — | | 723 | Flaming Shot | — | — | | 724 | Playing The Odds | — | — | | 725 | Thrust | — | — | | 726 | Pierce | — | — | | 727 | Stagger | — | — | | 728 | Toughness | — | — | | 729 | Onslaught | — | — | | 730 | Focused Eye | — | — | | 731 | Elemental Fury | — | — | | 732 | Called Shot | — | — | | 733 | Warrior's Gifts (passive) | — | — | | 734 | Shield Bash | — | — | | 735 | Bodyguard | — | — | | 736 | Heighten Senses | — | — | | 737 | Tolerance | — | — | | 738 | Injected Strike | — | — | | 739 | Potency (passive) | — | — | | 740 | Rampage | — | — | | 741 | Fists of Fury | — | — | | 742 | Knockout (passive) | — | — | | 743 | Whispering | — | — | | 744 | Combat Training | — | — | | 745 | Boarding (passive) | — | — | ## Examples ```euo event Macro 1 0 Hello everyone ; say event Macro 8 7 ; open the backpack event Macro 15 50 ; cast Flame Strike halt ``` Dig with a shovel at a spot on the ground: ```euo finditem TWF_WWF C_ , #BackpackID ; a shovel set %shovel #FindID set #LObjectID %shovel event Macro 17 0 ; use the last object: the shovel target 5s set #LTargetX 1000 set #LTargetY 1000 set #LTargetZ #CharPosZ set #LTargetKind 2 event Macro 22 0 ; target the last target: the ground at 1000,1000 halt ``` Swap to a saved set of clothes and back, and drink a heal potion: ```euo event Macro 61 1 ; save what you wear now as dress set 1 event Macro 62 0 ; undress wait 2s event Macro 63 1 ; dress set 1 again event Macro 67 1 ; drink the best heal potion in the backpack halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # event PathFind > Walks to a nearby spot, letting the client find a way around obstacles. - **Syntax:** `event PathFind {x} {y} [z]` - **Needs a client:** yes - **Related:** Path, Move, #CharPosX, #CharPosY, #SCnt - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/event/pathfind/ `event PathFind` makes the client walk your character to a world position, finding a way around walls and obstacles. ## Parameters | Parameter | Meaning | |---|---| | `x`, `y` | World position, as in [`#CharPosX`](https://ilpersi.github.io/EasyUOReforged/variables/charposx/) and [`#CharPosY`](https://ilpersi.github.io/EasyUOReforged/variables/charposy/). | | `z` | Optional height. Default: your current [`#CharPosZ`](https://ilpersi.github.io/EasyUOReforged/variables/charposz/). | ## Details - **The script does not wait** for the character to arrive. To wait, compare `#CharPosX` and `#CharPosY` with the target in a loop, with a timeout. - **It only reaches spots within about one screen.** For longer trips, walk in several steps: [`path find`](https://ilpersi.github.io/EasyUOReforged/commands/path/find/) plans the whole route, and its steps are good stops along the way; [`path go`](https://ilpersi.github.io/EasyUOReforged/commands/path/go/) walks it that way by itself. - When the client cannot find a way, it says so in the journal and the character does not move. The command calls a function inside the client. On a client version where that function's address is not known, it does nothing. ## Example Walk to a spot and wait up to 10 seconds to get there: ```euo set %x 1450 set %y 1630 event PathFind %x %y set %until #SCnt + 10 while #CharPosX <> %x || #CharPosY <> %y { if #SCnt > %until break wait 5 } halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # event Property > Reads the property tooltip of an item or character into #Property. - **Syntax:** `event Property {id}` - **Needs a client:** yes - **Sets:** #Property - **Related:** FindItem, #Property - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/event/property/ `event Property` reads the property tooltip of an item or character, the text that pops up when you hover over it, and puts it in [`#Property`](https://ilpersi.github.io/EasyUOReforged/variables/property/). Each line ends with `$`, the name first. The shard has to send property tooltips: on pre-AoS free shards there are none, and `#Property` stays empty. The command calls a function inside the client. On a client version where that function's address is not known, it does nothing. ## Example ```euo set %sword NMH ; katanas finditem %sword C_ , #BackpackID event Property #FindID if Vanquishing in #Property display ok This sword is of Vanquishing. halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # event SkillLock > Sets the lock of a skill, or of all skills; the same as exevent SkillLock. - **Syntax:** `event SkillLock {skill|all} {up|down|locked}` - **Needs a client:** yes - **Related:** exevent SkillLock, ChooseSkill, #SkillLock - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/event/skilllock/ `event SkillLock` sets whether a skill may go up, go down, or stay where it is. It does exactly the same as [`exevent SkillLock`](https://ilpersi.github.io/EasyUOReforged/commands/exevent/skilllock/): EasyUO forwards it there, so both names keep working. ## Parameters | Parameter | Meaning | |---|---| | `skill` | The skill's code, the first four letters of its name, or `all` for every skill. See [`chooseskill`](https://ilpersi.github.io/EasyUOReforged/commands/chooseskill/#skill-codes) for the codes. | | lock | `up`, `down` or `locked`. | ## Example ```euo event SkillLock mage down event SkillLock all locked halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # event Sleep > Not implemented in EasyUO Reforged: accepted, but does nothing. - **Syntax:** `event Sleep {milliseconds}` - **Needs a client:** yes - **Related:** Wait, Sleep - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/event/sleep/ > **Caution: Not implemented in EasyUO Reforged** > > EasyUO Reforged accepts `event Sleep` but does nothing with it: the interpreter has no handler for it, so the > client is not suspended. Use [`wait`](https://ilpersi.github.io/EasyUOReforged/commands/wait/) or [`sleep`](https://ilpersi.github.io/EasyUOReforged/commands/sleep/) to pause the script. In the original documentation, `event Sleep` suspended the client itself for the given number of milliseconds: it stopped responding, but used no CPU. *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # event StatBar > Opens the health bar of a character by its ID. - **Syntax:** `event StatBar {id}` - **Needs a client:** yes - **Related:** #ContHP, #EnemyID, FindItem - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/event/statbar/ `event StatBar` opens the status bar (health bar) of the character with the given ID, like dragging it off the character with the mouse. The character has to be known to the client, which usually means on screen. ## Example ```euo ; open your pet's health bar and read its health set %petid ABCDEFG ; your pet's ID event StatBar %petid wait 10 display ok Pet health: #ContHP percent halt ``` ## Notes The command needs the client function it calls to be known for your client version. On a client where it is not, nothing happens. --- # event SysMessage > Shows a system message in the client; only you see it. - **Syntax:** `event SysMessage {message}` - **Needs a client:** yes - **Related:** event ExMsg, #SysMsgCol, Display - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/event/sysmessage/ `event SysMessage` shows a message in the client's system message area, at the bottom of the game window and in the journal. Only you see it; nothing is sent to the server. It is a quiet way for a script to report what it is doing. The message uses the colour in [`#SysMsgCol`](https://ilpersi.github.io/EasyUOReforged/variables/sysmsgcol/). The command calls a function inside the client. On a client version where that function's address is not known, it does nothing. ## Example ```euo event SysMessage Your character name is #CharName halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # Execute > Opens a program, file or web address, as if you had double-clicked it. - **Syntax:** `execute {file} [arguments...]` - **Needs a client:** no - **Related:** Call, Send, Shutdown - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/execute/ `execute` opens a program, a file or a web address, as Windows does when you double-click it: a program runs, a document opens in its program, an address opens in the browser. The script then waits two seconds and goes on; it does not wait for the program to finish. ## Parameters | Parameter | Meaning | |---|---| | `file` | What to open. A path with spaces has to be glued together, as with [`call`](https://ilpersi.github.io/EasyUOReforged/commands/call/). | | `arguments` | Optional. Passed to the program. | > **Caution: Only run scripts you trust** > > There is no setting to turn this command off: any script you run can use it. ## Examples ```euo execute notepad.exe C:\EasyUO\notes.txt execute https://github.com/ilpersi/EasyUOReforged halt ``` Append a line to a text file with the command prompt: ```euo set %task mining execute cmd.exe /c echo %task #CharPosX #CharPosY >> C:\EasyUO\log.txt halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # exevent Drag > Picks up an item, or a given amount of a stack, through the server. - **Syntax:** `exevent Drag {id} [amount]` - **Needs a client:** yes - **Related:** exevent DropC, exevent DropG, exevent DropPD, event Drag, MoveItem - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/exevent/drag/ `exevent Drag` asks the server to pick up an item. Follow it with [`exevent DropC`](https://ilpersi.github.io/EasyUOReforged/commands/exevent/dropc/), [`DropG`](https://ilpersi.github.io/EasyUOReforged/commands/exevent/dropg/) or [`DropPD`](https://ilpersi.github.io/EasyUOReforged/commands/exevent/droppd/) to put it down again. To move an item into a container and know whether it arrived, [`moveitem`](https://ilpersi.github.io/EasyUOReforged/commands/moveitem/) does the drag, the drop, the waiting and the checks in one line. ## Parameters | Parameter | Meaning | |---|---| | `id` | The item. It has to be known to the client: on screen, or in an open container. | | `amount` | Optional. How many to take from a stack. **Default: 1**, not the whole stack: pass [`#FindStack`](https://ilpersi.github.io/EasyUOReforged/variables/findstack/) to take all of it. | ## Example ```euo finditem POF G_2 if #FindCnt > 0 { exevent Drag #FindID #FindStack wait 10 exevent DropC #BackpackID wait 10 } halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # exevent DropC > Drops the held item into a container, or onto a stack to combine them. - **Syntax:** `exevent DropC {container id} [x y]` - **Needs a client:** yes - **Related:** exevent Drag, exevent DropG, #BackpackID, MoveItem - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/exevent/dropc/ `exevent DropC` drops the item picked up with [`exevent Drag`](https://ilpersi.github.io/EasyUOReforged/commands/exevent/drag/) into a container. ## Parameters | Parameter | Meaning | |---|---| | `container id` | The container. Give the ID of a stack instead to combine the held items with it. | | `x`, `y` | Optional. Where to put it inside the container, relative to the container's own top-left corner. Without them, the server chooses. | Pick the item up with `exevent Drag`, not [`event Drag`](https://ilpersi.github.io/EasyUOReforged/commands/event/drag/): mixing `event Drag` with the `exevent Drop…` commands can leave a ghost item on the cursor. [`moveitem`](https://ilpersi.github.io/EasyUOReforged/commands/moveitem/) does the drag and this drop in one line, waits for them and says in [`#MoveRes`](https://ilpersi.github.io/EasyUOReforged/variables/moveres/) whether the item arrived. ## Example ```euo ; move all gold within reach into the backpack finditem POF G_2 if #FindCnt > 0 { exevent Drag #FindID #FindStack wait 10 exevent DropC #BackpackID wait 10 } halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # exevent DropG > Drops the held item on the ground at a world position. - **Syntax:** `exevent DropG {x} {y} [z]` - **Needs a client:** yes - **Related:** exevent Drag, exevent DropC, #CharPosX - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/exevent/dropg/ `exevent DropG` drops the item picked up with [`exevent Drag`](https://ilpersi.github.io/EasyUOReforged/commands/exevent/drag/) on the ground. ## Parameters | Parameter | Meaning | |---|---| | `x`, `y` | World position, within reach. | | `z` | Optional height. Default: your current [`#CharPosZ`](https://ilpersi.github.io/EasyUOReforged/variables/charposz/). | Pick the item up with `exevent Drag`, not [`event Drag`](https://ilpersi.github.io/EasyUOReforged/commands/event/drag/): mixing `event Drag` with the `exevent Drop…` commands can leave a ghost item on the cursor. ## Example ```euo ; drop a piece of trash at your feet set %trash ABCDEFG ; the ID of what to drop finditem %trash C_ , #BackpackID if #FindCnt > 0 { exevent Drag #FindID #FindStack wait 10 exevent DropG #CharPosX #CharPosY wait 10 } halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # exevent DropPD > Puts the held item on: drops it on your paperdoll. - **Syntax:** `exevent DropPD` - **Needs a client:** yes - **Related:** exevent Drag, exevent Equip - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/exevent/droppd/ `exevent DropPD` puts on the item picked up with [`exevent Drag`](https://ilpersi.github.io/EasyUOReforged/commands/exevent/drag/), as if you had dropped it on your paperdoll. It takes no parameters. - It only works after **`exevent Drag`**, which records what kind of item is held. After `event Drag` it does nothing. - The item has to be something EasyUO knows how to wear; for anything else nothing happens. To put on several items at once, [`exevent Equip`](https://ilpersi.github.io/EasyUOReforged/commands/exevent/equip/) is simpler. ## Example ```euo set %weapon TSF ; a dagger finditem %weapon C_ , #BackpackID if #FindCnt > 0 { exevent Drag #FindID wait 10 exevent DropPD wait 10 } halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # exevent Equip > Asks the server to equip one or more items by ID, in one request. - **Syntax:** `exevent Equip {id} [id...]` - **Needs a client:** yes - **Related:** exevent DropPD, exevent Drag, event Drag - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/exevent/equip/ `exevent Equip` asks the server to equip the listed items, all in one request, without dragging them onto the paperdoll. Give one or more item IDs; anything that is not a valid ID is skipped. It sends the client's "equip items" packet (`0xEC`), the one newer clients use for their equip macros, so it only works on servers that support that packet. ## Example ```euo ; put the weapon and shield back on set %weaponid ABCDEFG ; your weapon's ID set %shieldid HIJKLMN ; your shield's ID exevent Equip %weaponid %shieldid halt ``` --- # exevent GumpReply > Answers a gump the server sent, the way a click on one of its buttons does. - **Syntax:** `exevent GumpReply {gump} {button} [switches] [id:text ...]` - **Needs a client:** yes - **New in Reforged:** EasyUO 1.5 does not have it. - **Sets:** #GumpReply, #GumpReplyRes, #GumpReplyCnt - **Related:** ScanGumps, #GumpTypeID, #GumpReply, #GumpReplyCnt, #GumpReplyRes - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/exevent/gumpreply/ `exevent GumpReply` answers a gump the server sent (a menu, a confirmation, a quest window), as if you had clicked one of its buttons. It sends the server the same answer the client sends for a click, with the checkboxes and text fields you give it, and closes the window in the client. [`#GumpReplyRes`](https://ilpersi.github.io/EasyUOReforged/variables/gumpreplyres/) says whether it went out, and [`#GumpReply`](https://ilpersi.github.io/EasyUOReforged/variables/gumpreply/) keeps the answer, so the same line can send it again later. ## Parameters | Parameter | Meaning | |---|---| | `gump` | Which gump: its [`#GumpTypeID`](https://ilpersi.github.io/EasyUOReforged/variables/gumptypeid/), such as `JHEIIPI`, for the gump of that type in front; or a number, a position in the last [`ScanGumps`](https://ilpersi.github.io/EasyUOReforged/commands/scangumps/) list, such as `#GumpIndex`. | | `button` | The number of the button. `0` means "close", which every gump accepts. | | `switches` | Optional. The IDs of the checkboxes and radio buttons that are on, joined with `/`: `3/7`. `-` for none. | | `id:text` | Optional, one per text field: its ID, a colon, and the text. Write a space as `_`, a real `_` as `\_` and a `\` as `\\`. A text is cut at 239 characters, as the client cuts it. | The button numbers and IDs come from the shard: each gump has its own. The easiest way to find them: click the button once by hand and read [`#GumpReply`](https://ilpersi.github.io/EasyUOReforged/variables/gumpreply/), which records the click (see below). It shows the button, and the checkboxes and text fields the window sent with it. ## Results | [`#GumpReplyRes`](https://ilpersi.github.io/EasyUOReforged/variables/gumpreplyres/) | Meaning | |---|---| | `sent` | The answer went out. [`#GumpReply`](https://ilpersi.github.io/EasyUOReforged/variables/gumpreply/) holds it. | | `nogump` | No such gump is open: nothing was sent. | | `error` | The words are wrong, or this client build can't answer gumps: nothing was sent. | `sent` means the server got the answer. Whether it did what you wanted, the game tells: the journal, an item, a new gump. ## Examples Confirm with OKAY (button 1) the confirmation gump of type `JHEIIPI`, if it is open: ```euo exevent GumpReply JHEIIPI 1 if #GumpReplyRes = nogump event sysmessage The confirmation is not open. halt ``` Tick checkboxes 3 and 7, type a name into text field 5, and press button 2: ```euo set %menu YISCGQI ; the gump's #GumpTypeID on your shard exevent GumpReply %menu 2 3/7 5:Iron_Golem halt ``` Close every server gump that is open: ```euo scangumps for %i 1 #GumpCnt { set #GumpIndex %i if #GumpName = generic_gump exevent GumpReply %i 0 } halt ``` Send the last answer again, when the same gump opens next time: ```euo set %answer #GumpReply repeat scangumps T_ , %answer wait 5 until #GumpCnt > 0 exevent GumpReply %answer halt ``` The last example works because the first word of `#GumpReply` is the type ID, so `scangumps T_ , %answer` looks for that type, and `exevent GumpReply %answer` sends the whole answer. ## Notes - **The serial is taken from the gump open now.** Each time the server opens a gump it gives it a new serial, and it ignores an answer with any other serial, without a word. That is why the command finds the gump in the client every time and never reuses an old serial: an answer kept in `#GumpReply` works on the next copy of the same gump. - **An answer to a gump that is not open does nothing**, on the server as in the command (`nogump`). - **The client's window closes**, as it does after a click. Only for the client's own gumps with type IDs from `$2410` to `$2462` (`AUN` to `GSN`) it stays open, because the client keeps some of those open after some buttons. - **A button the gump doesn't have** is up to the shard. ModernUO ignores it on most gumps and keeps waiting for an answer, which does no harm; its newer gumps pass it to the gump, and a confirmation then takes it as "not OK", like Cancel. The client's window is closed either way. - **Clicks by hand are recorded too.** The first `exevent GumpReply`, or the first time a script reads [`#GumpReplyCnt`](https://ilpersi.github.io/EasyUOReforged/variables/gumpreplycnt/), puts a small hook into the client that records every gump answer it sends: `#GumpReplyCnt` goes up and `#GumpReply` holds the answer. The hook stays until the client closes and changes nothing the client does. On a client build where it can't be put in safely, only this command's answers are recorded. - It needs the client's event hook, as every `exevent` does. ## Reforged notes `exevent GumpReply`, `#GumpReply` and `#GumpReplyRes` are new in EasyUO Reforged. Old EasyUO skips the line. No other `exevent` changes. It works where [`#GumpTypeID`](https://ilpersi.github.io/EasyUOReforged/variables/gumptypeid/) can be read: client 7.0.29.97 and newer except 7.0.30 to 7.0.46, and the relocatable `client_beta.exe`. Elsewhere it gives `error` and sends nothing. --- # ExEvent > Sends actions straight to the server as packets: drag, drop, context menus, locks and more. - **Syntax:** `exevent {type} [parameters...]` - **Needs a client:** yes - **Related:** Event, exevent Drag - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/exevent/ `exevent` sends an action straight to the server as a packet, without going through the client's own functions the way [`event`](https://ilpersi.github.io/EasyUOReforged/commands/event/) does. The client finds out about the result when the server answers, so its display can lag behind for a moment. | Command | What it does | |---|---| | [exevent Drag](https://ilpersi.github.io/EasyUOReforged/commands/exevent/drag/) | Picks up an item, or part of a stack. | | [exevent DropC](https://ilpersi.github.io/EasyUOReforged/commands/exevent/dropc/) | Drops the held item into a container, or onto a stack. | | [exevent DropG](https://ilpersi.github.io/EasyUOReforged/commands/exevent/dropg/) | Drops the held item on the ground. | | [exevent DropPD](https://ilpersi.github.io/EasyUOReforged/commands/exevent/droppd/) | Puts the held item on, on your paperdoll. | | [exevent Equip](https://ilpersi.github.io/EasyUOReforged/commands/exevent/equip/) | Equips one or more items in one request. | | [exevent GumpReply](https://ilpersi.github.io/EasyUOReforged/commands/exevent/gumpreply/) | Answers a gump the server sent, as a click on a button does. | | [exevent PopUp](https://ilpersi.github.io/EasyUOReforged/commands/exevent/popup/) | Opens the context menu of an item or character. | | [exevent RenamePet](https://ilpersi.github.io/EasyUOReforged/commands/exevent/renamepet/) | Renames a pet. | | [exevent SkillLock](https://ilpersi.github.io/EasyUOReforged/commands/exevent/skilllock/) | Sets the lock of a skill. | | [exevent StatLock](https://ilpersi.github.io/EasyUOReforged/commands/exevent/statlock/) | Sets the lock of a stat. | The usual way to move an item is `exevent Drag` followed by one of the `exevent Drop…` commands, with a short `wait` in between. *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # exevent PopUp > Opens the context menu of an item or character. - **Syntax:** `exevent PopUp {id}` - **Needs a client:** yes - **Related:** FindItem, Click - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/exevent/popup/ `exevent PopUp` opens the context menu of an item or character, the menu you get when you click it with the mouse: vendor *Buy* and *Sell*, *Open Paperdoll*, pet commands, and so on. Then click the entry you want. The item or character has to be known to the client, which usually means on screen. Older documentation shows `x` and `y` after the ID. They are accepted but ignored: the interpreter always passes `0, 0`. ## Example ```euo set %vendor ABCDEFG ; the vendor's ID finditem %vendor G_10 if #FindCnt > 0 exevent PopUp #FindID halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # exevent RenamePet > Renames one of your pets. - **Syntax:** `exevent RenamePet {id} {name}` - **Needs a client:** yes - **Related:** FindItem - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/exevent/renamepet/ `exevent RenamePet` gives one of your pets a new name. The pet has to be known to the client, usually on screen. Keep the name to 30 characters at most: the rename request has room for no more. ## Example ```euo set %horse ABCDEFG ; your horse's ID finditem %horse G_2 if #FindCnt > 0 exevent RenamePet #FindID Buttercup halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # exevent SkillLock > Sets the lock of a skill, or of all skills. - **Syntax:** `exevent SkillLock {skill|all} {up|down|locked}` - **Needs a client:** yes - **Related:** event SkillLock, ChooseSkill, #SkillLock, exevent StatLock - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/exevent/skilllock/ `exevent SkillLock` sets whether a skill may go up, go down, or stay where it is. The client's skill window shows the new lock at once. [`event SkillLock`](https://ilpersi.github.io/EasyUOReforged/commands/event/skilllock/) does exactly the same. ## Parameters | Parameter | Meaning | |---|---| | `skill` | The skill's code, the first four letters of its name, or `all` for every skill. See [`chooseskill`](https://ilpersi.github.io/EasyUOReforged/commands/chooseskill/#skill-codes) for the codes. | | lock | `up`, `down` or `locked`. | Read a skill's current lock with [`chooseskill`](https://ilpersi.github.io/EasyUOReforged/commands/chooseskill/) and [`#SkillLock`](https://ilpersi.github.io/EasyUOReforged/variables/skilllock/). ## Example ```euo exevent SkillLock mage down exevent SkillLock arms locked exevent SkillLock all up halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # exevent StatLock > Sets the lock of strength, dexterity or intelligence. - **Syntax:** `exevent StatLock {str|dex|int} {up|down|locked}` - **Needs a client:** yes - **Related:** exevent SkillLock, #Str, #Dex, #Int - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/exevent/statlock/ `exevent StatLock` sets whether a stat may go up, go down, or stay where it is. ## Parameters | Parameter | Meaning | |---|---| | stat | `str`, `dex` or `int`. | | lock | `up`, `down` or `locked`. | ## Example ```euo exevent StatLock dex down exevent StatLock str locked halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # Exit > Ends a called script, or starts the main script over from the top. - **Syntax:** `exit` - **Needs a client:** no - **Related:** call, halt, return - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/exit/ `exit` ends the script it is in: - **In a script started with [`call`](https://ilpersi.github.io/EasyUOReforged/commands/call/)**, the calling script goes on with the line after its `call`. - **In the main script**, the script **starts over from the first line**. It does not stop: use [`halt`](https://ilpersi.github.io/EasyUOReforged/commands/halt/) for that. Variables keep their values. Reaching the last line of a script does the same as `exit`. That is why a main script that should run once ends with `halt`, and why a script without one runs again and again. ## Example ```euo set %round %round + 1 display ok Round %round if %round < 3 exit ; back to the top of the script display ok Done after %round rounds. halt ``` ## Returning a value from a called script `exit` cannot return a value the way [`return`](https://ilpersi.github.io/EasyUOReforged/commands/return/) does from a sub. Set a variable instead; called scripts share their variables with the script that called them. ```euo ; main script set %a 0 call a.euo display ok a = %a halt ``` ```euo title="a.euo" set %a set_by_a.euo exit ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # FindItem > Finds items and characters by type or ID and fills the #Find… variables with the first match. - **Syntax:** `finditem {type|id}[_{type|id}...] [index] [G|G_{range}|C|C_{container}|A|CA_{container}]` - **Needs a client:** yes - **Changed in Reforged:** see "Reforged notes" below. - **Sets:** #FindID, #FindType, #FindX, #FindY, #FindZ, #FindDist, #FindKind, #FindStack, #FindBagID, #FindLayer, #FindRep, #FindCol, #FindIndex, #FindCnt - **Related:** IgnoreItem, #FindIndex, #FindMod, event Drag - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/finditem/ `FindItem` takes a snapshot of the objects the client knows about (items and characters, on the ground and in open containers), keeps the ones that match, and selects one of them. The selected object's details go into the [`#Find…` variables](https://ilpersi.github.io/EasyUOReforged/variables/?category=finditem); `#FindCnt` says how many objects matched. ## Parameters | Parameter | Meaning | |---|---| | `type` / `id` | What to look for. A **type** is 2–3 letters (`POF` is gold), an **ID** is 6–8 letters (`YKLMNOP`). Join several with `_` (`NSF_FSF`): each one matches either as a type or as an ID. Use `*` to match every object. | | `index` | Optional. Which match to select, counting from 1. Default: 1. | | filter | Optional, always the last parameter. Limits where to look. See the table below. | | Filter | Keeps only | |---|---| | `G` | Objects on the ground. | | `G_{range}` | Objects on the ground at most `range` tiles away. | | `C` | Objects inside containers. The container must be open. | | `C_{container}` | Objects inside the container with that ID. The container must be open. | | `A` | Adds objects the client still keeps in memory but doesn't show. See [Hidden objects](#hidden-objects). | | `CA_{container}` | Like `C_{container}`, including objects the client doesn't show. | ## Reading the results - **Found:** `#FindCnt` is the number of matches and the `#Find…` variables describe the selected one: `#FindID`, `#FindType`, position (`#FindX`, `#FindY`, `#FindZ`, `#FindDist`), `#FindKind` (0 = in a container, 1 = on the ground), `#FindStack`, `#FindBagID`, `#FindRep` and `#FindCol`. For an object a character wears, [`#FindLayer`](https://ilpersi.github.io/EasyUOReforged/variables/findlayer/) is the layer it is worn in. - **Not found:** `#FindCnt` is `0`, `#FindKind` is `-1`, and `#FindID` and `#FindType` read `X`. Test `#FindCnt` or `#FindKind`, not `#FindID`. - **The other matches:** set [`#FindIndex`](https://ilpersi.github.io/EasyUOReforged/variables/findindex/) to 2, 3, … `#FindCnt` to select them one after the other. This reuses the snapshot, so it is much faster than calling `FindItem` again. The snapshot is taken when `FindItem` runs. If an object moves or disappears afterwards, the variables keep showing what it was at that moment until the next `FindItem`. ## Examples Pick up a dagger lying within 2 tiles and drop it at a screen position: ```euo finditem TSF G_2 if #FindCnt > 0 { event Drag #FindID wait 20 click 200 300 p } halt ``` Move a stack of black pearl out of a known bag. The comma glues `C_` and the bag ID into a single `C_ABCDEFG` parameter: ```euo set %regbag ABCDEFG ; your reagent bag's ID finditem KUF C_ , %regbag if #FindCnt > 0 { event Drag #FindID wait 20 click 200 300 p } halt ``` Count the gold stacks in the backpack and list each one: ```euo finditem POF C_ , #BackpackID for %i 1 #FindCnt { set #FindIndex %i display ok Stack %i : #FindStack gold } halt ``` ## Notes ### Hidden objects By default `FindItem` skips objects the client keeps in memory but doesn't draw. For example, an item dropped into a closed bag in the bank box can still be "found" until the bank box closes, which used to make scripts drag items that weren't on screen. The `A` filter (for *all*) includes them, which also finds the equipment, clothing and backpacks of other characters. Cheffe's own advice from when he added it still applies: **only use `A` when you really need it.** ### Items and characters `#FindStack` is `0` for characters (mobiles), so it is a quick way to tell them apart from items. ## Reforged notes - `FindItem` also fills [`#FindLayer`](https://ilpersi.github.io/EasyUOReforged/variables/findlayer/): the layer a character wears the selected object in, or `N/A` when nobody wears it. Which objects it finds, and every other `#Find…` variable, are unchanged. *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # FindJournal > Searches the journal lines since a bookmark for a colour and any of several texts, waiting up to a timeout. - **Syntax:** `findjournal {since} {color} {timeout} {text} [text...]` - **Needs a client:** yes - **New in Reforged:** EasyUO 1.5 does not have it. - **Sets:** #JFound, #Journal, #JColor - **Related:** ScanJournal, DeleteJournal, WaitFor, #JFound, #JIndex, #Journal, #JColor - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/findjournal/ `findjournal` asks "has any of these texts appeared in the journal since this point?". Save [`#JIndex`](https://ilpersi.github.io/EasyUOReforged/variables/jindex/) before you act, then search everything that came in after it. It sees every new line, even when several arrive together. ```euo set %j #JIndex event macro 15 28 ; cast Greater Heal findjournal %j * 3s fizzles you_must_wait if #JFound > 0 event sysmessage #Journal halt ``` [`#JFound`](https://ilpersi.github.io/EasyUOReforged/variables/jfound/) is the running number of the line it found, or `0` if it found none. The line itself goes to [`#Journal`](https://ilpersi.github.io/EasyUOReforged/variables/journal/) and its colour to [`#JColor`](https://ilpersi.github.io/EasyUOReforged/variables/jcolor/), as after [`scanjournal`](https://ilpersi.github.io/EasyUOReforged/commands/scanjournal/). With no match they read `N/A` and `0`. > **Caution: All four parameters are needed** > > They go by position, so one left out shifts the rest with no error. `findjournal %j * fizzles` reads `fizzles` as the > time and has no text left, so it finds nothing. Start from `findjournal %j * 0 text`, which means any colour and no > waiting. Swapping the numbers in `findjournal %j 5 33 fizzles` asks for colour 5 and a timeout of 33 ticks. ## Parameters | Parameter | Meaning | |---|---| | `since` | Which lines to search. A [`#JIndex`](https://ilpersi.github.io/EasyUOReforged/variables/jindex/) value (above 500): the lines after it. A number from 1 to 500 counts back from the newest line, as in `scanjournal`: `10` is the newest 10 lines. `0`, a negative number or an unset variable searches nothing. | | `color` | The colour the line must have, as [`#JColor`](https://ilpersi.github.io/EasyUOReforged/variables/jcolor/) shows it, or `*` for any colour. A value that can't be read as a number, such as an unset variable, finds nothing. | | `timeout` | The longest to wait for a match, as in [`waitfor`](https://ilpersi.github.io/EasyUOReforged/commands/waitfor/): a number of **ticks** of 50 ms (`20` is one second), or a whole number of **seconds** followed by `s` (`5s`). `0` checks once and doesn't wait. A value that can't be read as a time counts as 2 seconds. | | `text` | What the line must contain, or `*` for any line. Give as many as you like. | Whatever the `since`, it never looks at more than the newest 100 lines, the same limit as `scanjournal`. ## What matches A line matches when it has the colour **and** contains **any one** of the texts. There is one colour for the whole call. | Call | Finds | |---|---| | `findjournal %j * 0 fizzles` | that text, in any colour | | `findjournal %j 33 0 *` | any line of colour 33 | | `findjournal %j 33 0 fizzles` | that text in that colour | | `findjournal %j * 0 *` | the next new line, whatever it says | Text is matched exactly like the [`in`](https://ilpersi.github.io/EasyUOReforged/language/expressions/) operator: anywhere in the line, ignoring case, with spaces written as `_`. Colours can differ between hues and clients. To find the value you need, read `#JColor` after finding a line of that kind. A text of exactly `*` is the wildcard, and nothing else is. `*sighs*` looks for those characters, and so does `you_*_wait`, so `*` doesn't work as a pattern inside a text. ## Several texts The search goes through the lines from oldest to newest and stops at the first one that matches. The order of the texts doesn't matter: if `You must wait` arrived before `The spell fizzles`, this finds `You must wait`, although `fizzles` is listed first. Nothing reports which text matched, so test it afterwards: ```euo set %j #JIndex event macro 15 28 findjournal %j * 3s fizzles you_must_wait if fizzles in #Journal event sysmessage Fizzled if you_must_wait in #Journal event sysmessage Too soon if #JFound = 0 event sysmessage Nothing yet halt ``` Several texts mean "any of them". To require two texts on one line, search for one and test the other with `in`. ## Going through every match Because the oldest match comes first, setting the bookmark to `#JFound` moves on to the next one. Each match is handled once and in order. With `*` for the colour and the text, this goes through every new line: ```euo set %j #JIndex msg first line$ msg second line$ wait 1s repeat findjournal %j * 0 * if #JFound > 0 { event sysmessage #Journal set %j #JFound } until #JFound = 0 halt ``` Use one variable per thing you watch, and they stay independent. There is no bookmark to reset. ## Waiting With a timeout, the search repeats every tick (50 ms) until a line matches or the time runs out. If a line already matches, the script goes on without any delay. - **Pause** holds the wait, and the time paused doesn't count towards the timeout. - **Stop** ends the wait at once and leaves `#JFound`, `#Journal` and `#JColor` as they were. - The editor stays responsive during a wait, and the variable inspector keeps updating. Use `findjournal` rather than [`waitfor`](https://ilpersi.github.io/EasyUOReforged/commands/waitfor/) to wait for a journal text. A `waitfor` condition can't search: `#SysMsg` holds only the latest message, and `#JIndex > %j` comes true on any line at all, so nearby chat ends the wait. ## DeleteJournal `findjournal` doesn't need [`deletejournal`](https://ilpersi.github.io/EasyUOReforged/commands/deletejournal/), but it does respect it. Lines it hid are not searched, and a line found counts as the line last read, so `deletejournal` right after a search hides that line and everything older. To swap out a hand-written search sub that relies on `deletejournal`, count back from the newest line: ```euo msg guards$ wait 1s findjournal 100 * 0 guards if #JFound > 0 { event sysmessage Heard it. deletejournal } halt ``` ## Notes - `if #JFound` alone is never true, because only `-1` counts as true. Write `if #JFound > 0`. - Text that other players say matches too. Their lines contain `:_` after the name, so `if :_ in #Journal` tells them apart. Colour can also separate them if speech and system messages differ on your client. - A lone `*` character can't be searched for, since `*` alone is the wildcard. - If more lines arrive than the client keeps, between two reads of the journal, the running numbers start again from 1000. A bookmark above `#JIndex` then searches all the lines held, because all of them are newer than it. Every search and every read of `#JIndex` keeps the count up to date, and the editor reads it regularly too. Logging out and back in without closing the client doesn't restart them: the client keeps its journal, so a bookmark saved before still works after. Closing the client does restart them, because the new client has a new journal. A low bookmark can then miss the first lines of the new session, so save `#JIndex` again once the client is back. - The first line after a completely empty journal, right after logging in, doesn't move `#JIndex` on. A bookmark saved at that moment doesn't see that one line. ## Reforged notes `findjournal` and `#JFound` are new in EasyUO Reforged. No existing command changes because of them, and a sub or label called `findjournal` keeps working. It's the only change for old scripts: a line starting with the word `findjournal` used to be ignored and is now this command. `uo.dll` has no equivalent. A program using it reads the lines itself with `GetJournal`. --- # For > Repeats a line or block while a variable counts from one number to another. - **Syntax:** `for {variable} {start} {end}` - **Needs a client:** no - **Related:** while, repeat, break, continue, #FindIndex - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/for/ `for` runs the line or block after it once for each value of `variable`, counting from `start` to `end`. It counts up when `start` is smaller than `end` and down when it is larger. ## Parameters | Parameter | Meaning | |---|---| | `variable` | The counter. Any variable works, including system variables such as [`#FindIndex`](https://ilpersi.github.io/EasyUOReforged/variables/findindex/). | | `start` | First value, a whole number. | | `end` | Last value, a whole number. It is read once, when the loop starts: changing it inside the loop has no effect. | A block is a `{` line, the lines to run, and a matching `}` line. The `{` has to be **the very next line**: a blank line or a comment in between means only that line belongs to the command, and the block after it runs every time. Braces go on lines of their own. Without a block, only the next line is repeated. Leave a loop early with [`break`](https://ilpersi.github.io/EasyUOReforged/commands/break/), or skip to the next value with [`continue`](https://ilpersi.github.io/EasyUOReforged/commands/continue/). ## Examples ```euo for %i 1 20 { event sysmessage %i wait 10 } halt ``` Counting down, and using a system variable as the counter: ```euo for %i 10 1 event sysmessage %i finditem POF C_ , #BackpackID for #FindIndex 1 #FindCnt event sysmessage #FindID holds #FindStack gold halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # GetShopInfo > Reads the entry shown at the top of the shop gump into the #Shop… variables. - **Syntax:** `getshopinfo` - **Needs a client:** yes - **Sets:** #ShopItemID, #ShopItemType, #ShopItemName, #ShopItemPrice, #ShopItemMax, #ShopCurPos, #ShopCnt - **Related:** SetShopItem - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/getshopinfo/ `getshopinfo` reads the entry currently shown at the top of an open shop gump (a vendor's list of items for sale) and fills the `#Shop…` variables with it: [`#ShopItemID`](https://ilpersi.github.io/EasyUOReforged/variables/shopitemid/), [`#ShopItemType`](https://ilpersi.github.io/EasyUOReforged/variables/shopitemtype/), [`#ShopItemName`](https://ilpersi.github.io/EasyUOReforged/variables/shopitemname/), [`#ShopItemPrice`](https://ilpersi.github.io/EasyUOReforged/variables/shopitemprice/), [`#ShopItemMax`](https://ilpersi.github.io/EasyUOReforged/variables/shopitemmax/), [`#ShopCurPos`](https://ilpersi.github.io/EasyUOReforged/variables/shopcurpos/) and [`#ShopCnt`](https://ilpersi.github.io/EasyUOReforged/variables/shopcnt/). The shop gump has to be open, but it does not have to be on top. The variables do not follow the gump: after scrolling to another entry, run `getshopinfo` again. ## Example ```euo ; buy as many of the top item as the vendor has getshopinfo setshopitem #ShopItemID #ShopItemMax halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # GetUOTitle > Puts the title of the client window in #StrRes. - **Syntax:** `getuotitle` - **Needs a client:** yes - **Sets:** #StrRes - **Related:** SetUOTitle, #CliTitle - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/getuotitle/ `getuotitle` puts the title of the client window in [`#StrRes`](https://ilpersi.github.io/EasyUOReforged/variables/strres/). [`#CliTitle`](https://ilpersi.github.io/EasyUOReforged/variables/clititle/) holds the same text and can be read directly, without a command. ## Example ```euo getuotitle display ok The window is called #StrRes halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # Gosub > Runs a sub and comes back when it returns, optionally passing parameters. - **Syntax:** `gosub {sub name} [parameter...]` - **Needs a client:** no - **Related:** sub, return, #Result, call - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/gosub/ `gosub` runs the [`sub`](https://ilpersi.github.io/EasyUOReforged/commands/sub/) with the given name. When the sub reaches [`return`](https://ilpersi.github.io/EasyUOReforged/commands/return/), the script goes on with the line after the `gosub`. ## Parameters | Parameter | Meaning | |---|---| | `sub name` | Name of the sub. Case does not matter. | | `parameter` | Optional values passed to the sub. Inside it, `%1`, `%2`, … hold them and `%0` holds how many there are. | ## Details - **No sub with that name:** nothing happens and the script goes on with the next line. - **Several subs with the same name:** the last one in the script is used. - **Nesting:** about 1000 `gosub` calls can be open at once without returning. Beyond that the oldest one is dropped, so recursion that deep loses track of where to come back to. - **Leave a sub with `return`**, never with [`goto`](https://ilpersi.github.io/EasyUOReforged/commands/goto/): every `gosub` that does not return stays open. A sub can return a value in [`#Result`](https://ilpersi.github.io/EasyUOReforged/variables/result/): `return %value`. ## Examples ```euo gosub greet Jim Bob halt sub greet ; %0 = 2, %1 = Jim, %2 = Bob display ok Hello %1 and %2 return ``` Any number of parameters, walked with `%0`: ```euo gosub joinwords These are the parameters display ok #Result halt sub joinwords set %message for %n 1 %0 set %message %message , % . %n , #spc return %message ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # Goto > Jumps to a label; the nearest label with that name wins. - **Syntax:** `goto {label}` - **Needs a client:** no - **Related:** label, gosub, sub - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/goto/ `goto` makes the script go on at the line after a [label](https://ilpersi.github.io/EasyUOReforged/commands/label/). ## Parameters | Parameter | Meaning | |---|---| | `label` | Name of the label, with or without the trailing `:`. Case does not matter. | ## Which label `goto` looks for the label starting from its own line, one line further each step, **forward and backward at the same time**, and takes the first match. At equal distance the forward one wins. So if a label name is used twice, the nearest one is chosen, not the first one in the script. When no label matches, nothing happens and the script goes on with the next line. > **Caution** > > Don't `goto` out of a [`sub`](https://ilpersi.github.io/EasyUOReforged/commands/sub/): use [`return`](https://ilpersi.github.io/EasyUOReforged/commands/return/). A sub left with `goto` > stays open, and enough of them fill up the `gosub` stack. ## Examples ```euo loop: if %done goto finished gosub work goto loop finished: display ok Done after %rounds rounds. halt sub work set %rounds %rounds + 1 if %rounds = 3 set %done #true return ``` A `switch` built from labels. The comma glues `case` and the number into one label name: ```euo set %a #random % 3 + 1 goto case , %a case1: display ok One goto case_end case2: display ok Two goto case_end case3: display ok Three case_end: halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # Halt > Stops the script. - **Syntax:** `halt` - **Needs a client:** no - **Related:** stop, pause, exit - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/halt/ `halt` stops the script. Unlike [`pause`](https://ilpersi.github.io/EasyUOReforged/commands/pause/), it cannot be resumed: pressing Play starts the script again from the first line. [`stop`](https://ilpersi.github.io/EasyUOReforged/commands/stop/) does exactly the same. A main script that reaches its last line without `halt` starts over from the top, as with [`exit`](https://ilpersi.github.io/EasyUOReforged/commands/exit/). ## Example ```euo set %amountNeeded 3 finditem TSF C_ , #BackpackID ; daggers if #FindCnt < %amountNeeded halt display ok #FindCnt daggers: enough to go on. halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # HideItem > Hides an item from your screen; nothing changes on the server. - **Syntax:** `hideitem {id}` - **Needs a client:** yes - **Related:** FindItem, IgnoreItem - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/hideitem/ `hideitem` makes an item disappear from your screen, to unclutter it. It only changes the client's copy of the item: nothing is sent to the server, and the item is back as soon as the server sends it again, for example when you walk away and come back. Only items lying on the ground can be hidden; static map art cannot. ## Example ```euo finditem * G_12 hideitem #FindID halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # If > Runs a line or a block only when a condition is true. - **Syntax:** ``` if {condition} if {condition} {lines} ``` - **Needs a client:** no - **Related:** else, while, #True, #False - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/if/ `if` runs the line or block after it only when the condition is true; otherwise the script skips it. An [`else`](https://ilpersi.github.io/EasyUOReforged/commands/else/) after it runs instead when the condition is false. ## Parameters | Parameter | Meaning | |---|---| | `condition` | An [expression](https://ilpersi.github.io/EasyUOReforged/language/expressions/), such as `%a > %b` or `#FindCnt = 0`. | | `lines` | Optional. Without a block, how many of the following lines belong to the `if`. Default: 1. | ## When is it true? The condition is true only when it evaluates to [`#true`](https://ilpersi.github.io/EasyUOReforged/variables/true/), which is `-1`. Comparisons (`=`, `<`, `in`, …) produce `-1` or `0`, and `&&`, `||` and `!` combine those as expected. A plain value is **not** turned into true or false: `if 1` and `if yes` are both false, and `if %flag` is true only when `%flag` holds `#true`. See [`#True` and `#False`](https://ilpersi.github.io/EasyUOReforged/guides/true-and-false/). ## One line, a block, or a number of lines Without a block, the `if` controls only the next line: ```euo set %a 100 set %b #random if %a > %b display ok a is bigger than b else display ok a is equal to or less than b halt ``` To control several lines, put them in a block: ```euo set %a 100 set %b #random if %a > %b { display ok a is bigger than b set %b %a } else { display ok b is equal to or bigger than a set %a %b } halt ``` A block is a `{` line, the lines to run, and a matching `}` line. The `{` has to be **the very next line**: a blank line or a comment in between means only that line belongs to the command, and the block after it runs every time. Braces go on lines of their own. The older form gives the number of lines instead of a block. Every script line counts, blank lines and comments included: ```euo set %a 100 set %b #random if %a > %b 2 display ok a is bigger than b set %b %a else 2 display ok b is equal to or bigger than a set %a %b halt ``` ## Negating a condition `!` reverses only the value **right after it**, before any comparison is made. So `if ! %var = world` does not mean "if `%var` is not `world`": it compares `! %var` with `world`, which is never equal. Use `<>`, or put the condition in parentheses: ```euo set %var hello if %var <> world display ok shown: hello is not world if ! ( %var = world ) display ok shown as well if ! %var = world display ok never shown halt ``` ## Nesting `if` and `else` can be nested to any depth: ```euo set %a #random % 3 + 1 if %a = 1 display ok One else { if %a = 2 display ok Two else display ok Three } halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # IgnoreCont > Makes the #Cont… variables skip a gump, by name or kind; reset empties the list. - **Syntax:** `ignorecont {gump name|gump kind|reset}` - **Needs a client:** yes - **Related:** #ContName, #ContKind, event ContTop, ContPos - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/ignorecont/ The `#Cont…` variables ([`#ContName`](https://ilpersi.github.io/EasyUOReforged/variables/contname/), [`#ContKind`](https://ilpersi.github.io/EasyUOReforged/variables/contkind/), [`#ContPosX`](https://ilpersi.github.io/EasyUOReforged/variables/contposx/), …) describe the gump on top of the client's screen. `IgnoreCont` adds a gump to the list of gumps they skip, so the variables describe the next one down instead. It works the same for [`event ContTop`](https://ilpersi.github.io/EasyUOReforged/commands/event/conttop/), which counts gumps the same way. ## Parameters | Parameter | Meaning | |---|---| | gump name | The name as [`#ContName`](https://ilpersi.github.io/EasyUOReforged/variables/contname/) shows it, for example `status_gump` (a health bar). Case does not matter; spaces and `_` are the same. | | gump kind | The value of [`#ContKind`](https://ilpersi.github.io/EasyUOReforged/variables/contkind/) for that kind of gump. | | `reset` | Empties the list. | Some gumps are on the list from the start, because scripts almost never mean them: `BARK_GUMP`, `DAMAGENUMBERS_GUMP`, `DUMB_GUMP`, `GAMEAREAEDGEGUMP`, `MAP_GUMP`, `MENUBAR`, `MISSILE_GUMP`, `NEW_ITEM_PROP_GUMP`, `RETICLE_GUMP`, `TARGET_GUMP` and `UNICODE_BARK_GUMP`. **`ignorecont reset` removes these too**, so after it `#ContName` can report, for example, the menu bar. ## Example ```euo ; don't let health bars count as the top gump ignorecont status_gump ; or ignore whatever kind of gump is on top right now ignorecont #ContKind halt ``` --- # IgnoreItem > Makes FindItem skip items by ID or type; the same call again un-ignores them. - **Syntax:** ``` ignoreitem {id|type}[_{id|type}...] [list] ignoreitem reset [list] ``` - **Needs a client:** yes - **Related:** FindItem, IgnoreCont, #FindIndex - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/ignoreitem/ `ignoreitem` adds items to a list that [`finditem`](https://ilpersi.github.io/EasyUOReforged/commands/finditem/) skips. ## Parameters | Parameter | Meaning | |---|---| | `id` / `type` | What to ignore: an item ID (6–8 letters) or an item type (2–3 letters). Join several with `_`. | | `list` | Optional name (a word or number) to group entries, so they can be reset together. | | `reset` | Removes every entry, or only those of the given `list`. | ## Details - **Calling it again toggles.** Ignoring an ID or type that is already ignored removes it from the list, whichever list it was added to. - **Types and IDs are separate.** Ignoring a type hides matching items from a `finditem` by type, but a `finditem` by an item's ID still finds it. ```euo ignoreitem POF 1 ; all gold is ignored ignoreitem POF ; gold is found again, although it was added to list 1 halt ``` ## Examples ```euo ; ignore one pile, then several items at once ignoreitem BWVOKMS ignoreitem BWVOKMS_RFTDQWE_POF ; ignore every item on the ground nearby, then start again finditem * G_2 for #FindIndex 1 #FindCnt ignoreitem #FindID tmp ignoreitem reset tmp halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # InitEvents > Obsolete: event commands set themselves up; the line is ignored. - **Syntax:** `initevents` - **Needs a client:** no - **Obsolete.** - **Related:** Event - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/initevents/ Old EasyUO versions needed `initevents` once per script before any [`event`](https://ilpersi.github.io/EasyUOReforged/commands/event/) command would work. Later versions set the event commands up the first time one is used, so the command was no longer needed. EasyUO Reforged does not know the word at all: like any unknown command, a line starting with `initevents` is skipped. Remove it from your scripts. *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # Key > Presses a key in the client, optionally with Ctrl, Alt or Shift. - **Syntax:** `key {key} [ctrl] [alt] [shift]` - **Needs a client:** yes - **Related:** Msg, OnHotKey, event Macro - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/key/ `key` presses and releases a key in the client. ## Parameters | Parameter | Meaning | |---|---| | `key` | The key: `A`–`Z`, `0`–`9`, `F1`–`F12`, `ESC`, `BACK`, `TAB`, `ENTER`, `PAUSE`, `CAPSLOCK`, `SPACE`, `PGUP`, `PGDN`, `END`, `HOME`, `LEFT`, `RIGHT`, `UP`, `DOWN`, `PRNSCR`, `INSERT`, `DELETE`, `NUMLOCK` and `SCROLLLOCK`. | | `ctrl`, `alt`, `shift` | Optional. Hold these down while the key is pressed. | ## Details - **Without `ctrl`, `alt` or `shift`** the key goes straight to the client window, which does not need to be in front. - **With any of them**, the client is brought to the front and the keys are pressed on the real keyboard, so the client has to keep the focus while it happens. With several clients open, modifier keys can end up in the wrong one. - The script waits 250 ms after each `key`. ## Example ```euo key F4 alt ; Alt+F4 key ENTER halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # Label > Marks a line that goto can jump to. - **Syntax:** `{name}:` - **Needs a client:** no - **Related:** goto - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/label/ A label is a word followed by a colon, on a line of its own. [`goto`](https://ilpersi.github.io/EasyUOReforged/commands/goto/) jumps to the line after it. ```euo set %n 0 mainloop: set %n %n + 1 if %n < 3 goto mainloop display ok Went round %n times. halt ``` - **Names:** case does not matter, and `goto` can leave out the colon: `goto mainloop`. - **Nothing else on the line** except a comment (`mainloop: ; main loop`). The label line itself runs nothing, so a command written after the label on the same line is ignored. - **Duplicate names** are allowed, but `goto` takes the nearest one. See [`goto`](https://ilpersi.github.io/EasyUOReforged/commands/goto/). *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # LinesPerCycle > Sets how many lines the script runs before each 50 ms pause; the same as set #LPC. - **Syntax:** `linespercycle {lines}` - **Needs a client:** no - **Related:** #LPC, Wait - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/linespercycle/ A script runs in cycles: it runs a number of lines, then pauses 50 ms, which leaves the computer to the UO client. `linespercycle` sets that number. It does the same as `set #LPC`: see [`#LPC`](https://ilpersi.github.io/EasyUOReforged/variables/lpc/). The default is 10, and a script starts with 10 again each time it is run. `0` and negative numbers are ignored. Raise it to make plain calculations run faster, for example while building a big [`menu`](https://ilpersi.github.io/EasyUOReforged/commands/menu/) window. Commands that wait for the client, such as `finditem` or the `event` commands, take the time they need regardless. ## Example ```euo linespercycle 1000 ; add up 1 to 1000 quickly set %sum 0 for %i 1 1000 set %sum %sum + %i linespercycle 10 display ok The sum is %sum halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # Log > Writes a line to the editor's Output panel, or to EUOCli's output, without stopping the script. - **Syntax:** `log [text]` - **Needs a client:** no - **New in Reforged:** EasyUO 1.5 does not have it. - **Related:** Display, event SysMessage - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/log/ `log` writes a line of text for whoever is running the script. In the editor it appears in the **Output** panel, with the time. Under [`EUOCli run`](https://ilpersi.github.io/EasyUOReforged/guide/euocli/#run-a-script) it is printed as the script goes. It is the way to see what a script is doing while it runs: - [`display`](https://ilpersi.github.io/EasyUOReforged/commands/display/) stops the script until you click, so it can't go in a loop. - [`event sysmessage`](https://ilpersi.github.io/EasyUOReforged/commands/event/sysmessage/) needs a client, and the line scrolls away in the game. - `log` never waits, needs no client, and the lines stay in the panel. ```euo set %sum 0 for %i 1 5 { set %sum %sum + %i log After %i the sum is %sum } log Done. halt ``` The Output panel then shows: ```text 14:03:09 After 1 the sum is 1 14:03:09 After 2 the sum is 3 14:03:09 After 3 the sum is 6 14:03:09 After 4 the sum is 10 14:03:09 After 5 the sum is 15 14:03:09 Done. ``` ## Parameters | Parameter | Meaning | |---|---| | `text` | Optional. Everything after `log`, with variables replaced by their values and the words joined by single spaces. Without it, an empty line. | ## Details - **The text is not changed.** A `$` stays a `$` (in `display` it starts a new line), so you can log [`#Property`](https://ilpersi.github.io/EasyUOReforged/variables/property/) or a journal line exactly as the script reads it. - **Words are joined by one space.** Several spaces in a row become one. Glue words with `,` as anywhere else: `log Position: , #CharPosX , / , #CharPosY`. - **It sets no variable** and changes nothing a script can read. - A [sub](https://ilpersi.github.io/EasyUOReforged/commands/sub/) or label called `log` keeps working: `gosub log` and `goto log` are not this command. ## The Output panel The panel opens by itself, under the script, when a script logs its first line. *Control → Show Output* shows or hides it, and *Control → Clear Output* empties it. - There is one panel for all tabs. When more than one tab is open, each line also names its tab. - When the call stack is shown too (*Control → Show Call Stack*), the Output panel is to its right. - It keeps the newest 5000 lines. - Select text in it and press Ctrl+C to copy. ## Logging while you debug ```euo finditem POF G_3 log finditem found #FindCnt stacks, the first is #FindID if #FindCnt > 0 { event Property #FindID log Its tooltip: #Property } halt ``` ## Reforged notes `log` is new in EasyUO Reforged. No existing command changes because of it. It's the only change for old scripts: a line starting with the word `log` used to be ignored and is now this command. `uo.dll` has no equivalent: a program using it writes its own output. --- # menu Activate > Gives a control the keyboard focus. - **Syntax:** `menu Activate {name}` - **Needs a client:** no - **MENU logic:** 1.5, 1.6 - **Related:** menu Edit - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/menu/activate/ `menu Activate` gives the keyboard focus to a control: an edit field, memo, button, check box, drop-down list or list box. What the user types then goes into it. ## Example ```euo menu Clear menu Window Size 180 75 menu Edit name 10 10 150 Bob menu Edit search 10 40 150 menu Show menu Activate search ; the cursor goes to the second field halt ``` ## 1.5 and 1.6 - **1.5:** gives the keyboard focus to an edit field, memo, button, combo box, list or check box in the menu window. Other controls are ignored. - **1.6:** works on any control, in any window: it brings the control's window to the front and gives the control the focus if it can take it. Naming a window ([`menu Form`](https://ilpersi.github.io/EasyUOReforged/commands/menu/form/), or `form0`) brings that window to the front. *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* *The EasyUO 1.6 behaviour on this page was researched with help from the [ScriptUO](https://www.scriptuo.com/) community: Gaderian's tutorial [New Menu Code and how to adapt old scripts](https://www.scriptuo.com/index.php?topic=15596.0) and the scripts its members share at scriptuo.com.* --- # menu Button > Places a button in the menu window; a click puts its name in #MenuButton. - **Syntax:** `menu Button {name} {x} {y} {width} {height} {text}` - **Needs a client:** no - **MENU logic:** 1.5, 1.6 - **Related:** #MenuButton, menu Set - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/menu/button/ `menu Button` places a button in the menu window. Clicking it puts the button's name in [`#MenuButton`](https://ilpersi.github.io/EasyUOReforged/variables/menubutton/). ## Parameters | Parameter | Meaning | |---|---| | `name` | The control's name, used later by [`menu Get`](https://ilpersi.github.io/EasyUOReforged/commands/menu/get/), [`menu Set`](https://ilpersi.github.io/EasyUOReforged/commands/menu/set/) and [`menu Delete`](https://ilpersi.github.io/EasyUOReforged/commands/menu/delete/). Case does not matter. This is what `#MenuButton` holds after a click, in capital letters. | | `x`, `y` | Position of the top-left corner. | | `width`, `height` | Size in pixels. | | `text` | The caption on the button. | It uses the current [font settings](https://ilpersi.github.io/EasyUOReforged/commands/menu/#fonts). ## Waiting for a click `#MenuButton` keeps the last click until something else is clicked, so clear it before you wait. Comparisons ignore case, so `ok` matches `OK`: ```euo menu Clear menu Window Size 160 100 menu Text ask 10 10 Go on? menu Button ok 10 60 60 25 OK menu Button cancel 80 60 60 25 Cancel menu Show set #MenuButton N/A while #MenuButton = N/A wait 1 if #MenuButton = cancel || #MenuButton = closed display ok Cancelled. else display ok Going on. halt ``` Change the caption later with [`menu Set`](https://ilpersi.github.io/EasyUOReforged/commands/menu/set/). ## 1.5 and 1.6 - **1.5:** a click puts the button's name in [`#MenuButton`](https://ilpersi.github.io/EasyUOReforged/variables/menubutton/) in capitals (`OK`). - **1.6:** the name is in lower case (`ok`); `=` ignores case, so `if #MenuButton = ok` works in both. The button goes into the current [default parent](https://ilpersi.github.io/EasyUOReforged/commands/menu/setdef/), and a second button created with a name already taken appears but does nothing when clicked. See [MENU: EasyUO 1.5 and 1.6](https://ilpersi.github.io/EasyUOReforged/commands/menu/versions/#names). *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* *The EasyUO 1.6 behaviour on this page was researched with help from the [ScriptUO](https://www.scriptuo.com/) community: Gaderian's tutorial [New Menu Code and how to adapt old scripts](https://www.scriptuo.com/index.php?topic=15596.0) and the scripts its members share at scriptuo.com.* --- # menu Check > Places a check box in the menu window. - **Syntax:** `menu Check {name} {x} {y} {width} {height} {checked} {text}` - **Needs a client:** no - **MENU logic:** 1.5, 1.6 - **Related:** menu Get, menu Set - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/menu/check/ `menu Check` places a check box with a caption. ## Parameters | Parameter | Meaning | |---|---| | `name` | The control's name, used later by [`menu Get`](https://ilpersi.github.io/EasyUOReforged/commands/menu/get/), [`menu Set`](https://ilpersi.github.io/EasyUOReforged/commands/menu/set/) and [`menu Delete`](https://ilpersi.github.io/EasyUOReforged/commands/menu/delete/). Case does not matter. | | `x`, `y` | Position of the top-left corner. | | `width`, `height` | Size of the box and caption together. A caption that does not fit is cut off. | | `checked` | `#true` (or any number other than 0) to start checked, `#false` (0) to start unchecked. | | `text` | The caption, to the right of the box; with [`menu Font Align`](https://ilpersi.github.io/EasyUOReforged/commands/menu/font/align/) `right`, to the left. | It uses the current [font settings](https://ilpersi.github.io/EasyUOReforged/commands/menu/#fonts). [`menu Get`](https://ilpersi.github.io/EasyUOReforged/commands/menu/get/) returns `#true` (`-1`) when it is checked and `#false` (`0`) when it is not; [`menu Set`](https://ilpersi.github.io/EasyUOReforged/commands/menu/set/) with `#true` or `#false` changes it. ## Example ```euo menu Clear menu Window Size 180 80 menu Check loot 10 10 120 20 #false Loot corpses menu Button ok 10 45 60 25 OK menu Show set #MenuButton N/A while #MenuButton = N/A wait 1 menu Get loot if #MenuRes = #true display ok Looting. else display ok Not looting. halt ``` ## 1.5 and 1.6 - **1.6:** the check box goes into the current [default parent](https://ilpersi.github.io/EasyUOReforged/commands/menu/setdef/), and its name must be free: a second one with a taken name appears but cannot be read or changed. Its properties can be read and changed with [`menu GetProp`](https://ilpersi.github.io/EasyUOReforged/commands/menu/getprop/) and [`menu SetProp`](https://ilpersi.github.io/EasyUOReforged/commands/menu/setprop/). [`menu Radio`](https://ilpersi.github.io/EasyUOReforged/commands/menu/radio/) makes radio buttons. *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* *The EasyUO 1.6 behaviour on this page was researched with help from the [ScriptUO](https://www.scriptuo.com/) community: Gaderian's tutorial [New Menu Code and how to adapt old scripts](https://www.scriptuo.com/index.php?topic=15596.0) and the scripts its members share at scriptuo.com.* --- # menu Clear > Removes every control from the menu window and resets the font settings. - **Syntax:** `menu Clear` - **Needs a client:** no - **MENU logic:** 1.5, 1.6 - **Related:** menu Delete, menu Font Name - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/menu/clear/ `menu Clear` removes every control from the menu window and puts the [font settings](https://ilpersi.github.io/EasyUOReforged/commands/menu/#fonts) back to their defaults. The window itself, its size, title and colour stay as they are. The menu window stays when a script stops, so start your menu code with `menu Clear`. ## Example ```euo menu Clear menu Window Size 220 60 menu Text old 10 10 This text goes in two seconds. menu Show wait 40 menu Clear menu Text new 10 10 A new menu in the same window. halt ``` ## 1.5 and 1.6 - **1.5:** removes every control. The window keeps its size, title, colour and position, and [`#MenuButton`](https://ilpersi.github.io/EasyUOReforged/variables/menubutton/) keeps its value. - **1.6:** removes every control and also every other window ([`menu Form`](https://ilpersi.github.io/EasyUOReforged/commands/menu/form/)) and panel. The main window keeps its size, title, colour, position and whether it is shown. The defaults go back to their starting values, the default parent becomes the main window again, the [`menu PushDef`](https://ilpersi.github.io/EasyUOReforged/commands/menu/pushdef/) copies are dropped, and `#MenuButton` is emptied. After [`menu Delete form0`](https://ilpersi.github.io/EasyUOReforged/commands/menu/delete/) the main window stays gone. *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* *The EasyUO 1.6 behaviour on this page was researched with help from the [ScriptUO](https://www.scriptuo.com/) community: Gaderian's tutorial [New Menu Code and how to adapt old scripts](https://www.scriptuo.com/index.php?topic=15596.0) and the scripts its members share at scriptuo.com.* --- # menu Combo > Places a drop-down list in the menu window, and fills or selects its entries. - **Syntax:** ``` menu Combo Create {name} {x} {y} {width} menu Combo Add {name} {text} menu Combo Select {name} {number} menu Combo Clear {name} ``` - **Needs a client:** no - **MENU logic:** 1.5, 1.6 - **Related:** menu List, menu Get - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/menu/combo/ `menu Combo` places a drop-down list, where the user picks one entry, and manages its entries. | Form | What it does | |---|---| | `Create {name} {x} {y} {width}` | Places an empty drop-down list. It uses the current [font settings](https://ilpersi.github.io/EasyUOReforged/commands/menu/#fonts). | | `Add {name} {text}` | Adds an entry at the end. | | `Select {name} {number}` | Selects entry `number`, counting from 1. `0` selects nothing. | | `Clear {name}` | Removes every entry. | [`menu Get`](https://ilpersi.github.io/EasyUOReforged/commands/menu/get/) returns the number of the selected entry, counting from 1, or `0` when nothing is selected. ## Example ```euo menu Clear menu Window Size 160 80 menu Combo Create town 10 10 120 menu Combo Add town Britain menu Combo Add town Trinsic menu Combo Add town Vesper menu Combo Select town 1 menu Button ok 10 45 60 25 OK menu Show set #MenuButton N/A while #MenuButton = N/A wait 1 menu Get town display ok You chose town number #MenuRes halt ``` ## 1.5 and 1.6 - **1.5:** `Add`, `Select` and `Clear` act on every combo box with that name. - **1.6:** they act on the one combo box the name belongs to; a second one created with the same name is out of reach. The combo box goes into the current [default parent](https://ilpersi.github.io/EasyUOReforged/commands/menu/setdef/). *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* *The EasyUO 1.6 behaviour on this page was researched with help from the [ScriptUO](https://www.scriptuo.com/) community: Gaderian's tutorial [New Menu Code and how to adapt old scripts](https://www.scriptuo.com/index.php?topic=15596.0) and the scripts its members share at scriptuo.com.* --- # menu Delete > Removes one control from the menu window. - **Syntax:** `menu Delete {name}` - **Needs a client:** no - **MENU logic:** 1.5, 1.6 - **Related:** menu Clear, menu Set - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/menu/delete/ `menu Delete` removes the control with that name from the menu window. If several controls share the name, all of them are removed. To change what a control shows, [`menu Set`](https://ilpersi.github.io/EasyUOReforged/commands/menu/set/) is lighter than deleting and creating it again. ## Example ```euo menu Clear menu Window Size 220 60 menu Text keep 10 10 This line stays. menu Text gone 10 30 This line goes in two seconds. menu Show wait 40 menu Delete gone halt ``` ## 1.5 and 1.6 - **1.5:** removes every control with that name. - **1.6:** removes the one control the name belongs to. For a window ([`menu Form`](https://ilpersi.github.io/EasyUOReforged/commands/menu/form/)) or a [`menu Panel`](https://ilpersi.github.io/EasyUOReforged/commands/menu/panel/), everything in it goes too: what has a name is removed, what has none disappears. `menu Delete form0` removes the main window until the script is started again; [`menu Show`](https://ilpersi.github.io/EasyUOReforged/commands/menu/show/), [`menu Hide`](https://ilpersi.github.io/EasyUOReforged/commands/menu/hide/) and `menu Window` then do nothing. *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* *The EasyUO 1.6 behaviour on this page was researched with help from the [ScriptUO](https://www.scriptuo.com/) community: Gaderian's tutorial [New Menu Code and how to adapt old scripts](https://www.scriptuo.com/index.php?topic=15596.0) and the scripts its members share at scriptuo.com.* --- # menu Edit > Places a one-line text field in the menu window. - **Syntax:** `menu Edit {name} {x} {y} {width} {text}` - **Needs a client:** no - **MENU logic:** 1.5, 1.6 - **Related:** menu Get, menu GetNum, menu Memo, menu Set - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/menu/edit/ `menu Edit` places a one-line text field the user can type in. Its height follows the font size. For more than one line, use [`menu Memo`](https://ilpersi.github.io/EasyUOReforged/commands/menu/memo/). ## Parameters | Parameter | Meaning | |---|---| | `name` | The control's name, used later by [`menu Get`](https://ilpersi.github.io/EasyUOReforged/commands/menu/get/), [`menu Set`](https://ilpersi.github.io/EasyUOReforged/commands/menu/set/) and [`menu Delete`](https://ilpersi.github.io/EasyUOReforged/commands/menu/delete/). Case does not matter. | | `x`, `y` | Position of the top-left corner. | | `width` | Width in pixels. | | `text` | The starting text. | It uses the current [font settings](https://ilpersi.github.io/EasyUOReforged/commands/menu/#fonts). Read what the user typed with [`menu Get`](https://ilpersi.github.io/EasyUOReforged/commands/menu/get/) or, for a number, [`menu GetNum`](https://ilpersi.github.io/EasyUOReforged/commands/menu/getnum/). ## Example ```euo menu Clear menu Window Size 180 80 menu Edit pet 10 10 150 Fluffy menu Button ok 10 45 60 25 OK menu Show set #MenuButton N/A while #MenuButton = N/A wait 1 menu Get pet display ok Your pet is called #MenuRes halt ``` ## 1.5 and 1.6 - **1.6:** the field goes into the current [default parent](https://ilpersi.github.io/EasyUOReforged/commands/menu/setdef/), and its name must be free: a second field with a taken name appears but cannot be read or changed. `$` stays as written in both. *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* *The EasyUO 1.6 behaviour on this page was researched with help from the [ScriptUO](https://www.scriptuo.com/) community: Gaderian's tutorial [New Menu Code and how to adapt old scripts](https://www.scriptuo.com/index.php?topic=15596.0) and the scripts its members share at scriptuo.com.* --- # menu Font Align > Sets how the text of labels and check boxes created after it is aligned. - **Syntax:** `menu Font Align {left|center|right}` - **Needs a client:** no - **MENU logic:** 1.5, 1.6 - **Related:** menu Text, menu Check - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/menu/font/align/ `menu Font Align` sets the alignment for the controls created after it: - for a [text label](https://ilpersi.github.io/EasyUOReforged/commands/menu/text/) with several lines, how the lines line up; - for a [check box](https://ilpersi.github.io/EasyUOReforged/commands/menu/check/), `right` puts the caption on the left of the box. The default is `left`. ## Example ```euo menu Clear menu Window Size 200 60 menu Font Align center menu Text info 10 10 First line$second line, longer menu Show halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # menu Font BGColor > Sets the background colour of the controls created after it. - **Syntax:** `menu Font BGColor {colour}` - **Needs a client:** no - **MENU logic:** 1.5, 1.6 - **Related:** menu Font Color, menu Font Transparent - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/menu/font/bgcolor/ `menu Font BGColor` sets the background colour of the controls created after it: behind a label's text, inside an edit field or list, on a button. The default is the standard button colour, `btnface`. A colour, see [Colours](https://ilpersi.github.io/EasyUOReforged/commands/menu/#colours): a name such as `red` or `btnface`, or a `$BBGGRR` number. ## Example ```euo menu Clear menu Window Size 200 140 menu Font BGColor white menu List Create lst 10 10 180 120 menu List Add lst A white list menu Show halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # menu Font Color > Sets the text colour of the controls created after it. - **Syntax:** `menu Font Color {colour}` - **Needs a client:** no - **MENU logic:** 1.5, 1.6 - **Related:** menu Font BGColor, menu Window Color - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/menu/font/color/ `menu Font Color` sets the text colour of the controls created after it. The default is black. A colour, see [Colours](https://ilpersi.github.io/EasyUOReforged/commands/menu/#colours): a name such as `red` or `btnface`, or a `$BBGGRR` number. ## Example ```euo menu Clear menu Window Size 200 40 menu Font Color red menu Text warn 10 10 Low on reagents menu Show halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # menu Font Name > Sets the font of the controls created after it. - **Syntax:** `menu Font Name {font}` - **Needs a client:** no - **MENU logic:** 1.5, 1.6 - **Related:** menu Font Size, menu Font Style, menu Clear - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/menu/font/name/ `menu Font Name` sets the font of the controls created after it, by its name as Windows knows it. Names with spaces are fine. The default is Arial. Symbol fonts such as Wingdings only show the intended symbols if that exact font is installed; otherwise Windows substitutes another font and the characters look unrelated. ## Example ```euo menu Clear menu Window Size 200 40 menu Font Name Times New Roman menu Text title 10 10 Hello menu Show halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # menu Font Size > Sets the font size of the controls created after it. - **Syntax:** `menu Font Size {points}` - **Needs a client:** no - **MENU logic:** 1.5, 1.6 - **Related:** menu Font Name - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/menu/font/size/ `menu Font Size` sets the font size, in points, of the controls created after it. The default is 10. ## Example ```euo menu Clear menu Window Size 200 70 menu Font Size 14 menu Text title 10 10 Big title menu Font Size 10 menu Text body 10 40 Normal text menu Show halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # menu Font Style > Sets bold, italic, underline or strikeout for the controls created after it. - **Syntax:** `menu Font Style [b][i][u][s]` - **Needs a client:** no - **MENU logic:** 1.5, 1.6 - **Related:** menu Font Name - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/menu/font/style/ `menu Font Style` sets the style of the controls created after it. Combine the letters: `b` bold, `i` italic, `u` underline, `s` strikeout. Without letters, the style goes back to plain. ## Example ```euo menu Clear menu Window Size 200 60 menu Font Style bi menu Text warn 10 10 Careful! menu Font Style menu Text body 10 30 Plain again menu Show halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # menu Font Transparent > Draws the labels created after it without a background. - **Syntax:** `menu Font Transparent {#true|#false}` - **Needs a client:** no - **MENU logic:** 1.5 - **Related:** menu Text, menu Font BGColor - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/menu/font/transparent/ `menu Font Transparent` with `#true` makes the [text labels](https://ilpersi.github.io/EasyUOReforged/commands/menu/text/) created after it draw without a background, so what is behind them (a shape, an image, the window colour) shows through. `#false` goes back to normal. ## Example ```euo menu Clear menu Window Size 200 40 menu Shape bg 0 0 200 40 3 1 1 0 7 navy menu Font Transparent #true menu Font Color white menu Text title 10 10 On a blue band menu Show halt ``` ## 1.5 and 1.6 EasyUO 1.6 dropped `menu Font Transparent`: under the 1.6 logic the line does nothing and labels always have a background, in the colour set by [`menu Font BgColor`](https://ilpersi.github.io/EasyUOReforged/commands/menu/font/bgcolor/). *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* *The EasyUO 1.6 behaviour on this page was researched with help from the [ScriptUO](https://www.scriptuo.com/) community: Gaderian's tutorial [New Menu Code and how to adapt old scripts](https://www.scriptuo.com/index.php?topic=15596.0) and the scripts its members share at scriptuo.com.* --- # menu Form > Creates another menu window, hidden, that the controls created after it go into. - **Syntax:** `menu Form {name} {x} {y} {width} {height} [title...]` - **Needs a client:** no - **MENU logic:** 1.6 - **Related:** menu Panel, menu SetProp, menu SetDef, menu Delete, #MenuButton - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/menu/form/ `menu Form` creates a new window besides the main menu window. It starts hidden: show it with [`menu SetProp`](https://ilpersi.github.io/EasyUOReforged/commands/menu/setprop/) `{name} visible #true`. ## Parameters | Parameter | Meaning | |---|---| | `name` | The window's name, for [`menu SetProp`](https://ilpersi.github.io/EasyUOReforged/commands/menu/setprop/), [`menu Delete`](https://ilpersi.github.io/EasyUOReforged/commands/menu/delete/), [`menu SetDef parent`](https://ilpersi.github.io/EasyUOReforged/commands/menu/setdef/). | | `x`, `y` | Position of the window on the screen. | | `width`, `height` | Size of the inside. It comes out 10 pixels larger each way, as in EasyUO 1.6; `menu SetProp {name} width` and `height` set the exact size. | | `title` | The title bar text; the rest of the line. | ## Description - **Controls created after it go into it**, until another `menu Form` or [`menu Panel`](https://ilpersi.github.io/EasyUOReforged/commands/menu/panel/), [`menu SetDef parent`](https://ilpersi.github.io/EasyUOReforged/commands/menu/setdef/), [`menu PopDef`](https://ilpersi.github.io/EasyUOReforged/commands/menu/popdef/) or [`menu Clear`](https://ilpersi.github.io/EasyUOReforged/commands/menu/clear/). `menu SetDef parent form0` goes back to the main window. - **Closing it** with its × hides it and puts its name in [`#MenuButton`](https://ilpersi.github.io/EasyUOReforged/variables/menubutton/). The main window's × gives `CLOSED` instead. - It has the main window's frame: a fixed size, no maximize button, always on top, its own taskbar button. - [`menu Delete`](https://ilpersi.github.io/EasyUOReforged/commands/menu/delete/) `{name}` removes it with everything in it. - With [`menu GetProp`](https://ilpersi.github.io/EasyUOReforged/commands/menu/getprop/) and `menu SetProp`: `left`, `top`, `width`, `height` (the inside), `text` (the title), `visible`, `color`, `enabled`, `tooltip`. ## Example ```euo menu Form opts 400 200 200 90 Options menu Check loot 10 10 150 20 #true Loot corpses menu Button ok 60 50 80 25 OK menu SetProp opts visible #true set #MenuButton N/A while #MenuButton = N/A wait 1 menu Get loot set %loot #MenuRes menu SetProp opts visible #false display ok Loot corpses: %loot halt ``` ## Notes - **Use a name only once.** When the name is taken, EasyUO 1.6 still creates the window, hidden and unreachable, and the controls created next go into it. A sub that builds a pop-up with `menu Form` each time it runs shows it only the first time: delete it first, or create it once. - Starting the script again destroys every window it made. *The EasyUO 1.6 behaviour on this page was researched with help from the [ScriptUO](https://www.scriptuo.com/) community: Gaderian's tutorial [New Menu Code and how to adapt old scripts](https://www.scriptuo.com/index.php?topic=15596.0) and the scripts its members share at scriptuo.com.* --- # menu Get > Reads the value of a control into #MenuRes. - **Syntax:** `menu Get {name}` - **Needs a client:** no - **MENU logic:** 1.5, 1.6 - **Sets:** #MenuRes - **Related:** menu GetNum, menu Set, #MenuRes, #MenuButton - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/menu/get/ `menu Get` puts the value of a control in [`#MenuRes`](https://ilpersi.github.io/EasyUOReforged/variables/menures/): | Control | `#MenuRes` | |---|---| | [Edit](https://ilpersi.github.io/EasyUOReforged/commands/menu/edit/) | The text. | | [Memo](https://ilpersi.github.io/EasyUOReforged/commands/menu/memo/) | The text, with each line break turned into `$`. | | [Check](https://ilpersi.github.io/EasyUOReforged/commands/menu/check/) | `-1` (`#true`) when checked, `0` (`#false`) when not. | | [Combo](https://ilpersi.github.io/EasyUOReforged/commands/menu/combo/), [List](https://ilpersi.github.io/EasyUOReforged/commands/menu/list/) | The number of the selected entry, counting from 1; `0` when none. | | [Text](https://ilpersi.github.io/EasyUOReforged/commands/menu/text/), [Button](https://ilpersi.github.io/EasyUOReforged/commands/menu/button/), anything else | `N/A`. | A name that does not exist also gives `N/A`. If several controls share a name, the first one is read. Clicks need no `menu Get`: they go to [`#MenuButton`](https://ilpersi.github.io/EasyUOReforged/variables/menubutton/) by themselves. ## Example ```euo menu Clear menu Window Size 180 110 menu Edit pet 10 10 150 Fluffy menu Check feed 10 40 150 20 #true Feed it menu Button ok 10 75 60 25 OK menu Show set #MenuButton N/A while #MenuButton = N/A wait 1 menu Get pet set %petname #MenuRes menu Get feed display ok Pet %petname feed #MenuRes halt ``` ## 1.5 and 1.6 - **1.6:** also reads [radio buttons](https://ilpersi.github.io/EasyUOReforged/commands/menu/radio/): `-1` when checked, `0` when not. It reads the control the name belongs to; in 1.5, the first control with that name. Labels, buttons and images give `N/A` in both. *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* *The EasyUO 1.6 behaviour on this page was researched with help from the [ScriptUO](https://www.scriptuo.com/) community: Gaderian's tutorial [New Menu Code and how to adapt old scripts](https://www.scriptuo.com/index.php?topic=15596.0) and the scripts its members share at scriptuo.com.* --- # menu GetDef > Reads one of the defaults new menu controls are created with into #MenuRes. - **Syntax:** `menu GetDef {key}` - **Needs a client:** no - **MENU logic:** 1.6 - **Sets:** #MenuRes - **Related:** menu SetDef, menu PushDef, menu PopDef, menu GetProp - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/menu/getdef/ New controls take their font, colours, alignment and parent from a set of defaults. `menu GetDef` puts one of them into [`#MenuRes`](https://ilpersi.github.io/EasyUOReforged/variables/menures/); [`menu SetDef`](https://ilpersi.github.io/EasyUOReforged/commands/menu/setdef/) changes them. ## Keys | Key | What it is | Set too by | |---|---|---| | `alignment` | 0 left, 1 right, 2 centre | [`menu Font Align`](https://ilpersi.github.io/EasyUOReforged/commands/menu/font/align/) | | `color` | Background colour | [`menu Font BgColor`](https://ilpersi.github.io/EasyUOReforged/commands/menu/font/bgcolor/) | | `fontcolor` | Text colour | [`menu Font Color`](https://ilpersi.github.io/EasyUOReforged/commands/menu/font/color/) | | `fontname` | Font | [`menu Font Name`](https://ilpersi.github.io/EasyUOReforged/commands/menu/font/name/) | | `fontsize` | Font size in points | [`menu Font Size`](https://ilpersi.github.io/EasyUOReforged/commands/menu/font/size/) | | `fontstyle` | Sum of 1 bold, 2 italic, 4 underline, 8 strike-out | [`menu Font Style`](https://ilpersi.github.io/EasyUOReforged/commands/menu/font/style/) | | `parent` | Name of the window or panel new controls go into | [`menu Form`](https://ilpersi.github.io/EasyUOReforged/commands/menu/form/), [`menu Panel`](https://ilpersi.github.io/EasyUOReforged/commands/menu/panel/) | When a script starts, and after [`menu Clear`](https://ilpersi.github.io/EasyUOReforged/commands/menu/clear/), they are Arial 10, plain, black text on the standard button colour (`-16777201`), aligned left, in `form0`, the main window. ## Example ```euo menu GetDef fontname set %font #MenuRes menu GetDef fontsize display ok New controls use %font #MenuRes halt ``` ## Notes - `parent` after the default window or panel was deleted gives the last text any [`menu GetProp`](https://ilpersi.github.io/EasyUOReforged/commands/menu/getprop/) or `menu GetDef` returned: the default parent is then none, and new controls do not appear until `menu SetDef parent` names one. *The EasyUO 1.6 behaviour on this page was researched with help from the [ScriptUO](https://www.scriptuo.com/) community: Gaderian's tutorial [New Menu Code and how to adapt old scripts](https://www.scriptuo.com/index.php?topic=15596.0) and the scripts its members share at scriptuo.com.* --- # menu GetNum > Reads a control into #MenuRes, with a default when it is not a number. - **Syntax:** `menu GetNum {name} [default]` - **Needs a client:** no - **MENU logic:** 1.5, 1.6 - **Sets:** #MenuRes - **Related:** menu Get, #MenuRes - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/menu/getnum/ `menu GetNum` works like [`menu Get`](https://ilpersi.github.io/EasyUOReforged/commands/menu/get/), but when the value is not a number (an empty field, or text), [`#MenuRes`](https://ilpersi.github.io/EasyUOReforged/variables/menures/) gets `default` instead. Without a default, the value is left as it is. A number here is a whole number, optionally with a sign (`-5`), or a hexadecimal number starting with `$`. ## Example ```euo menu Clear menu Window Size 180 80 menu Text lbl 10 12 Delay: menu Edit delay 60 10 100 menu Button ok 10 45 60 25 OK menu Show set #MenuButton N/A while #MenuButton = N/A wait 1 menu GetNum delay 20 ; 20 when the field is empty or not a number display ok Delay #MenuRes halt ``` ## 1.5 and 1.6 - **1.6:** also reads [radio buttons](https://ilpersi.github.io/EasyUOReforged/commands/menu/radio/), as [`menu Get`](https://ilpersi.github.io/EasyUOReforged/commands/menu/get/) does. *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* *The EasyUO 1.6 behaviour on this page was researched with help from the [ScriptUO](https://www.scriptuo.com/) community: Gaderian's tutorial [New Menu Code and how to adapt old scripts](https://www.scriptuo.com/index.php?topic=15596.0) and the scripts its members share at scriptuo.com.* --- # menu GetProp > Reads a property of a menu control or window, such as its position, text or colour, into #MenuRes. - **Syntax:** `menu GetProp {name} {property}` - **Needs a client:** no - **MENU logic:** 1.6 - **Sets:** #MenuRes - **Related:** menu SetProp, menu GetDef, menu Get - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/menu/getprop/ `menu GetProp` puts one property of a control, or of a window made by [`menu Form`](https://ilpersi.github.io/EasyUOReforged/commands/menu/form/) (the main window is `form0`), into [`#MenuRes`](https://ilpersi.github.io/EasyUOReforged/variables/menures/). [`menu SetProp`](https://ilpersi.github.io/EasyUOReforged/commands/menu/setprop/) changes them. ## Parameters | Parameter | Meaning | |---|---| | `name` | The control or window. | | `property` | One of the properties below; not case-sensitive. | Text comes back as it is, numbers in decimal, and yes/no as `-1` / `0`. When the control or the property does not exist, `#MenuRes` is left as it was. ## Properties | Property | What it is | Kind | Controls | |---|---|---|---| | `alignment` | Text alignment: 0 left, 1 right, 2 centre | number | text, check, radio | | `checked` | Checked or not | yes/no | check, radio | | `color` | Background colour | number | all but image | | `enabled` | Can be used | yes/no | all | | `fontcolor` | Text colour | number | all but form, panel, image | | `fontname` | Font | text | all but form, panel, image | | `fontsize` | Font size in points | number | all but form, panel, image | | `fontstyle` | Sum of 1 bold, 2 italic, 4 underline, 8 strike-out | number | all but form, panel, image | | `height`, `width` | Size; for a form, of its inside | number | all | | `left`, `top` | Position, inside the parent (on the screen for a form) | number | all | | `parent` | Name of the window or panel it is in | text | all but form | | `scrollbars` | Its scroll bars: 0 none, 1 horizontal, 2 vertical, 3 both (as created). Reforged only | number | memo | | `text` | The label, caption or title; an edit's or a memo's contents (a memo's line breaks as `$`) | text | form, text, button, edit, memo, check, radio | | `tooltip` | The hint shown when the mouse rests on it | text | all | | `visible` | Shown or hidden | yes/no | all | | `wordwrap` | Long lines break at the right edge instead of scrolling sideways (off as created). Reforged only | yes/no | memo | `scrollbars` and `wordwrap` belong to [`menu Memo`](https://ilpersi.github.io/EasyUOReforged/commands/menu/memo/), a Reforged addition that EasyUO 1.6 does not have. A memo that wraps shows no horizontal bar, whatever `scrollbars` says. Colours are numbers in Windows' order, `$BBGGRR`. System colours come back as negative numbers: the standard button colour, `btnface`, is `-16777201`. ## Example ```euo menu Edit name 10 10 120 Bob menu Show menu GetProp name width set %w #MenuRes menu GetProp name text display ok The field is %w pixels wide and says #MenuRes halt ``` ## Notes These are quirks of EasyUO 1.6, kept as they are: - A check box's `alignment` reads 0 when its text is on the right and 1 when it is on the left; a radio button's the other way round. - `parent` of a control whose window or panel has no name (one created with a name already taken) gives the last text any `menu GetProp` or [`menu GetDef`](https://ilpersi.github.io/EasyUOReforged/commands/menu/getdef/) returned, not an empty value. *The EasyUO 1.6 behaviour on this page was researched with help from the [ScriptUO](https://www.scriptuo.com/) community: Gaderian's tutorial [New Menu Code and how to adapt old scripts](https://www.scriptuo.com/index.php?topic=15596.0) and the scripts its members share at scriptuo.com.* --- # menu Hide > Hides the menu window, as if it had been closed. - **Syntax:** `menu Hide` - **Needs a client:** no - **MENU logic:** 1.5, 1.6 - **Related:** menu Show, #MenuButton - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/menu/hide/ `menu Hide` hides the menu window, the same way its × button does: [`#MenuButton`](https://ilpersi.github.io/EasyUOReforged/variables/menubutton/) becomes `CLOSED`, and a main window hidden with [`menu HideEUO`](https://ilpersi.github.io/EasyUOReforged/commands/menu/hideeuo/) comes back. The controls stay; [`menu Show`](https://ilpersi.github.io/EasyUOReforged/commands/menu/show/) shows the window again. ## Example ```euo menu Clear menu Text t 10 10 Hiding in two seconds. menu Show wait 40 menu Hide halt ``` ## 1.5 and 1.6 - **1.5:** closes the window as its × does: [`#MenuButton`](https://ilpersi.github.io/EasyUOReforged/variables/menubutton/) becomes `CLOSED`, and EasyUO comes back if [`menu HideEUO`](https://ilpersi.github.io/EasyUOReforged/commands/menu/hideeuo/) minimised it. - **1.6:** only hides the main window; `#MenuButton` keeps its value. Hide another window with [`menu SetProp`](https://ilpersi.github.io/EasyUOReforged/commands/menu/setprop/) `{name} visible #false`. *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* *The EasyUO 1.6 behaviour on this page was researched with help from the [ScriptUO](https://www.scriptuo.com/) community: Gaderian's tutorial [New Menu Code and how to adapt old scripts](https://www.scriptuo.com/index.php?topic=15596.0) and the scripts its members share at scriptuo.com.* --- # menu HideEUO > Minimises the EasyUO Reforged window and shows only the menu window. - **Syntax:** `menu HideEUO` - **Needs a client:** no - **MENU logic:** 1.5 - **Related:** menu Hide, menu Show - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/menu/hideeuo/ `menu HideEUO` minimises the main EasyUO Reforged window and shows the menu window, so the user only sees your menu. Closing the menu window, or [`menu Hide`](https://ilpersi.github.io/EasyUOReforged/commands/menu/hide/), brings the main window back. ## Example ```euo menu Clear menu Window Size 180 45 menu Button back 10 10 160 25 Bring EasyUO back menu HideEUO set #MenuButton N/A while #MenuButton = N/A wait 1 menu Hide halt ``` ## 1.5 and 1.6 EasyUO 1.6 dropped `menu HideEUO`: under the 1.6 logic the line does nothing. *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* *The EasyUO 1.6 behaviour on this page was researched with help from the [ScriptUO](https://www.scriptuo.com/) community: Gaderian's tutorial [New Menu Code and how to adapt old scripts](https://www.scriptuo.com/index.php?topic=15596.0) and the scripts its members share at scriptuo.com.* --- # menu Image Create > Places an empty, transparent image in the menu window to draw in. - **Syntax:** `menu Image Create {name} {x} {y} {width} {height}` - **Needs a client:** no - **MENU logic:** 1.5, 1.6 - **Related:** menu Image File, menu Image Rectangle, menu Image Pos - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/menu/image/create/ `menu Image Create` places an image in the menu window: a rectangle you can draw in or load a picture into with the other `menu Image` commands. It starts completely transparent. ## Parameters | Parameter | Meaning | |---|---| | `name` | The control's name, used later by [`menu Get`](https://ilpersi.github.io/EasyUOReforged/commands/menu/get/), [`menu Set`](https://ilpersi.github.io/EasyUOReforged/commands/menu/set/) and [`menu Delete`](https://ilpersi.github.io/EasyUOReforged/commands/menu/delete/). Case does not matter. | | `x`, `y` | Position of the top-left corner in the window. | | `width`, `height` | Size in pixels. | `$FEEEED` is the transparent colour of images: painting with it makes those pixels see-through. ## Example ```euo menu Clear menu Window Size 84 84 menu Image Create pic 10 10 64 64 menu Image Rectangle pic 0 0 64 64 navy 1 menu Image Ellipse pic 8 8 56 56 yellow 1 menu Show halt ``` ## 1.5 and 1.6 - **1.6:** a negative width or height is refused. The image goes into the current [default parent](https://ilpersi.github.io/EasyUOReforged/commands/menu/setdef/). *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* *The EasyUO 1.6 behaviour on this page was researched with help from the [ScriptUO](https://www.scriptuo.com/) community: Gaderian's tutorial [New Menu Code and how to adapt old scripts](https://www.scriptuo.com/index.php?topic=15596.0) and the scripts its members share at scriptuo.com.* --- # menu Image Ellipse > Draws an ellipse or circle in an image, outlined or filled. - **Syntax:** `menu Image Ellipse {name} {x1} {y1} {x2} {y2} {colour} {fill} [width]` - **Needs a client:** no - **MENU logic:** 1.5, 1.6 - **Related:** menu Image Rectangle, menu Image Create - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/menu/image/ellipse/ `menu Image Ellipse` draws the ellipse that fits in the rectangle with corners `x1`, `y1` and `x2`, `y2`; a square gives a circle. Positions are inside the image, `0, 0` being its top-left corner. ## Parameters | Parameter | Meaning | |---|---| | `name` | Name of an image created with [`menu Image Create`](https://ilpersi.github.io/EasyUOReforged/commands/menu/image/create/). | | `x1`, `y1`, `x2`, `y2` | Two opposite corners of the box around the ellipse. | | `colour` | A colour, see [Colours](https://ilpersi.github.io/EasyUOReforged/commands/menu/#colours): a name such as `red` or `btnface`, or a `$BBGGRR` number. | | `fill` | `#true` (any number other than 0) fills it with the same colour; `#false` (0) draws only the outline. | | `width` | Optional outline width in pixels. Default: 1. | `$FEEEED` is the transparent colour of images: painting with it makes those pixels see-through. ## Example ```euo menu Clear menu Window Size 84 84 menu Image Create pic 10 10 64 64 menu Image Ellipse pic 8 8 56 56 yellow #true menu Image Ellipse pic 20 20 44 44 red #false 3 menu Show halt ``` ## 1.5 and 1.6 - **1.6:** a negative second corner (`x2`, `y2`) is refused. *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* *The EasyUO 1.6 behaviour on this page was researched with help from the [ScriptUO](https://www.scriptuo.com/) community: Gaderian's tutorial [New Menu Code and how to adapt old scripts](https://www.scriptuo.com/index.php?topic=15596.0) and the scripts its members share at scriptuo.com.* --- # menu Image File > Draws a picture file into an image. - **Syntax:** `menu Image File {name} {x} {y} {file}` - **Needs a client:** no - **MENU logic:** 1.5, 1.6 - **Related:** menu Image Create, #CurPath - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/menu/image/file/ `menu Image File` loads a picture file and draws it into an image, with its top-left corner at `x`, `y`. ## Parameters | Parameter | Meaning | |---|---| | `name` | Name of an image created with [`menu Image Create`](https://ilpersi.github.io/EasyUOReforged/commands/menu/image/create/). | | `x`, `y` | Where to draw it. Positions are inside the image, `0, 0` being its top-left corner. | | `file` | The picture. BMP, PNG, JPEG and GIF work; transparency in the file is kept. | When the file does not exist, nothing happens. A relative path starts from the folder EasyUO Reforged runs in, which is not always [`#CurPath`](https://ilpersi.github.io/EasyUOReforged/variables/curpath/): give a full path, or build one with `#CurPath`. ## Reforged notes Older formats the original accepted, such as WMF, EMF and ICO, may not load. ## Example ```euo menu Clear menu Window Size 220 140 menu Image Create pic 10 10 200 120 ; a corner of the wallpaper Windows 10 and 11 come with menu Image File pic 0 0 C:\Windows\Web\Wallpaper\Windows\img0.jpg menu Show halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # menu Image FloodFill > Fills an area of one colour in an image with another, like a paint bucket. - **Syntax:** `menu Image FloodFill {name} {x} {y} {colour}` - **Needs a client:** no - **MENU logic:** 1.5, 1.6 - **Related:** menu Image Ellipse, menu Image Rectangle - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/menu/image/floodfill/ `menu Image FloodFill` works like the paint bucket of a drawing program: starting at `x`, `y`, it fills the connected area that has the same colour as that pixel with the new colour. Positions are inside the image, `0, 0` being its top-left corner. A colour, see [Colours](https://ilpersi.github.io/EasyUOReforged/commands/menu/#colours): a name such as `red` or `btnface`, or a `$BBGGRR` number. `$FEEEED` is the transparent colour of images: painting with it makes those pixels see-through. ## Example ```euo menu Clear menu Window Size 84 84 menu Image Create pic 10 10 64 64 menu Image Ellipse pic 8 8 56 56 black #false menu Image FloodFill pic 32 32 green ; fill the inside of the circle menu Show halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # menu Image Line > Draws a line in an image. - **Syntax:** `menu Image Line {name} {x1} {y1} {x2} {y2} {colour} [width]` - **Needs a client:** no - **MENU logic:** 1.5, 1.6 - **Related:** menu Image Rectangle, menu Image Create - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/menu/image/line/ `menu Image Line` draws a straight line from `x1`, `y1` to `x2`, `y2` in an image. Positions are inside the image, `0, 0` being its top-left corner. ## Parameters | Parameter | Meaning | |---|---| | `name` | Name of an image created with [`menu Image Create`](https://ilpersi.github.io/EasyUOReforged/commands/menu/image/create/). | | `x1`, `y1`, `x2`, `y2` | The two ends. | | `colour` | A colour, see [Colours](https://ilpersi.github.io/EasyUOReforged/commands/menu/#colours): a name such as `red` or `btnface`, or a `$BBGGRR` number. | | `width` | Optional line width in pixels. Default: 1. | ## Example ```euo menu Clear menu Window Size 84 84 menu Image Create pic 10 10 64 64 menu Image Line pic 0 0 63 63 red 2 menu Image Line pic 0 63 63 0 blue menu Show halt ``` ## 1.5 and 1.6 - **1.6:** a negative second corner (`x2`, `y2`) is refused. - An invalid line width draws a 1-pixel line in 1.6 and nothing in 1.5. *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* *The EasyUO 1.6 behaviour on this page was researched with help from the [ScriptUO](https://www.scriptuo.com/) community: Gaderian's tutorial [New Menu Code and how to adapt old scripts](https://www.scriptuo.com/index.php?topic=15596.0) and the scripts its members share at scriptuo.com.* --- # menu Image Pix > Paints one pixel of an image. - **Syntax:** `menu Image Pix {name} {x} {y} {colour}` - **Needs a client:** no - **MENU logic:** 1.5, 1.6 - **Related:** menu Image PixLine, menu Image Create - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/menu/image/pix/ `menu Image Pix` paints the pixel at `x`, `y` of an image. Positions are inside the image, `0, 0` being its top-left corner. A colour, see [Colours](https://ilpersi.github.io/EasyUOReforged/commands/menu/#colours): a name such as `red` or `btnface`, or a `$BBGGRR` number. `$FEEEED` is the transparent colour of images: painting with it makes those pixels see-through. For more than a few pixels, [`menu Image PixLine`](https://ilpersi.github.io/EasyUOReforged/commands/menu/image/pixline/) is much faster. ## Example ```euo menu Clear menu Window Size 84 84 menu Image Create pic 10 10 64 64 for %i 0 63 menu Image Pix pic %i %i red menu Show halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # menu Image PixLine > Paints a row of pixels of an image from a compact text code. - **Syntax:** `menu Image PixLine {name} {x} {y} {data}` - **Needs a client:** no - **MENU logic:** 1.5 - **Related:** menu Image Pix, menu Image File - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/menu/image/pixline/ `menu Image PixLine` paints a row of pixels, starting at `x`, `y` and going right. Positions are inside the image, `0, 0` being its top-left corner. It is the fast way to draw small pictures pixel by pixel. ## The data Each pixel is **three characters**: red, green and blue, in that order. Each character is one of: | Character | Value | |---|---| | `A` … `Z` | 0, 8, 16, … 200 | | `1` … `6` | 208, 216, … 248 | | `9` | Leave this colour of the pixel as it is. | | `8` | Transparent. Use `888` for a fully transparent pixel. | So `AAA` is black, `666` white, `6AA` red, `PPP` grey and `AAP` navy: `AAAPPP666AAP` paints four pixels. `9A9` keeps a pixel's red and blue but removes its green. On a new image every pixel is transparent, so `999` leaves it transparent. The whole row has to fit in the image, or nothing is painted. Any other character stops the command at that pixel. Keep pictures painted this way small. For anything bigger, load a file with [`menu Image File`](https://ilpersi.github.io/EasyUOReforged/commands/menu/image/file/). ## Example ```euo menu Clear menu Window Size 60 180 menu Image Create pic 10 10 4 16 ; 16 rows of a 4-pixel black, grey, white, navy line for %y 0 15 menu Image PixLine pic 0 %y AAAPPP666AAP menu Image Pos pic 10 10 40 160 ; stretched ten times, to see it menu Show halt ``` ## 1.5 and 1.6 EasyUO 1.6 dropped `menu Image PixLine`: under the 1.6 logic the line does nothing. Draw with [`menu Image Pix`](https://ilpersi.github.io/EasyUOReforged/commands/menu/image/pix/) or [`menu Image Line`](https://ilpersi.github.io/EasyUOReforged/commands/menu/image/line/). *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* *The EasyUO 1.6 behaviour on this page was researched with help from the [ScriptUO](https://www.scriptuo.com/) community: Gaderian's tutorial [New Menu Code and how to adapt old scripts](https://www.scriptuo.com/index.php?topic=15596.0) and the scripts its members share at scriptuo.com.* --- # menu Image Pos > Moves an image, and optionally resizes it, stretching what is drawn in it. - **Syntax:** `menu Image Pos {name} {x} {y} [width height]` - **Needs a client:** no - **MENU logic:** 1.5, 1.6 - **Related:** menu Image Create - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/menu/image/pos/ `menu Image Pos` moves an image to `x`, `y` in the menu window. With `width` and `height`, it also resizes it, and what is drawn in it is stretched to fit. ## Parameters | Parameter | Meaning | |---|---| | `name` | Name of an image created with [`menu Image Create`](https://ilpersi.github.io/EasyUOReforged/commands/menu/image/create/). | | `x`, `y` | New position of the top-left corner in the window. | | `width`, `height` | Optional new size. | ## Example ```euo menu Clear menu Window Size 250 150 menu Image Create pic 10 10 64 64 menu Image Ellipse pic 8 8 56 56 yellow #true menu Show wait 40 menu Image Pos pic 100 10 128 128 ; moved and stretched to twice the size halt ``` ## 1.5 and 1.6 - **1.5:** moves an image, and turns on stretching even when only `x` and `y` are given. - **1.6:** moves any control, not only images, and stretches an image only when `width` and `height` are given; a negative size is refused. *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* *The EasyUO 1.6 behaviour on this page was researched with help from the [ScriptUO](https://www.scriptuo.com/) community: Gaderian's tutorial [New Menu Code and how to adapt old scripts](https://www.scriptuo.com/index.php?topic=15596.0) and the scripts its members share at scriptuo.com.* --- # menu Image Rectangle > Draws a rectangle in an image, outlined or filled. - **Syntax:** `menu Image Rectangle {name} {x1} {y1} {x2} {y2} {colour} {fill} [width]` - **Needs a client:** no - **MENU logic:** 1.5, 1.6 - **Related:** menu Image Ellipse, menu Image Create - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/menu/image/rectangle/ `menu Image Rectangle` draws a rectangle with corners `x1`, `y1` and `x2`, `y2` in an image. Positions are inside the image, `0, 0` being its top-left corner. ## Parameters | Parameter | Meaning | |---|---| | `name` | Name of an image created with [`menu Image Create`](https://ilpersi.github.io/EasyUOReforged/commands/menu/image/create/). | | `x1`, `y1`, `x2`, `y2` | Two opposite corners. | | `colour` | A colour, see [Colours](https://ilpersi.github.io/EasyUOReforged/commands/menu/#colours): a name such as `red` or `btnface`, or a `$BBGGRR` number. | | `fill` | `#true` (any number other than 0) fills it with the same colour; `#false` (0) draws only the outline. | | `width` | Optional outline width in pixels. Default: 1. | `$FEEEED` is the transparent colour of images: painting with it makes those pixels see-through. A filled rectangle is the usual way to give an image a background. ## Example ```euo menu Clear menu Window Size 84 84 menu Image Create pic 10 10 64 64 menu Image Rectangle pic 0 0 64 64 white #true menu Image Rectangle pic 4 4 60 60 black #false 2 menu Show halt ``` ## 1.5 and 1.6 - **1.6:** a negative second corner (`x2`, `y2`) is refused. *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* *The EasyUO 1.6 behaviour on this page was researched with help from the [ScriptUO](https://www.scriptuo.com/) community: Gaderian's tutorial [New Menu Code and how to adapt old scripts](https://www.scriptuo.com/index.php?topic=15596.0) and the scripts its members share at scriptuo.com.* --- # Menu > Builds a window of buttons, text, fields, lists and images that a script can show and read. - **Syntax:** `menu {element} [parameters...]` - **Needs a client:** no - **MENU logic:** 1.5, 1.6 - **Related:** #MenuButton, #MenuRes, #LPC - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/menu/ `menu` builds a small window of your own, the *menu window*, with text, buttons, edit fields, check boxes, lists and images. The script shows it, reacts to clicks, and reads what the user typed or chose. > **Note: Two MENU systems** > > EasyUO 1.5 and EasyUO 1.6 have different `menu` systems, and Reforged runs both: each script runs under one > of them, picked from what the script uses, or set with [`menu Reforge Mode`](https://ilpersi.github.io/EasyUOReforged/commands/menu/reforge/mode/). > This page describes what they share; every sub-command page says which has it. See > [MENU: EasyUO 1.5 and 1.6](https://ilpersi.github.io/EasyUOReforged/commands/menu/versions/). ```euo menu Clear menu Window Title Loot settings menu Window Size 220 110 menu Text lbl 10 12 Minimum gold: menu Edit gold 110 10 90 100 menu Check bags 10 40 200 20 #true Also open bags menu Button ok 70 75 80 25 Start menu Show set #MenuButton N/A while #MenuButton = N/A wait 1 menu GetNum gold 100 set %mingold #MenuRes menu Get bags set %openbags #MenuRes menu Hide display ok Minimum gold %mingold open bags %openbags halt ``` ## How it works - **Every control has a name**, chosen when you create it. Names are not case-sensitive. Use a different name for each control: [`menu Get`](https://ilpersi.github.io/EasyUOReforged/commands/menu/get/) reads only the first one with a name. - **Clicks** put the button's name in [`#MenuButton`](https://ilpersi.github.io/EasyUOReforged/variables/menubutton/). Closing the window, with its × or with [`menu Hide`](https://ilpersi.github.io/EasyUOReforged/commands/menu/hide/), puts `CLOSED` there. - **Values** are read with [`menu Get`](https://ilpersi.github.io/EasyUOReforged/commands/menu/get/) and [`menu GetNum`](https://ilpersi.github.io/EasyUOReforged/commands/menu/getnum/) into [`#MenuRes`](https://ilpersi.github.io/EasyUOReforged/variables/menures/), and changed with [`menu Set`](https://ilpersi.github.io/EasyUOReforged/commands/menu/set/). - **Positions and sizes** are in pixels, from the top-left corner of the window's inside. - The window stays open when the script stops. Start a script with [`menu Clear`](https://ilpersi.github.io/EasyUOReforged/commands/menu/clear/) so it doesn't add to an old menu. ### Fonts [`menu Font …`](https://ilpersi.github.io/EasyUOReforged/commands/menu/font/name/) commands set the font, size, colours, style and alignment of the controls created **after** them; controls that already exist keep theirs. [`menu Clear`](https://ilpersi.github.io/EasyUOReforged/commands/menu/clear/) puts every font setting back to its default: Arial 10, black on the standard button colour, left-aligned, plain, not transparent. ### Colours Wherever a colour is asked for, give either: - a **name**: `black`, `white`, `red`, `green`, `blue`, `yellow`, `navy`, `gray`, `silver`, … or a system colour such as `btnface` or `windowtext`; - a **number** in Windows' order, `$BBGGRR`: blue first, red last. `$0000FF` is red, `$FF0000` is blue. A web colour `#0099FF` becomes `$FF9900`. ### Building big menus quickly A script runs [`#LPC`](https://ilpersi.github.io/EasyUOReforged/variables/lpc/) lines (10 by default) and then pauses 50 ms, so a menu with a hundred controls takes about half a second to appear. Put `set #LPC 1000` before building it. > **Tip: Lay it out with the mouse** > > The [MENU Designer](https://ilpersi.github.io/EasyUOReforged/designer/), in the release zip, lays out EasyUO 1.6 menu windows on a canvas and writes > their `menu` lines for you. It opens existing scripts too. ## Commands | Window | | |---|---| | [menu Show](https://ilpersi.github.io/EasyUOReforged/commands/menu/show/) / [menu Hide](https://ilpersi.github.io/EasyUOReforged/commands/menu/hide/) | Shows or hides the menu window. | | [menu HideEUO](https://ilpersi.github.io/EasyUOReforged/commands/menu/hideeuo/) | Minimises EasyUO, leaving only the menu window. | | [menu Window Size](https://ilpersi.github.io/EasyUOReforged/commands/menu/window/size/), [Title](https://ilpersi.github.io/EasyUOReforged/commands/menu/window/title/), [Color](https://ilpersi.github.io/EasyUOReforged/commands/menu/window/color/), [Transparent](https://ilpersi.github.io/EasyUOReforged/commands/menu/window/transparent/) | The window's size, title, colour and opacity. | | [menu Clear](https://ilpersi.github.io/EasyUOReforged/commands/menu/clear/) / [menu Delete](https://ilpersi.github.io/EasyUOReforged/commands/menu/delete/) | Removes all controls, or one. | | Controls | | |---|---| | [menu Text](https://ilpersi.github.io/EasyUOReforged/commands/menu/text/) | A label. | | [menu Button](https://ilpersi.github.io/EasyUOReforged/commands/menu/button/) | A button. | | [menu Edit](https://ilpersi.github.io/EasyUOReforged/commands/menu/edit/) / [menu Memo](https://ilpersi.github.io/EasyUOReforged/commands/menu/memo/) | A one-line / multi-line text field. | | [menu Check](https://ilpersi.github.io/EasyUOReforged/commands/menu/check/) | A check box. | | [menu Combo](https://ilpersi.github.io/EasyUOReforged/commands/menu/combo/) / [menu List](https://ilpersi.github.io/EasyUOReforged/commands/menu/list/) | A drop-down list / a list box. | | [menu Shape](https://ilpersi.github.io/EasyUOReforged/commands/menu/shape/) | A rectangle, circle or other shape. | | [menu Image Create](https://ilpersi.github.io/EasyUOReforged/commands/menu/image/create/) | An image to draw in or load a picture into: see the other `menu Image` commands. | | Reading and changing | | |---|---| | [menu Get](https://ilpersi.github.io/EasyUOReforged/commands/menu/get/) / [menu GetNum](https://ilpersi.github.io/EasyUOReforged/commands/menu/getnum/) | Reads a control's value into `#MenuRes`. | | [menu Set](https://ilpersi.github.io/EasyUOReforged/commands/menu/set/) | Changes a control's text or state. | | [menu Activate](https://ilpersi.github.io/EasyUOReforged/commands/menu/activate/) | Gives a control the keyboard focus. | | EasyUO 1.6 only | | |---|---| | [menu Form](https://ilpersi.github.io/EasyUOReforged/commands/menu/form/) | Another window. | | [menu Panel](https://ilpersi.github.io/EasyUOReforged/commands/menu/panel/) | An area that holds controls. | | [menu Radio](https://ilpersi.github.io/EasyUOReforged/commands/menu/radio/) | A radio button. | | [menu GetProp](https://ilpersi.github.io/EasyUOReforged/commands/menu/getprop/) / [menu SetProp](https://ilpersi.github.io/EasyUOReforged/commands/menu/setprop/) | Reads or changes any property of a control or window. | | [menu GetDef](https://ilpersi.github.io/EasyUOReforged/commands/menu/getdef/) / [menu SetDef](https://ilpersi.github.io/EasyUOReforged/commands/menu/setdef/) | Reads or changes what new controls are created with, and where they go. | | [menu PushDef](https://ilpersi.github.io/EasyUOReforged/commands/menu/pushdef/) / [menu PopDef](https://ilpersi.github.io/EasyUOReforged/commands/menu/popdef/) | Saves and brings back those defaults. | | Reforged settings | | |---|---| | [menu Reforge Mode](https://ilpersi.github.io/EasyUOReforged/commands/menu/reforge/mode/) | Chooses the 1.5 or the 1.6 MENU system for the script. | | [menu Reforge IncludeCall](https://ilpersi.github.io/EasyUOReforged/commands/menu/reforge/includecall/) | Makes the automatic choice read called files too. | ## 1.5 and 1.6 What this page describes holds for both MENU systems, except where it speaks of names, `CLOSED` and the start of a script, which follow the 1.5 rules. In the 1.6 logic a name belongs to one control, a click gives the button's name in lower case, [`menu Hide`](https://ilpersi.github.io/EasyUOReforged/commands/menu/hide/) does not set `CLOSED`, and starting a script destroys every menu window and creates a new, hidden one. The details, and a table of which sub-command each system has, are on [MENU: EasyUO 1.5 and 1.6](https://ilpersi.github.io/EasyUOReforged/commands/menu/versions/). *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* *The EasyUO 1.6 behaviour on this page was researched with help from the [ScriptUO](https://www.scriptuo.com/) community: Gaderian's tutorial [New Menu Code and how to adapt old scripts](https://www.scriptuo.com/index.php?topic=15596.0) and the scripts its members share at scriptuo.com.* --- # menu List > Places a list box in the menu window, and fills or selects its entries. - **Syntax:** ``` menu List Create {name} {x} {y} {width} {height} menu List Add {name} {text} menu List Select {name} {number} menu List Clear {name} ``` - **Needs a client:** no - **MENU logic:** 1.5, 1.6 - **Related:** menu Combo, menu Get - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/menu/list/ `menu List` places a list box, which shows several entries at once, and manages its entries. | Form | What it does | |---|---| | `Create {name} {x} {y} {width} {height}` | Places an empty list box. It uses the current [font settings](https://ilpersi.github.io/EasyUOReforged/commands/menu/#fonts). | | `Add {name} {text}` | Adds an entry at the end. Without text, adds an empty line. | | `Select {name} {number}` | Selects entry `number`, counting from 1. `0` selects nothing. | | `Clear {name}` | Removes every entry. | [`menu Get`](https://ilpersi.github.io/EasyUOReforged/commands/menu/get/) returns the number of the selected entry, counting from 1, or `0` when nothing is selected. ## Example ```euo menu Clear menu Font BGColor white menu List Create lst 10 10 180 120 menu List Add lst This is a simple example menu List Add lst showing how to use menu List Add lst a list box. menu List Select lst 2 menu Window Title List example menu Window Size 200 140 menu Show halt ``` ## 1.5 and 1.6 - **1.5:** `Add`, `Select` and `Clear` act on every list with that name. - **1.6:** they act on the one list the name belongs to; a second one created with the same name is out of reach. The list goes into the current [default parent](https://ilpersi.github.io/EasyUOReforged/commands/menu/setdef/). *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* *The EasyUO 1.6 behaviour on this page was researched with help from the [ScriptUO](https://www.scriptuo.com/) community: Gaderian's tutorial [New Menu Code and how to adapt old scripts](https://www.scriptuo.com/index.php?topic=15596.0) and the scripts its members share at scriptuo.com.* --- # menu Memo > Creates a multi-line, scrollable text field in the EasyUO menu window, which can wrap its long lines. - **Syntax:** `menu Memo {name} {x} {y} {width} {height} {text}` - **Needs a client:** no - **New in Reforged:** EasyUO 1.5 does not have it. - **MENU logic:** 1.5, 1.6 - **Related:** menu Edit, menu Get, menu SetProp, #MenuRes - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/menu/memo/ `menu Memo` creates a multi-line text field: the counterpart of [`menu Edit`](https://ilpersi.github.io/EasyUOReforged/commands/menu/edit/) for more than one line. It scrolls when the text does not fit. A line longer than the field runs past its right edge, and the horizontal scroll bar reaches it, unless the memo wraps its lines (see [Wrapping and scroll bars](#wrapping-and-scroll-bars)). ## Parameters | Parameter | Meaning | |---|---| | `name` | Name you use later in [`menu Get`](https://ilpersi.github.io/EasyUOReforged/commands/menu/get/) and [`menu Delete`](https://ilpersi.github.io/EasyUOReforged/commands/menu/delete/). | | `x`, `y` | Position in the menu window. | | `width`, `height` | Size in pixels. | | `text` | Starting text. `$` starts a new line, as in [`menu Text`](https://ilpersi.github.io/EasyUOReforged/commands/menu/text/). | The field uses the current [`menu Font`](https://ilpersi.github.io/EasyUOReforged/commands/menu/font/name/) settings. [`menu Get`](https://ilpersi.github.io/EasyUOReforged/commands/menu/get/) returns the contents with the line breaks turned back into `$`, so the text can go straight into a `display` or another memo. ## Example ```euo menu Clear menu Window Size 300 200 menu Memo notes 10 10 280 150 First line$Second line menu Button ok 10 165 60 25 OK menu Show set #MenuButton N/A while #MenuButton <> ok wait 1 menu Get notes display ok #MenuRes halt ``` ## Wrapping and scroll bars With the [1.6 `menu`](https://ilpersi.github.io/EasyUOReforged/commands/menu/versions/), a memo has two properties of its own, set with [`menu SetProp`](https://ilpersi.github.io/EasyUOReforged/commands/menu/setprop/) and read with [`menu GetProp`](https://ilpersi.github.io/EasyUOReforged/commands/menu/getprop/): | Property | Values | When created | |---|---|---| | `wordwrap` | `#true`: long lines break at the right edge, and the memo has no horizontal bar. `#false`: they run past it. | `#false` | | `scrollbars` | 0 none, 1 horizontal, 2 vertical, 3 both. A bar stays, greyed out, when there is nothing to scroll. Other numbers are ignored. | 3 | Wrapping only changes how the text is shown: [`menu Get`](https://ilpersi.github.io/EasyUOReforged/commands/menu/get/) and `menu GetProp ... text` still return the lines as they were written, with a `$` only where the text had a line break. ```euo menu Window Size 300 200 menu Memo notes 10 10 280 150 A line wider than the memo breaks at its right edge instead of running on$A second line menu SetProp notes wordwrap #true menu SetProp notes scrollbars 2 menu Button ok 10 165 60 25 OK menu Show set #MenuButton N/A while #MenuButton <> ok wait 1 menu Get notes display ok #MenuRes halt ``` `menu SetProp` is one of the sub-commands only the 1.6 `menu` has, so a script that uses it runs under that one by itself. ## Reforged notes `menu Memo` is new in EasyUO Reforged, and so are its `wordwrap` and `scrollbars` properties. ## 1.5 and 1.6 `menu Memo` is a Reforged addition and works in both, with the same syntax. In the 1.6 logic it follows the 1.6 rules: it goes into the current [default parent](https://ilpersi.github.io/EasyUOReforged/commands/menu/setdef/), its name must be free, and [`menu GetProp`](https://ilpersi.github.io/EasyUOReforged/commands/menu/getprop/) / [`menu SetProp`](https://ilpersi.github.io/EasyUOReforged/commands/menu/setprop/) work on it like on an edit field, `text` turning `$` into line breaks and back. Only the 1.6 logic has `wordwrap` and `scrollbars`: under the 1.5 logic a memo never wraps and always has both scroll bars. *The EasyUO 1.6 behaviour on this page was researched with help from the [ScriptUO](https://www.scriptuo.com/) community: Gaderian's tutorial [New Menu Code and how to adapt old scripts](https://www.scriptuo.com/index.php?topic=15596.0) and the scripts its members share at scriptuo.com.* --- # menu Panel > Creates a borderless area that holds other controls; the controls created after it go into it. - **Syntax:** `menu Panel {name} {x} {y} {width} {height}` - **Needs a client:** no - **MENU logic:** 1.6 - **Related:** menu Form, menu Radio, menu SetProp, menu SetDef - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/menu/panel/ `menu Panel` creates a rectangle without a border, in the [default colour](https://ilpersi.github.io/EasyUOReforged/commands/menu/getdef/), that holds other controls. Positions inside it are counted from its own top-left corner. ## Parameters | Parameter | Meaning | |---|---| | `name` | The panel's name. | | `x`, `y` | Position inside the current [default parent](https://ilpersi.github.io/EasyUOReforged/commands/menu/setdef/). | | `width`, `height` | Size in pixels. | ## Description - **Controls created after it go into it**, as with [`menu Form`](https://ilpersi.github.io/EasyUOReforged/commands/menu/form/), until another form or panel, [`menu SetDef parent`](https://ilpersi.github.io/EasyUOReforged/commands/menu/setdef/), [`menu PopDef`](https://ilpersi.github.io/EasyUOReforged/commands/menu/popdef/) or [`menu Clear`](https://ilpersi.github.io/EasyUOReforged/commands/menu/clear/). - What happens to the panel happens to its contents: hiding it with [`menu SetProp`](https://ilpersi.github.io/EasyUOReforged/commands/menu/setprop/) `{name} visible #false` hides them, moving it moves them, and [`menu Delete`](https://ilpersi.github.io/EasyUOReforged/commands/menu/delete/) removes them. - [Radio buttons](https://ilpersi.github.io/EasyUOReforged/commands/menu/radio/) in one panel form their own group. - Give it a colour with `menu SetProp {name} color {number}`. ## Example ```euo menu Window Size 220 130 menu Panel size 10 10 200 30 menu Radio small 5 5 60 20 #true Small menu Radio large 80 5 60 20 #false Large menu SetDef parent form0 menu Panel speed 10 50 200 30 menu Radio slow 5 5 60 20 #true Slow menu Radio fast 80 5 60 20 #false Fast menu SetDef parent form0 menu Button ok 70 95 80 25 OK menu Show halt ``` The two pairs of radio buttons are independent, because each pair has its own panel. *The EasyUO 1.6 behaviour on this page was researched with help from the [ScriptUO](https://www.scriptuo.com/) community: Gaderian's tutorial [New Menu Code and how to adapt old scripts](https://www.scriptuo.com/index.php?topic=15596.0) and the scripts its members share at scriptuo.com.* --- # menu PopDef > Brings back defaults for new menu controls saved by menu PushDef. - **Syntax:** `menu PopDef` - **Needs a client:** no - **MENU logic:** 1.6 - **Related:** menu PushDef, menu SetDef, menu GetDef - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/menu/popdef/ `menu PopDef` replaces the current [defaults](https://ilpersi.github.io/EasyUOReforged/commands/menu/getdef/) with a copy saved by [`menu PushDef`](https://ilpersi.github.io/EasyUOReforged/commands/menu/pushdef/): the font, the colour and the parent. With no copy saved, it does nothing. See `menu PushDef` for an example. ## Notes These are quirks of EasyUO 1.6, kept as they are: - It takes the **oldest** saved copy, not the newest: after two `menu PushDef`, the first `menu PopDef` brings back what the first one saved. - The alignment becomes left, since `menu PushDef` does not save it. - [`menu Clear`](https://ilpersi.github.io/EasyUOReforged/commands/menu/clear/) and starting the script throw away every saved copy. *The EasyUO 1.6 behaviour on this page was researched with help from the [ScriptUO](https://www.scriptuo.com/) community: Gaderian's tutorial [New Menu Code and how to adapt old scripts](https://www.scriptuo.com/index.php?topic=15596.0) and the scripts its members share at scriptuo.com.* --- # menu PushDef > Saves a copy of the current defaults for new menu controls, for menu PopDef to bring back. - **Syntax:** `menu PushDef` - **Needs a client:** no - **MENU logic:** 1.6 - **Related:** menu PopDef, menu SetDef, menu GetDef - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/menu/pushdef/ `menu PushDef` saves a copy of the [defaults](https://ilpersi.github.io/EasyUOReforged/commands/menu/getdef/) new controls are created with: the font, the colour and the parent. [`menu PopDef`](https://ilpersi.github.io/EasyUOReforged/commands/menu/popdef/) brings a saved copy back. ## Example ```euo menu Window Size 300 70 menu PushDef menu Font Style b menu Panel header 0 0 300 30 menu Text title 5 5 Settings menu PopDef menu Text body 5 40 Plain text, in the main window again menu Show halt ``` ## Notes These are quirks of EasyUO 1.6, kept as they are: - The alignment is not saved: after `menu PopDef` it is left. - Copies are added at the end of a list and `menu PopDef` takes the first one, so nested pairs come back in the wrong order. Use one `menu PushDef` / `menu PopDef` pair at a time. *The EasyUO 1.6 behaviour on this page was researched with help from the [ScriptUO](https://www.scriptuo.com/) community: Gaderian's tutorial [New Menu Code and how to adapt old scripts](https://www.scriptuo.com/index.php?topic=15596.0) and the scripts its members share at scriptuo.com.* --- # menu Radio > Creates a radio button; checking one unchecks the others in the same window or panel. - **Syntax:** `menu Radio {name} {x} {y} {width} {height} {checked} {text...}` - **Needs a client:** no - **MENU logic:** 1.6 - **Related:** menu Check, menu Panel, menu Get, menu Set - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/menu/radio/ `menu Radio` creates a radio button. Of the radio buttons with the same parent (a window or a [`menu Panel`](https://ilpersi.github.io/EasyUOReforged/commands/menu/panel/)), only one is checked at a time. ## Parameters | Parameter | Meaning | |---|---| | `name` | The button's name. | | `x`, `y` | Position inside the current [default parent](https://ilpersi.github.io/EasyUOReforged/commands/menu/setdef/). | | `width`, `height` | Size in pixels. | | `checked` | `#true` to check it, `#false` not to. Checking it unchecks the others in the same parent. | | `text` | The label; the rest of the line. | ## Description - [`menu Get`](https://ilpersi.github.io/EasyUOReforged/commands/menu/get/) reads it: `-1` when checked, `0` when not. [`menu Set`](https://ilpersi.github.io/EasyUOReforged/commands/menu/set/) `{name} 1` checks it. - [`menu GetProp`](https://ilpersi.github.io/EasyUOReforged/commands/menu/getprop/) / [`menu SetProp`](https://ilpersi.github.io/EasyUOReforged/commands/menu/setprop/) `{name} checked` do the same with `#true` / `#false`. - The label is on the right, or on the left after [`menu Font Align right`](https://ilpersi.github.io/EasyUOReforged/commands/menu/font/align/). ## Example ```euo menu Window Size 120 100 menu Radio easy 10 10 80 20 #true Easy menu Radio hard 10 35 80 20 #false Hard menu Button go 10 65 60 25 Go menu Show set #MenuButton N/A while #MenuButton = N/A wait 1 menu Get hard if #MenuRes = -1 display ok Hard it is. else display ok Easy it is. halt ``` *The EasyUO 1.6 behaviour on this page was researched with help from the [ScriptUO](https://www.scriptuo.com/) community: Gaderian's tutorial [New Menu Code and how to adapt old scripts](https://www.scriptuo.com/index.php?topic=15596.0) and the scripts its members share at scriptuo.com.* --- # menu Reforge IncludeCall > Makes Reforged's choice of MENU system look at the files the script calls, too. - **Syntax:** `menu Reforge IncludeCall {#true|#false}` - **Needs a client:** no - **New in Reforged:** EasyUO 1.5 does not have it. - **MENU logic:** 1.5, 1.6 - **Related:** menu Reforge Mode, Call - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/menu/reforge/includecall/ When a script starts, Reforged picks its [MENU system](https://ilpersi.github.io/EasyUOReforged/commands/menu/versions/) by reading the script for the sub-commands only EasyUO 1.6 has. By default it reads only the main script. With `menu Reforge IncludeCall #true` it also reads the files the script pulls in with [`call`](https://ilpersi.github.io/EasyUOReforged/commands/call/), and the files those call. ## Parameters | Parameter | Meaning | |---|---| | `#true` | Read the called files too. `true`, `1` and `-1` mean the same. | | `#false` | Read only the main script, the default. `false` and `0` mean the same. | ## Description - **Which files.** Every `call` line with a file name written out, found the way `call` finds it: a name without a folder is looked for in EasyUO Reforged's own folder, and `.txt`, then `.euo`, is added when the name as given does not exist. Each file is read once, so files calling each other are fine. - **Not seen.** A file name taken from a variable (`call %lib`) or built with `,` is only known when the line runs, so that file is not read. Neither is a file that does not exist when the script starts. Use [`menu Reforge Mode 1.6`](https://ilpersi.github.io/EasyUOReforged/commands/menu/reforge/mode/) for those scripts. - **[`menu Reforge Mode`](https://ilpersi.github.io/EasyUOReforged/commands/menu/reforge/mode/) wins.** When the script sets the mode, nothing is read. - Like `menu Reforge Mode`, it is read from the main script before it runs, needs its value written out, does nothing when the line runs, and is ignored by EasyUO 1.5 and 1.6. ## Example Save this as `menulib.txt` in the folder EasyUO Reforged is in: ```euo title="menulib.txt" menu Form lib 300 200 260 50 Built by menulib.txt menu Text t 10 10 This window comes from the called file. menu SetProp lib visible #true exit ``` Then run this script. Without its first line it would run under the 1.5 MENU and show nothing. ```euo title="Main script" menu Reforge IncludeCall #true call menulib.txt ; uses menu Form: the script runs under the 1.6 MENU halt ``` ## Reforged notes `menu Reforge IncludeCall` is new in EasyUO Reforged, which runs both MENU systems. --- # menu Reforge Mode > Chooses which MENU system the script runs under: EasyUO 1.5's or 1.6's. - **Syntax:** `menu Reforge Mode {1.5|1.6}` - **Needs a client:** no - **New in Reforged:** EasyUO 1.5 does not have it. - **MENU logic:** 1.5, 1.6 - **Related:** menu Reforge IncludeCall, menu Form, menu Text - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/menu/reforge/mode/ `menu Reforge Mode` chooses the [MENU system](https://ilpersi.github.io/EasyUOReforged/commands/menu/versions/) a script runs under: `1.5`, the one whose source was published, or `1.6`, the later one with windows, panels and properties. Without it, Reforged picks one by looking for the sub-commands only 1.6 has. ## Parameters | Parameter | Meaning | |---|---| | `1.5` or `1.6` | The MENU system for this run. | ## Description - **Read before the script runs.** Reforged reads it from the script's text when the script starts, so it can go anywhere; the top is the clearest place. When the line runs, it does nothing. - **Written out.** The value must be `1.5` or `1.6` as such: a variable (`menu Reforge Mode %m`) cannot be read before the run and is ignored, as is any other value. The first line with a valid value counts. - **Main script only.** In a file pulled in with [`call`](https://ilpersi.github.io/EasyUOReforged/commands/call/) it has no effect; called files always run under the main script's choice. - **Portable.** EasyUO 1.5 and 1.6 ignore the line, so a script that has it still runs there. The editor's status bar shows `MENU 1.6 (forced)` or `MENU 1.5 (forced)` while a script chosen this way runs. ## Example ```euo menu Reforge Mode 1.6 set %make Form set %change SetProp menu %make main 300 200 260 50 Chosen by menu Reforge Mode menu Text t 10 10 Form and SetProp come from variables. menu %change main visible #true halt ``` ## Reforged notes `menu Reforge Mode` is new in EasyUO Reforged, which runs both MENU systems. --- # menu Set > Changes the text or state of a control. - **Syntax:** `menu Set {name} {value}` - **Needs a client:** no - **MENU logic:** 1.5, 1.6 - **Related:** menu Get, menu Combo, menu List - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/menu/set/ `menu Set` changes a control: | Control | What changes | |---|---| | [Edit](https://ilpersi.github.io/EasyUOReforged/commands/menu/edit/) | Its text. | | [Memo](https://ilpersi.github.io/EasyUOReforged/commands/menu/memo/) | Its text; `$` starts a new line. | | [Text](https://ilpersi.github.io/EasyUOReforged/commands/menu/text/) | Its text; `$` does **not** start a new line here. | | [Button](https://ilpersi.github.io/EasyUOReforged/commands/menu/button/) | Its caption. | | [Check](https://ilpersi.github.io/EasyUOReforged/commands/menu/check/) | Checked with any number other than 0 (`#true`), unchecked with `0` (`#false`). | Drop-down lists and list boxes are changed with [`menu Combo`](https://ilpersi.github.io/EasyUOReforged/commands/menu/combo/) and [`menu List`](https://ilpersi.github.io/EasyUOReforged/commands/menu/list/) instead. If several controls share the name, all of them change. ## Example ```euo menu Clear menu Window Size 180 70 menu Text status 10 10 Waiting... menu Check loot 10 35 150 20 #true Loot corpses menu Show wait 40 menu Set status Looting... menu Set loot #false halt ``` ## 1.5 and 1.6 - **1.5:** changes every control with that name. - **1.6:** changes the one control the name belongs to, and also sets [radio buttons](https://ilpersi.github.io/EasyUOReforged/commands/menu/radio/): `1` checks one. `$` stays as written in both. *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* *The EasyUO 1.6 behaviour on this page was researched with help from the [ScriptUO](https://www.scriptuo.com/) community: Gaderian's tutorial [New Menu Code and how to adapt old scripts](https://www.scriptuo.com/index.php?topic=15596.0) and the scripts its members share at scriptuo.com.* --- # menu SetDef > Changes one of the defaults new menu controls are created with, such as the window or panel they go into. - **Syntax:** `menu SetDef {key} {value...}` - **Needs a client:** no - **MENU logic:** 1.6 - **Related:** menu GetDef, menu PushDef, menu PopDef, menu SetProp - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/menu/setdef/ `menu SetDef` changes one of the defaults the controls created after it take. The keys are listed on [`menu GetDef`](https://ilpersi.github.io/EasyUOReforged/commands/menu/getdef/). Controls that already exist keep what they have; change those with [`menu SetProp`](https://ilpersi.github.io/EasyUOReforged/commands/menu/setprop/). ## Description - `menu SetDef parent {name}` makes new controls go into that window or panel. `form0` is the main window. - `fontname` takes the rest of the line. The others take one value. - Numbers must be written as numbers: a colour name such as `red`, or `right` for the alignment, counts as 0. The [`menu Font`](https://ilpersi.github.io/EasyUOReforged/commands/menu/font/name/) sub-commands accept names and set the same defaults. ## Example ```euo menu Window Size 220 120 menu Panel tools 10 10 200 60 menu SetProp tools color $FFE0C0 menu Button a 5 5 60 25 One menu SetDef parent form0 menu Button b 10 80 60 25 Two menu Show halt ``` `a` goes into the panel; `b`, after `menu SetDef parent form0`, into the main window. *The EasyUO 1.6 behaviour on this page was researched with help from the [ScriptUO](https://www.scriptuo.com/) community: Gaderian's tutorial [New Menu Code and how to adapt old scripts](https://www.scriptuo.com/index.php?topic=15596.0) and the scripts its members share at scriptuo.com.* --- # menu SetProp > Changes a property of a menu control or window: show or hide it, move it, recolour it, give it a tooltip. - **Syntax:** `menu SetProp {name} {property} {value...}` - **Needs a client:** no - **MENU logic:** 1.6 - **Related:** menu GetProp, menu SetDef, menu Set, menu Form - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/menu/setprop/ `menu SetProp` changes one property of a control, or of a window made by [`menu Form`](https://ilpersi.github.io/EasyUOReforged/commands/menu/form/) (the main window is `form0`). The properties are listed on [`menu GetProp`](https://ilpersi.github.io/EasyUOReforged/commands/menu/getprop/). ## Parameters | Parameter | Meaning | |---|---| | `name` | The control or window. | | `property` | Which property; not case-sensitive. | | `value` | The new value; for text properties, the rest of the line. | ## Description - **Text** properties (`text`, `tooltip`, `fontname`) take the rest of the line. - **Numbers** must be written as numbers. A colour name such as `red` counts as 0, which is black: use `$0000FF` for red. - **Yes/no** properties: `#true`, or any number other than 0, is yes. - **`parent`** moves the control into another window or panel by its name, keeping its `left` and `top`. A label or an image cannot hold controls; neither can the control itself. - **`width` and `height` of a form** set the size of its inside, exactly. - **A memo** ([`menu Memo`](https://ilpersi.github.io/EasyUOReforged/commands/menu/memo/), Reforged only) also has `wordwrap` and `scrollbars`: `menu SetProp notes wordwrap #true` breaks its long lines at the right edge. ## Example ```euo menu Form opts 300 200 200 100 Options menu Button ok 60 60 80 25 OK menu SetProp ok tooltip Saves the options and closes the window menu SetProp ok fontstyle 1 menu SetProp opts color $C0FFC0 menu SetProp opts visible #true set #MenuButton N/A while #MenuButton = N/A wait 1 menu SetProp opts visible #false halt ``` *The EasyUO 1.6 behaviour on this page was researched with help from the [ScriptUO](https://www.scriptuo.com/) community: Gaderian's tutorial [New Menu Code and how to adapt old scripts](https://www.scriptuo.com/index.php?topic=15596.0) and the scripts its members share at scriptuo.com.* --- # menu Shape > Draws a rectangle, circle or other shape in the menu window. - **Syntax:** `menu Shape {name} {x} {y} {width} {height} {shape} {line style} {line width} {line colour} {fill style} {fill colour}` - **Needs a client:** no - **MENU logic:** 1.5, 1.6 - **Related:** menu Image Create - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/menu/shape/ `menu Shape` draws a shape, useful for frames, separators and coloured backgrounds behind other controls. ## Parameters | Parameter | Meaning | |---|---| | `name` | The control's name, used later by [`menu Get`](https://ilpersi.github.io/EasyUOReforged/commands/menu/get/), [`menu Set`](https://ilpersi.github.io/EasyUOReforged/commands/menu/set/) and [`menu Delete`](https://ilpersi.github.io/EasyUOReforged/commands/menu/delete/). Case does not matter. | | `x`, `y`, `width`, `height` | Position and size of the box the shape fills. | | `shape` | Which shape, see below. | | `line style`, `line width`, `line colour` | How the outline is drawn. | | `fill style`, `fill colour` | How the inside is filled. | Colours are names such as `white` or `$BBGGRR` numbers, see [Colours](https://ilpersi.github.io/EasyUOReforged/commands/menu/#colours). | Shape | | Line style | | Fill style | | |---|---|---|---|---|---| | `1` | Circle | `1` | None | `1` | Diagonal lines `/` | | `2` | Ellipse | `2` | Dashes | `2` | None | | `3` | Rectangle | `3` | Dash dot | `3` | Cross-hatch | | `4` | Rounded rectangle | `4` | Dash dot dot | `4` | Diagonal cross-hatch | | `5` | Rounded square | `5` | Dots | `5` | Diagonal lines `\` | | `6` | Square | `6` | Solid, inside the box | `6` | Horizontal lines | | | | `7` | Solid | `7` | Solid | | | | | | `8` | Vertical lines | Any other number gives a rectangle, a solid line and a solid fill. ## Example ```euo menu Clear menu Window Size 200 100 ; a white frame with a dark inside menu Shape frame 5 5 190 90 3 7 2 white 7 $303030 menu Show halt ``` ## 1.5 and 1.6 In 1.6 a shape is drawn into an [image](https://ilpersi.github.io/EasyUOReforged/commands/menu/image/create/): - the line is solid, or absent with line type 1; dashed and dotted lines become solid; - the inside is filled only with fill type 7; any other fill type leaves it empty, hatching included; - rounded corners are square; - types 1 and 2 are drawn as ellipses, the others as rectangles; types 1, 5 and 6 shrink the box to a square, centred in it; - a thick line is drawn inside the box, off-centre by half its width, as EasyUO 1.6 did; - being an image, the shape can be drawn on with the `menu Image` commands; - a negative width, height, shape type, line type, line width or fill type is refused. *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* *The EasyUO 1.6 behaviour on this page was researched with help from the [ScriptUO](https://www.scriptuo.com/) community: Gaderian's tutorial [New Menu Code and how to adapt old scripts](https://www.scriptuo.com/index.php?topic=15596.0) and the scripts its members share at scriptuo.com.* --- # menu Show > Shows the menu window, optionally at a position on the screen. - **Syntax:** `menu Show [x y]` - **Needs a client:** no - **MENU logic:** 1.5, 1.6 - **Related:** menu Hide, menu HideEUO - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/menu/show/ `menu Show` shows the menu window. With `x` and `y`, it first moves the window so that its top-left corner is at that position on the screen. [`menu Hide`](https://ilpersi.github.io/EasyUOReforged/commands/menu/hide/) hides it again. ## Example ```euo menu Clear menu Text t 10 10 Hello menu Show 200 150 halt ``` ## 1.5 and 1.6 - **1.6:** also puts the window on top of the others. It does nothing after [`menu Delete form0`](https://ilpersi.github.io/EasyUOReforged/commands/menu/delete/). Show another window with [`menu SetProp`](https://ilpersi.github.io/EasyUOReforged/commands/menu/setprop/) `{name} visible #true`. *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* *The EasyUO 1.6 behaviour on this page was researched with help from the [ScriptUO](https://www.scriptuo.com/) community: Gaderian's tutorial [New Menu Code and how to adapt old scripts](https://www.scriptuo.com/index.php?topic=15596.0) and the scripts its members share at scriptuo.com.* --- # menu Text > Places a label in the menu window; $ starts a new line. - **Syntax:** `menu Text {name} {x} {y} {text}` - **Needs a client:** no - **MENU logic:** 1.5, 1.6 - **Related:** menu Set, menu Font Name - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/menu/text/ `menu Text` places a label at `x`, `y`. The label is as big as its text. `$` in the text starts a new line. It uses the current [font settings](https://ilpersi.github.io/EasyUOReforged/commands/menu/#fonts). [`menu Font Align`](https://ilpersi.github.io/EasyUOReforged/commands/menu/font/align/) aligns the lines of a multi-line label, and [`menu Font Transparent`](https://ilpersi.github.io/EasyUOReforged/commands/menu/font/transparent/) drops its background. ## Parameters | Parameter | Meaning | |---|---| | `name` | The control's name, used later by [`menu Get`](https://ilpersi.github.io/EasyUOReforged/commands/menu/get/), [`menu Set`](https://ilpersi.github.io/EasyUOReforged/commands/menu/set/) and [`menu Delete`](https://ilpersi.github.io/EasyUOReforged/commands/menu/delete/). Case does not matter. | | `x`, `y` | Position of the label's top-left corner. | | `text` | The text. | Change the text later with [`menu Set`](https://ilpersi.github.io/EasyUOReforged/commands/menu/set/); `$` does not start a new line there. A label's text cannot be read back with `menu Get`. ## Example ```euo menu Clear menu Window Size 180 40 menu Text status 10 10 Waiting... menu Show wait 40 menu Set status Done halt ``` ## 1.5 and 1.6 - **1.6:** labels always have a background, in the colour set by [`menu Font BgColor`](https://ilpersi.github.io/EasyUOReforged/commands/menu/font/bgcolor/): [`menu Font Transparent`](https://ilpersi.github.io/EasyUOReforged/commands/menu/font/transparent/) is ignored. The label goes into the current [default parent](https://ilpersi.github.io/EasyUOReforged/commands/menu/setdef/), and its name must be free: a second label with a taken name stays on screen but cannot be changed or deleted. *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* *The EasyUO 1.6 behaviour on this page was researched with help from the [ScriptUO](https://www.scriptuo.com/) community: Gaderian's tutorial [New Menu Code and how to adapt old scripts](https://www.scriptuo.com/index.php?topic=15596.0) and the scripts its members share at scriptuo.com.* --- # MENU: EasyUO 1.5 and 1.6 > The two MENU systems Reforged runs, how it picks one for a script, how to choose it yourself, and every difference between them. - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/menu/versions/ EasyUO has two different `menu` systems, and EasyUO Reforged runs both. Each script runs under one of them, the **1.5 logic** or the **1.6 logic**, chosen when the script starts. ## Why there are two - **EasyUO 1.5** is the version whose source code was published. Its `menu` builds one window with controls in it. Reforged is a port of that source, so this is the `menu` most scripts were written for. - **EasyUO 1.6** came later, around 2017, as closed builds. Its author rewrote `menu`: any number of windows ([`menu Form`](https://ilpersi.github.io/EasyUOReforged/commands/menu/form/)), containers ([`menu Panel`](https://ilpersi.github.io/EasyUOReforged/commands/menu/panel/)), radio buttons, and reading and changing any property of any control ([`menu GetProp`](https://ilpersi.github.io/EasyUOReforged/commands/menu/getprop/), [`menu SetProp`](https://ilpersi.github.io/EasyUOReforged/commands/menu/setprop/)). The rewrite also changed how the old sub-commands behave in places: names, [`#MenuButton`](https://ilpersi.github.io/EasyUOReforged/variables/menubutton/), what happens when a script starts. Neither is a superset of the other. A script written for 1.6 shows nothing under 1.5, and some scripts written for 1.5 misbehave under 1.6. Reforged's 1.6 logic is a port of what EasyUO 1.6.0.337 does, checked against the real program; the few places where it differs on purpose are on [Known limitations](https://ilpersi.github.io/EasyUOReforged/reforged/known-limitations/). ## How Reforged picks one When a stopped script starts, Reforged reads its text once: 1. A [`menu Reforge Mode`](https://ilpersi.github.io/EasyUOReforged/commands/menu/reforge/mode/) line decides: `1.5` or `1.6`. 2. Otherwise, a `menu` line using any of the nine sub-commands only 1.6 has selects the 1.6 logic: [`Form`](https://ilpersi.github.io/EasyUOReforged/commands/menu/form/), [`Panel`](https://ilpersi.github.io/EasyUOReforged/commands/menu/panel/), [`Radio`](https://ilpersi.github.io/EasyUOReforged/commands/menu/radio/), [`GetProp`](https://ilpersi.github.io/EasyUOReforged/commands/menu/getprop/), [`SetProp`](https://ilpersi.github.io/EasyUOReforged/commands/menu/setprop/), [`GetDef`](https://ilpersi.github.io/EasyUOReforged/commands/menu/getdef/), [`SetDef`](https://ilpersi.github.io/EasyUOReforged/commands/menu/setdef/), [`PushDef`](https://ilpersi.github.io/EasyUOReforged/commands/menu/pushdef/) and [`PopDef`](https://ilpersi.github.io/EasyUOReforged/commands/menu/popdef/). 3. Otherwise, the 1.5 logic. ```euo menu Form main 300 200 260 50 My tool ; 1.6-only: this script runs under the 1.6 logic menu Text t 10 10 Built with menu Form. menu SetProp main visible #true halt ``` ```euo menu Clear menu Text status 10 10 Waiting... ; only sub-commands both have: the 1.5 logic menu Show halt ``` Only real `menu` lines count: a sub-command in a comment does not, and neither does one that comes from a variable (`menu %what ...`), which is only known once the line runs. Files the script pulls in with [`call`](https://ilpersi.github.io/EasyUOReforged/commands/call/) are not read, unless the script says [`menu Reforge IncludeCall #true`](https://ilpersi.github.io/EasyUOReforged/commands/menu/reforge/includecall/). The editor's status bar shows which logic the script runs, or ran last: `MENU 1.5`, `MENU 1.6`, or `MENU 1.6 (forced)` when `menu Reforge Mode` chose it. If a 1.6-only sub-command does run under a 1.5 logic that was chosen for you, Reforged says so once per run, in a message box, and tells you which line to add. The script keeps running; under 1.5 that line does nothing. ## Choosing it yourself Put a `menu Reforge Mode` line in the main script, usually at the top: ```euo menu Reforge Mode 1.6 set %make Form set %change SetProp menu %make main 300 200 260 50 Chosen by menu Reforge Mode menu Text t 10 10 Form and SetProp come from variables. menu %change main visible #true halt ``` It is read before the script runs, wherever it is, so it works even in a script whose 1.6 sub-commands all come from variables or from called files. The value must be written as `1.5` or `1.6`; a variable is not read. EasyUO 1.5 and 1.6 themselves ignore the line, so a script that has it still runs there. [`menu Reforge IncludeCall #true`](https://ilpersi.github.io/EasyUOReforged/commands/menu/reforge/includecall/) makes the automatic choice read the files the script calls too. The [MENU Designer](https://ilpersi.github.io/EasyUOReforged/designer/) writes 1.6 windows only, and every file it saves starts with `menu Reforge Mode 1.6`. ## One logic for the whole run The choice holds for the whole run, for the main script and every file it calls, as in EasyUO, where one version ran everything. The two logics cannot be mixed: a window built by one is unknown to the other. To change logic, stop the script and start it again; the windows of the old logic are taken down first. ## Which sub-commands each has **Differs** links to how the sub-command behaves differently in the two. | Sub-command | 1.5 | 1.6 | | |---|:-:|:-:|---| | [menu Activate](https://ilpersi.github.io/EasyUOReforged/commands/menu/activate/) | ✓ | ✓ | [Differs](https://ilpersi.github.io/EasyUOReforged/commands/menu/activate/#15-and-16) | | [menu Button](https://ilpersi.github.io/EasyUOReforged/commands/menu/button/) | ✓ | ✓ | [Differs](https://ilpersi.github.io/EasyUOReforged/commands/menu/button/#15-and-16) | | [menu Check](https://ilpersi.github.io/EasyUOReforged/commands/menu/check/) | ✓ | ✓ | [Differs](https://ilpersi.github.io/EasyUOReforged/commands/menu/check/#15-and-16) | | [menu Clear](https://ilpersi.github.io/EasyUOReforged/commands/menu/clear/) | ✓ | ✓ | [Differs](https://ilpersi.github.io/EasyUOReforged/commands/menu/clear/#15-and-16) | | [menu Combo](https://ilpersi.github.io/EasyUOReforged/commands/menu/combo/) (Create, Add, Select, Clear) | ✓ | ✓ | [Differs](https://ilpersi.github.io/EasyUOReforged/commands/menu/combo/#15-and-16) | | [menu Delete](https://ilpersi.github.io/EasyUOReforged/commands/menu/delete/) | ✓ | ✓ | [Differs](https://ilpersi.github.io/EasyUOReforged/commands/menu/delete/#15-and-16) | | [menu Edit](https://ilpersi.github.io/EasyUOReforged/commands/menu/edit/) | ✓ | ✓ | [Differs](https://ilpersi.github.io/EasyUOReforged/commands/menu/edit/#15-and-16) | | [menu Font Align](https://ilpersi.github.io/EasyUOReforged/commands/menu/font/align/), [BgColor](https://ilpersi.github.io/EasyUOReforged/commands/menu/font/bgcolor/), [Color](https://ilpersi.github.io/EasyUOReforged/commands/menu/font/color/), [Name](https://ilpersi.github.io/EasyUOReforged/commands/menu/font/name/), [Size](https://ilpersi.github.io/EasyUOReforged/commands/menu/font/size/), [Style](https://ilpersi.github.io/EasyUOReforged/commands/menu/font/style/) | ✓ | ✓ | | | [menu Font Transparent](https://ilpersi.github.io/EasyUOReforged/commands/menu/font/transparent/) | ✓ | | ignored by 1.6 | | [menu Form](https://ilpersi.github.io/EasyUOReforged/commands/menu/form/) | | ✓ | | | [menu Get](https://ilpersi.github.io/EasyUOReforged/commands/menu/get/) | ✓ | ✓ | [Differs](https://ilpersi.github.io/EasyUOReforged/commands/menu/get/#15-and-16) | | [menu GetDef](https://ilpersi.github.io/EasyUOReforged/commands/menu/getdef/) | | ✓ | | | [menu GetNum](https://ilpersi.github.io/EasyUOReforged/commands/menu/getnum/) | ✓ | ✓ | [Differs](https://ilpersi.github.io/EasyUOReforged/commands/menu/getnum/#15-and-16) | | [menu GetProp](https://ilpersi.github.io/EasyUOReforged/commands/menu/getprop/) | | ✓ | | | [menu Hide](https://ilpersi.github.io/EasyUOReforged/commands/menu/hide/) | ✓ | ✓ | [Differs](https://ilpersi.github.io/EasyUOReforged/commands/menu/hide/#15-and-16) | | [menu HideEUO](https://ilpersi.github.io/EasyUOReforged/commands/menu/hideeuo/) | ✓ | | ignored by 1.6 | | [menu Image Create](https://ilpersi.github.io/EasyUOReforged/commands/menu/image/create/) | ✓ | ✓ | [Differs](https://ilpersi.github.io/EasyUOReforged/commands/menu/image/create/#15-and-16) | | [menu Image Ellipse](https://ilpersi.github.io/EasyUOReforged/commands/menu/image/ellipse/), [Line](https://ilpersi.github.io/EasyUOReforged/commands/menu/image/line/), [Rectangle](https://ilpersi.github.io/EasyUOReforged/commands/menu/image/rectangle/) | ✓ | ✓ | [Differs](https://ilpersi.github.io/EasyUOReforged/commands/menu/image/line/#15-and-16) | | [menu Image File](https://ilpersi.github.io/EasyUOReforged/commands/menu/image/file/), [FloodFill](https://ilpersi.github.io/EasyUOReforged/commands/menu/image/floodfill/), [Pix](https://ilpersi.github.io/EasyUOReforged/commands/menu/image/pix/) | ✓ | ✓ | | | [menu Image PixLine](https://ilpersi.github.io/EasyUOReforged/commands/menu/image/pixline/) | ✓ | | ignored by 1.6 | | [menu Image Pos](https://ilpersi.github.io/EasyUOReforged/commands/menu/image/pos/) | ✓ | ✓ | [Differs](https://ilpersi.github.io/EasyUOReforged/commands/menu/image/pos/#15-and-16) | | [menu List](https://ilpersi.github.io/EasyUOReforged/commands/menu/list/) (Create, Add, Select, Clear) | ✓ | ✓ | [Differs](https://ilpersi.github.io/EasyUOReforged/commands/menu/list/#15-and-16) | | [menu Memo](https://ilpersi.github.io/EasyUOReforged/commands/menu/memo/) (Reforged) | ✓ | ✓ | [Differs](https://ilpersi.github.io/EasyUOReforged/commands/menu/memo/#15-and-16) | | [menu Panel](https://ilpersi.github.io/EasyUOReforged/commands/menu/panel/) | | ✓ | | | [menu PopDef](https://ilpersi.github.io/EasyUOReforged/commands/menu/popdef/), [menu PushDef](https://ilpersi.github.io/EasyUOReforged/commands/menu/pushdef/) | | ✓ | | | [menu Radio](https://ilpersi.github.io/EasyUOReforged/commands/menu/radio/) | | ✓ | | | [menu Reforge Mode](https://ilpersi.github.io/EasyUOReforged/commands/menu/reforge/mode/), [IncludeCall](https://ilpersi.github.io/EasyUOReforged/commands/menu/reforge/includecall/) (Reforged) | ✓ | ✓ | | | [menu Set](https://ilpersi.github.io/EasyUOReforged/commands/menu/set/) | ✓ | ✓ | [Differs](https://ilpersi.github.io/EasyUOReforged/commands/menu/set/#15-and-16) | | [menu SetDef](https://ilpersi.github.io/EasyUOReforged/commands/menu/setdef/) | | ✓ | | | [menu SetProp](https://ilpersi.github.io/EasyUOReforged/commands/menu/setprop/) | | ✓ | | | [menu Shape](https://ilpersi.github.io/EasyUOReforged/commands/menu/shape/) | ✓ | ✓ | [Differs](https://ilpersi.github.io/EasyUOReforged/commands/menu/shape/#15-and-16) | | [menu Show](https://ilpersi.github.io/EasyUOReforged/commands/menu/show/) | ✓ | ✓ | [Differs](https://ilpersi.github.io/EasyUOReforged/commands/menu/show/#15-and-16) | | [menu Text](https://ilpersi.github.io/EasyUOReforged/commands/menu/text/) | ✓ | ✓ | [Differs](https://ilpersi.github.io/EasyUOReforged/commands/menu/text/#15-and-16) | | [menu Window Color](https://ilpersi.github.io/EasyUOReforged/commands/menu/window/color/), [Size](https://ilpersi.github.io/EasyUOReforged/commands/menu/window/size/), [Title](https://ilpersi.github.io/EasyUOReforged/commands/menu/window/title/), [Transparent](https://ilpersi.github.io/EasyUOReforged/commands/menu/window/transparent/) | ✓ | ✓ | | ## The differences in detail ### Names - **1.5:** several controls may share a name. [`menu Set`](https://ilpersi.github.io/EasyUOReforged/commands/menu/set/), [`menu Delete`](https://ilpersi.github.io/EasyUOReforged/commands/menu/delete/), `combo`/`list` `Add`, `Select` and `Clear`, and the `menu Image` drawing commands act on **all** of them; [`menu Get`](https://ilpersi.github.io/EasyUOReforged/commands/menu/get/) and [`menu Activate`](https://ilpersi.github.io/EasyUOReforged/commands/menu/activate/) use the first. - **1.6:** a name belongs to one control. A second control created with a taken name still appears, but no command can reach it: `menu Set` changes the first, `menu Delete` removes only the first, and a click on the second button records nothing. Names are not case-sensitive and are kept in lower case. ```euo menu Clear menu Window Size 200 70 menu Text status 10 10 one menu Text status 10 30 two menu Set status three ; 1.5: both labels say "three". 1.6: only the first does. menu Show halt ``` ### #MenuButton and #MenuRes | | 1.5 | 1.6 | |---|---|---| | A button click | the button's name in capitals | the button's name in lower case | | The window's × | `CLOSED` | `CLOSED` for the main window; another [`menu Form`](https://ilpersi.github.io/EasyUOReforged/commands/menu/form/) gives its own name | | [`menu Hide`](https://ilpersi.github.io/EasyUOReforged/commands/menu/hide/) | `CLOSED` | unchanged | | [`menu Clear`](https://ilpersi.github.io/EasyUOReforged/commands/menu/clear/) | unchanged | emptied | | A script starting | unchanged: the last run's value | `#MenuButton` and `#MenuRes` emptied | In 1.6, `set #MenuButton form0` reads back as `CLOSED`. ### Starting and stopping - **1.5:** starting a script frees its controls but leaves the window as it was, shown or hidden. - **1.6:** starting a script destroys every menu window, then creates a new, hidden main window at 100,100 with a 305 × 180 inside. Stopping a script leaves every window as it is in both. ### The main window In 1.6 the main window is a control called `form0`: [`menu GetProp`](https://ilpersi.github.io/EasyUOReforged/commands/menu/getprop/) and [`menu SetProp`](https://ilpersi.github.io/EasyUOReforged/commands/menu/setprop/) work on it, `menu SetDef parent form0` puts new controls back in it, and `menu Delete form0` destroys it until the next start. It has a fixed frame without a maximize button. In 1.5 it is a resizable window that no command can name. ### Shapes In 1.5 [`menu Shape`](https://ilpersi.github.io/EasyUOReforged/commands/menu/shape/) is a real shape: dashed lines, hatched fills, rounded corners. In 1.6 it is drawn into an image: the line is solid or absent, the inside is filled only with fill type 7, rounded corners are square, and types 1, 5 and 6 shrink the box to a centred square. Because it is an image, `menu Image` commands can draw on it. ### Labels and the removed sub-commands 1.6 ignores [`menu Font Transparent`](https://ilpersi.github.io/EasyUOReforged/commands/menu/font/transparent/): its labels always have a background, in the colour set by [`menu Font BgColor`](https://ilpersi.github.io/EasyUOReforged/commands/menu/font/bgcolor/). It also ignores [`menu HideEUO`](https://ilpersi.github.io/EasyUOReforged/commands/menu/hideeuo/) and [`menu Image PixLine`](https://ilpersi.github.io/EasyUOReforged/commands/menu/image/pixline/). ### Checks on numbers 1.6 refuses a negative width or height in [`menu Image Create`](https://ilpersi.github.io/EasyUOReforged/commands/menu/image/create/) and [`menu Shape`](https://ilpersi.github.io/EasyUOReforged/commands/menu/shape/), and a negative second corner in `menu Image Line`, `Ellipse` and `Rectangle`. An invalid line width draws a 1-pixel line in 1.6 and nothing in 1.5. ### Other sub-commands - [`menu Activate`](https://ilpersi.github.io/EasyUOReforged/commands/menu/activate/) works on any control in 1.6 and brings its window to the front. - [`menu Get`](https://ilpersi.github.io/EasyUOReforged/commands/menu/get/) and [`menu Set`](https://ilpersi.github.io/EasyUOReforged/commands/menu/set/) also work on radio buttons in 1.6. - [`menu Image Pos`](https://ilpersi.github.io/EasyUOReforged/commands/menu/image/pos/) moves any control in 1.6, and stretches an image only when a size is given. - [`menu Show`](https://ilpersi.github.io/EasyUOReforged/commands/menu/show/) also puts the window on top in 1.6. ## Moving a script from 1.5 to 1.6 - Give every control its own name, at least those the script changes, reads or deletes later. - Set `#MenuButton` to `N/A` before waiting for a click. (Its case changes, from `OK` to `ok`, but `=` ignores case.) - Don't wait for `CLOSED` after `menu Hide`: in 1.6 hiding is silent. - Instead of `menu Font Transparent`, give labels the colour of what is behind them. - Check shapes that use dashed lines, hatching or rounded corners. - Add `menu Reforge Mode 1.6` at the top, so Reforged does not depend on detecting it. ## Moving a script from 1.6 to 1.5 The nine 1.6-only sub-commands do nothing in 1.5. Build a single window with [`menu Window`](https://ilpersi.github.io/EasyUOReforged/commands/menu/window/size/) and [`menu Show`](https://ilpersi.github.io/EasyUOReforged/commands/menu/show/) instead of forms, place controls directly instead of in panels, use check boxes instead of radio buttons, and read values with [`menu Get`](https://ilpersi.github.io/EasyUOReforged/commands/menu/get/) instead of `menu GetProp`. *The EasyUO 1.6 behaviour on this page was researched with help from the [ScriptUO](https://www.scriptuo.com/) community: Gaderian's tutorial [New Menu Code and how to adapt old scripts](https://www.scriptuo.com/index.php?topic=15596.0) and the scripts its members share at scriptuo.com.* --- # menu Window Color > Sets the background colour of the menu window. - **Syntax:** `menu Window Color {colour}` - **Needs a client:** no - **MENU logic:** 1.5, 1.6 - **Related:** menu Font BGColor, menu Window Transparent - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/menu/window/color/ `menu Window Color` sets the background colour of the menu window. A colour, see [Colours](https://ilpersi.github.io/EasyUOReforged/commands/menu/#colours): a name such as `red` or `btnface`, or a `$BBGGRR` number. ## Example ```euo menu Clear menu Window Size 200 40 menu Window Color $202020 menu Font Color white menu Font BGColor $202020 menu Text t 10 10 Light text on a dark window menu Show halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # menu Window Size > Sets the size of the menu window. - **Syntax:** `menu Window Size {width} {height}` - **Needs a client:** no - **MENU logic:** 1.5, 1.6 - **Related:** menu Show, menu Window Title - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/menu/window/size/ `menu Window Size` sets the size of the menu window's inside, in pixels: the area controls are placed in, without the title bar and borders. ## Example ```euo menu Clear menu Window Size 300 200 menu Text t 10 10 This window is 300 x 200 inside. menu Show halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # menu Window Title > Sets the title of the menu window. - **Syntax:** `menu Window Title {title}` - **Needs a client:** no - **MENU logic:** 1.5, 1.6 - **Related:** menu Window Size - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/menu/window/title/ `menu Window Title` sets the text in the menu window's title bar. ## Example ```euo menu Clear menu Window Title Loot settings menu Text t 10 10 Look at the title bar. menu Show halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # menu Window Transparent > Makes the whole menu window see-through, from 0 to 100 percent opaque. - **Syntax:** `menu Window Transparent {opacity}` - **Needs a client:** no - **MENU logic:** 1.5, 1.6 - **Related:** menu Window Color - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/menu/window/transparent/ `menu Window Transparent` makes the whole menu window see-through. `opacity` goes from `0`, almost invisible, to `100`, fully opaque. Even at `0` the window stays faintly visible, so it can still be found. > **Note** > > This did not work under Linux and Wine (1.1.2) in the original EasyUO. ## Example ```euo menu Clear menu Text t 10 10 Fading in... menu Window Transparent 0 menu Show for %i 0 100 { menu Window Transparent %i wait 1 } halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # Move > Walks the character towards a position with the arrow keys; no pathfinding. - **Syntax:** `move {x} {y} [tolerance] [timeout]` - **Needs a client:** yes - **Related:** event PathFind, Path, #CharPosX, #CharPosY - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/move/ `move` walks the character towards the world position `x`, `y` by pressing the movement keys, step by step in a straight line. It does **no pathfinding**: walls and obstacles stop it. [`event PathFind`](https://ilpersi.github.io/EasyUOReforged/commands/event/pathfind/) lets the client find a way around them, and [`path go`](https://ilpersi.github.io/EasyUOReforged/commands/path/go/) plans and walks longer routes. ## Parameters | Parameter | Meaning | |---|---| | `x`, `y` | World position, as in [`#CharPosX`](https://ilpersi.github.io/EasyUOReforged/variables/charposx/) and [`#CharPosY`](https://ilpersi.github.io/EasyUOReforged/variables/charposy/). | | `tolerance` | Optional. How many tiles away counts as arrived. Default: 2. | | `timeout` | Optional. Give up after this long. A time is a number of **ticks** of 50 ms (`20` is one second), or a whole number of **seconds** followed by `s` (`5s`). | Without a timeout, `move` keeps walking until it arrives, or until it notices it is stuck and stops trying. > **Caution** > > `move` uses the cursor keys, Home, End, Page Up and Page Down. If UOAssist or a similar tool has those keys > assigned to something else, the character won't walk. ## Example ```euo ; get within 2 tiles of 1234,1234, giving up after 3 seconds move 1234 1234 2 3s halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # MoveItem > Moves an item, or part of a stack, into a container and reports in #MoveRes whether it arrived. - **Syntax:** `moveitem {id} {destination} [amount] [x y]` - **Needs a client:** yes - **New in Reforged:** EasyUO 1.5 does not have it. - **Sets:** #MoveRes - **Related:** exevent Drag, exevent DropC, FindItem, #MoveRes, #BackpackID - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/moveitem/ `moveitem` does a whole drag and drop in one line: it picks the item up, drops it into the destination, waits for each step, tries again when that is safe, and says in [`#MoveRes`](https://ilpersi.github.io/EasyUOReforged/variables/moveres/) what happened. It replaces the `exevent drag`, `wait`, `exevent dropc`, check-and-retry subs that scripts write by hand. ```euo set %bag ABCDEFG ; the ID of a bag in your backpack finditem POF C_ , #BackpackID ; gold if #FindCnt > 0 { moveitem #FindID %bag if #MoveRes <> ok display ok The gold did not arrive: #MoveRes } halt ``` ## Parameters | Parameter | Meaning | |---|---| | `id` | The item. The client has to know it: on screen, or in a container it has seen. | | `destination` | The container to put it in (your [`#BackpackID`](https://ilpersi.github.io/EasyUOReforged/variables/backpackid/), a bag, a chest you opened, your bank box), or a pile of the same kind to add it to. A mobile works too (see `left` below). | | `amount` | Optional. How many to move from a stack, or `all`. **Default: the whole stack**, unlike [`exevent Drag`](https://ilpersi.github.io/EasyUOReforged/commands/exevent/drag/), whose default is 1. More than the stack holds moves the whole stack. | | `x`, `y` | Optional, only after an amount. Where to put it inside the container, from its top-left corner. With a place, it never joins a pile there. | ```euo set %bag ABCDEFG finditem ZLK C_ , #BackpackID ; logs if #FindCnt > 0 moveitem #FindID %bag 10 40 40 ; 10 logs, to their own pile at 40,40 halt ``` ## Results [`#MoveRes`](https://ilpersi.github.io/EasyUOReforged/variables/moveres/) is one of these words: | `#MoveRes` | What happened | Where the item is | |---|---|---| | `ok` | The item is in the destination: its ID is in it, or a pile of its kind there grew by the amount (it joined that pile, so its own ID is gone). | In the destination. | | `left` | It was picked up and dropped, but the client can't see it in the destination. Usually a container outside your backpack that you haven't opened. Also after a drop onto a mobile that took it, or when the server used it up. | Unknown to the client. | | `refused` | It was picked up, but the server refused every drop: a full or locked container, too far away, not a container. | Where the server put it back: where it was, or at your feet if that place was gone. | | `nolift` | The server never let it be picked up: too far away, not movable, locked down, not yours, or you moved items too fast every time. | Where it was. | | `noitem` | The client doesn't know the item. Nothing was sent. | - | | `nodest` | The client doesn't know the destination. Nothing was sent. | - | | `held` | Something hangs on the cursor. Nothing was sent. | - | | `error` | A parameter is missing or wrong: no destination, an amount that is 0 or not a number, `x` without `y`. Nothing was sent. | - | Nothing is ever left on the cursor: `moveitem` moves items through the server, the way [`exevent Drag`](https://ilpersi.github.io/EasyUOReforged/commands/exevent/drag/) does, and the cursor never holds them. ## How it checks `moveitem` watches the client's list of items. It never reads the journal, so it works the same whatever the client's language and whatever the shard's messages say. - **Picked up**: the item leaves the client's list. When the server refuses, it stays. - **Arrived**: its ID turns up in the destination, or a pile of its kind there grows by the amount. - **Refused**: its ID turns up again somewhere else. When the server doesn't let it pick the item up, it tries again, at least 0.65 seconds later, because servers refuse item moves that come too fast after each other. When the server refuses the drop, it starts over. It picks up 3 times at most. A move that works takes a fraction of a second. One that keeps failing gives up within about 4 seconds, and never takes more than about 8. It drops only after it has seen the item picked up. The server drops whatever you are holding, so a drop sent after a refused pick-up could move another item. ## What the client can see The client is told what goes into a container only when it may look inside: - **Your backpack, every bag in it, and your bank box**: always, even a bag you never opened. - **Any other container** (a chest on the floor, in a house, a pack animal): only after you have opened it, as long as you stay near it. Open it first, or `moveitem` gives `left` even when the move worked. ## Pause, Stop and stepping - **Pause** holds the move between two checks, and the time paused doesn't count. If the server took the item meanwhile, it is dropped on resuming. - **Stop** ends the move and leaves `#MoveRes` as it was. If the item has already been picked up, it is still dropped first, so it isn't left in the air. - **Step Into** and **Step Over** treat the whole move as one step. ## Notes - `ok` after joining a pile means that a pile of that kind in the destination grew by the amount. If something else of the same kind arrives there at the same moment, that counts too. - Moving an item to another place in the same container reads `ok` whether it moved or not. - On ModernUO, whatever you put into a **locked-down container** in a house is locked down with it. Taking it out again gives `nolift` until it is released (say *I wish to release this* and target it). - The ground and the paperdoll are not destinations: use [`exevent DropG`](https://ilpersi.github.io/EasyUOReforged/commands/exevent/dropg/) and [`exevent Equip`](https://ilpersi.github.io/EasyUOReforged/commands/exevent/equip/) for those. `moveitem` never puts anything on the ground itself; only the server does, when it bounces an item whose container is gone. - `moveitem` doesn't change [`#FindID`](https://ilpersi.github.io/EasyUOReforged/variables/findid/) or any other result of [`finditem`](https://ilpersi.github.io/EasyUOReforged/commands/finditem/). ## Reforged notes `moveitem` and `#MoveRes` are new in EasyUO Reforged. No existing command changes because of them, and a sub or label called `moveitem` keeps working. It's the only change for old scripts: a line starting with the word `moveitem` used to be ignored and is now this command. It was checked on a ModernUO shard with `client.exe` 7.0.118.46. Other servers that give the picked-up part of a stack a new ID can report `left` where the drop was refused. `uo.dll` has no equivalent. A program using it calls `Drag` and `DropC` and checks the items itself. --- # Msg > Types text into the client as if on the keyboard; $ presses Enter. - **Syntax:** `msg {text}` - **Needs a client:** yes - **Related:** event Macro, Key, event SysMessage - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/msg/ `msg` types text into the client, character by character, as if you typed it. `$` presses Enter, so a line ending in `$` is sent as speech, and `msg` also works for answering prompts and filling in text gumps. Several spaces in a row are typed as one. > **Tip** > > To say, emote, whisper or yell, [`event Macro`](https://ilpersi.github.io/EasyUOReforged/commands/event/macro/) is more reliable: it does not > depend on what has the keyboard focus inside the client. ## Example ```euo msg I wish to lock this down$ target 5s event Macro 22 0 halt ``` ## The spam limit The client itself limits how fast it sends speech, whatever the shard does. It sends a line at once only while its spam meter is below the *SpamLimit* option (30 by default). Every line it sends adds its length in characters to the meter, and the meter goes down again with time. Once the meter is over the limit, the client keeps the line back, sends it later, and shows **[Spam detected, speech queued for N seconds]**. The meter goes down more slowly than *SpamLimit* suggests: the client works it out in its game loop and drops fractions each time. Measured from the clients' code, it goes down by 20 to 26 characters a second on `client.exe` 7.0.117.33, and by about 13 on `client_beta.exe` 7.0.117.31. A script that says many lines one after another, or types many staff commands such as `[set` on a shard where it has them, runs into it. The lines still arrive, but late, so a [`findjournal`](https://ilpersi.github.io/EasyUOReforged/commands/findjournal/) waiting for the answer can time out, or take the answer to an earlier line for the answer to this one. Give the client about a second for every 12 characters before the next line. Lines sent with [`event Macro`](https://ilpersi.github.io/EasyUOReforged/commands/event/macro/) `1` to `4` count the same way. ```euo msg Selling arrows for 10 gold each$ wait 3s ; 31 characters: about 3 seconds before the next line msg Ask me for a price$ halt ``` ### A sub that keeps to the limit Copy `say_paced` to the end of your script, after its `halt`, and say every line through it. It keeps its own copy of the client's meter and waits only as long as the line needs, so a few short lines still go out at once. Write the spaces of the text as `_`. ```euo gosub say_paced Selling_arrows_for_10_gold_each gosub say_paced Ask_me_for_a_price gosub say_paced Open_until_sunset halt ; say_paced: says %1 (spaces written as _) as soon as the client's spam meter has room for it. ; %say_meter is the script's copy of the meter. It goes down by %say_rate characters a second: ; 12 is safe on the clients measured. It counts time with #SCnt2: don't set #SCnt2 in the script. sub say_paced if %say_rate = N/A set %say_rate 12 if %say_last = N/A { set %say_meter 0 set %say_last #SCnt2 } str replace %1 _ #spc set %say_text #StrRes str len %say_text set %say_len #StrRes repeat ; how far the meter has gone down since the last look (#SCnt2 counts tenths of a second) set %say_now #SCnt2 set %say_down %say_now - %say_last set %say_down %say_down * %say_rate set %say_down %say_down / 10 if %say_down > 0 { set %say_meter %say_meter - %say_down set %say_last %say_now } if %say_meter < 0 set %say_meter 0 ; wait while the meter is high: 10 leaves room for what you type yourself if %say_meter > 10 wait 2 until %say_meter <= 10 set %say_meter %say_meter + %say_len msg %say_text , $ return ``` - The client's own limit is 30, and the sub waits until its copy is down to 10. A line typed by you, or by another script on the same client, counts too, and the sub can't see it. - To pace staff commands too, say them through the sub: `gosub say_paced [set_Str_100`. - [`str replace`](https://ilpersi.github.io/EasyUOReforged/commands/str/#replace-reforged) is new in EasyUO Reforged. For EasyUO 1.5, drop the `str replace` line and its `set`, and set `%say_text` before the `gosub`: `set %say_text Hello , #spc , there`. *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # namespace clear > Deletes every ! variable of the current namespace. - **Syntax:** `namespace clear` - **Needs a client:** no - **Related:** namespace local, DeleteVar - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/namespace/clear/ `namespace clear` deletes every variable of the current namespace. It takes no name: to clear another namespace, switch to it first. ## Example ```euo namespace push namespace local temp namespace clear ; start temp empty set !x 1 display ok !x namespace pop halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # namespace copy > Copies variables matching a pattern between the current namespace and another. - **Syntax:** `namespace copy {pattern} {from|to} {local|global} {name}` - **Needs a client:** no - **Related:** namespace local, namespace global - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/namespace/copy/ `namespace copy` copies variables between the current namespace and another one. ## Parameters | Parameter | Meaning | |---|---| | `pattern` | Which variables, by name, without the `!`. `*` matches any number of characters and can appear once; `?` matches one character and can appear several times. `*` alone copies everything. | | `from` / `to` | `from` copies from the other namespace into the current one; `to` copies from the current one into the other. | | `local` / `global` | Whether the other namespace is local or global. | | `name` | The other namespace. It does not need to exist yet. | A pattern without `*` matches the names that **end** with it: `ret` matches `!ret` and `!secret`. Write `ret*` for names starting with `ret`. ## Example Return a value from a sub that works in its own namespace: ```euo gosub test display ok !result halt sub test namespace push namespace local test set !result done namespace pop namespace copy result from local test return ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # namespace global > Makes a global namespace, shared with every running script, the current one. - **Syntax:** `namespace global {name}` - **Needs a client:** no - **Related:** namespace local, #NSType - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/namespace/global/ `namespace global` makes the global namespace `name` current. A global namespace is shared by every script running in EasyUO Reforged, in any tab: what one script sets, the others read, as long as they switch to the same namespace first. `name`: A name made of letters, digits and `_`, not starting with a digit. Case does not matter. ## Example Two scripts, in two tabs: ```euo ; first script namespace global shared set !status mining pause halt ``` ```euo ; second script namespace global shared display ok The first script is !status halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # Namespace > Switches the set of ! variables a script uses: private to the script, or shared with other scripts. - **Syntax:** `namespace {local|global|clear|push|pop|copy} [parameters...]` - **Needs a client:** no - **Related:** #NSName, #NSType - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/namespace/ A namespace is a named set of `!` variables. At any moment one namespace is current, and every `!x` in the script means the variable `x` of that namespace. Switching namespaces gives a sub its own variables, or lets several scripts share some. - **Local** namespaces belong to one script tab: no other script sees them. - **Global** namespaces are shared by every script running in EasyUO Reforged, in any tab. A script starts in the local namespace `std`. [`#NSName`](https://ilpersi.github.io/EasyUOReforged/variables/nsname/) and [`#NSType`](https://ilpersi.github.io/EasyUOReforged/variables/nstype/) tell which namespace is current. | Command | What it does | |---|---| | [namespace local](https://ilpersi.github.io/EasyUOReforged/commands/namespace/local/) | Makes a local namespace current. | | [namespace global](https://ilpersi.github.io/EasyUOReforged/commands/namespace/global/) | Makes a global namespace current. | | [namespace push](https://ilpersi.github.io/EasyUOReforged/commands/namespace/push/) | Remembers the current namespace. | | [namespace pop](https://ilpersi.github.io/EasyUOReforged/commands/namespace/pop/) | Goes back to the namespace last remembered. | | [namespace copy](https://ilpersi.github.io/EasyUOReforged/commands/namespace/copy/) | Copies variables between the current namespace and another. | | [namespace clear](https://ilpersi.github.io/EasyUOReforged/commands/namespace/clear/) | Deletes every variable of the current namespace. | `%` variables are not affected by namespaces: they always belong to the script. ## Example A sub that works in its own namespace, so it cannot overwrite the caller's `!` variables: ```euo set !count 10 gosub work gosub work display ok !count ; still 10 halt sub work namespace push namespace local work set !count !count + 1 namespace pop return ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # namespace local > Makes a local namespace, private to this script, the current one. - **Syntax:** `namespace local {name}` - **Needs a client:** no - **Related:** namespace global, namespace push, #NSName - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/namespace/local/ `namespace local` makes the local namespace `name` current. From then on, `!x` means variable `x` of that namespace. Only this script can see a local namespace; switching away and back finds its variables as they were. `name`: A name made of letters, digits and `_`, not starting with a digit. Case does not matter. A script starts in the local namespace `std`, and starts there again each time it is run. ## Example ```euo namespace local ns1 set !test one namespace local ns2 set !test two namespace local ns1 display ok !test ; one halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # namespace pop > Goes back to the namespace last remembered with namespace push. - **Syntax:** `namespace pop` - **Needs a client:** no - **Related:** namespace push - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/namespace/pop/ `namespace pop` makes the namespace last remembered by [`namespace push`](https://ilpersi.github.io/EasyUOReforged/commands/namespace/push/) current again, and removes it from the stack. When nothing is remembered, it does nothing. ## Example ```euo namespace push namespace local temp set !x 1 namespace pop ; back to where we were display ok Back in #NSName halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # namespace push > Remembers the current namespace, to come back to it with namespace pop. - **Syntax:** `namespace push` - **Needs a client:** no - **Related:** namespace pop, namespace local - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/namespace/push/ `namespace push` remembers the current namespace (its name and whether it is local or global) on a stack. [`namespace pop`](https://ilpersi.github.io/EasyUOReforged/commands/namespace/pop/) goes back to it. Pushes can be nested: each `pop` returns to the namespace of the matching `push`. Use the pair around code that switches namespaces, so it leaves the caller where it was. ## Example ```euo gosub work display ok Back in #NSName halt sub work namespace push namespace local work set !x 1 ; uses its own !variables namespace pop return ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # NextCPos > Sets where the next container will open. - **Syntax:** `nextcpos {x} {y}` - **Needs a client:** yes - **Related:** ContPos, #NextCPosX, #NextCPosY - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/nextcpos/ `nextcpos` sets the position, in the client window, where the next container opens: the backpack, a bag, a chest, the bank box. It does the same as setting [`#NextCPosX`](https://ilpersi.github.io/EasyUOReforged/variables/nextcposx/) and [`#NextCPosY`](https://ilpersi.github.io/EasyUOReforged/variables/nextcposy/). > **Note** > > It only works when the client option *Offset interface windows rather than perfectly stacking them* > (interface options) is turned on. With the option off, every container opens at the top right of the game > window. Each time a container opens there, the client moves the position 16 pixels right and down, so containers opened one after the other cascade. Past the edge of the game window it starts again at 16. The paperdoll and the other gumps don't use it. [`#NextCPosX`](https://ilpersi.github.io/EasyUOReforged/variables/nextcposx/) has the details. ## Examples ```euo ; close the backpack and open it again at 100,100 event Macro 9 7 wait 20 nextcpos 100 100 event Macro 8 7 halt ``` The position only moves when the option is on, so opening a container shows whether it is: ```euo set %x #NextCPosX event Macro 9 7 wait 20 event Macro 8 7 wait 20 if #NextCPosX = %x display ok The option is off: containers open at the top right. else display ok The option is on. halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # OnHotKey > Runs a line or block only if a key is held down at that moment. - **Syntax:** `onhotkey {key} [ctrl] [alt] [shift]` - **Needs a client:** no - **Related:** Key, If - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/onhotkey/ `onhotkey` runs the next line or block only if the key is held down at the moment the line runs; otherwise it skips it, like an [`if`](https://ilpersi.github.io/EasyUOReforged/commands/if/). ## Parameters | Parameter | Meaning | |---|---| | `key` | The key: `A`–`Z`, `0`–`9`, `F1`–`F12`, `ESC`, `BACK`, `TAB`, `ENTER`, `PAUSE`, `CAPSLOCK`, `SPACE`, `PGUP`, `PGDN`, `END`, `HOME`, `LEFT`, `RIGHT`, `UP`, `DOWN`, `PRNSCR`, `INSERT`, `DELETE`, `NUMLOCK` and `SCROLLLOCK`. | | `ctrl`, `alt`, `shift` | Optional. These must be held as well. The match is exact: a modifier you did not list must **not** be held. | As with `if`, a block's `{` has to be the very next line, and a number at the end of the line controls that many lines instead. ## Details - The key is only checked when the line runs. To react to a key at any time, check it in a loop. - The check is for the whole computer, not for one client or window: typing in another program, or in another client, triggers it too. ## Example ```euo set #LPC 1000 loop: onhotkey F1 display ok You pressed F1. onhotkey F2 ctrl { display ok Script stopped with Ctrl+F2. halt } sleep 10 goto loop ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # path Avoid > Marks an area routes should go around if they can: a guarded zone, a spawn. - **Syntax:** `path avoid {x} {y} {x2} {y2} {cost} [facet]` - **Needs a client:** no - **New in Reforged:** EasyUO 1.5 does not have it. - **Sets:** #PathState - **Related:** path block, path clear - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/path/avoid/ `path avoid` makes every step that ends in the rectangle from `x`, `y` to `x2`, `y2` cost more for [`path find`](https://ilpersi.github.io/EasyUOReforged/commands/path/find/). `cost` is in hundredths of a step: with `500`, a step inside counts as six. The route goes around the area when the detour is shorter than that, and still crosses it when there is no other way, unlike [`path block`](https://ilpersi.github.io/EasyUOReforged/commands/path/block/). `facet` is a number as in [`#CursKind`](https://ilpersi.github.io/EasyUOReforged/variables/curskind/); the default is the facet you are on. Areas that overlap add up. They last until [`path clear`](https://ilpersi.github.io/EasyUOReforged/commands/path/clear/) or the script is started again. [`#PathState`](https://ilpersi.github.io/EasyUOReforged/variables/pathstate/) is `ok`, or `error: …` for bad arguments. ## Example ```euo path avoid 1380 1500 1420 1560 1000 ; keep away from a monster spawn path find 1434 1699 display ok #PathState - #PathCnt steps halt ``` --- # path Block > Marks a place or a rectangle that routes must never use. - **Syntax:** `path block {x} {y} [{x2} {y2}] [facet]` - **Needs a client:** no - **New in Reforged:** EasyUO 1.5 does not have it. - **Sets:** #PathState - **Related:** path unblock, path avoid, path clear - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/path/block/ `path block` marks the place `x`, `y`, or the rectangle from `x`, `y` to `x2`, `y2`, as impassable for [`path find`](https://ilpersi.github.io/EasyUOReforged/commands/path/find/), at every height. Use it for what the map files don't know about: a player house, a locked door, a spot where you got stuck. `facet` is a number as in [`#CursKind`](https://ilpersi.github.io/EasyUOReforged/variables/curskind/); the default is the facet you are on. A diagonal step that would brush past a blocked place is not taken either, as with a wall. Blocks last until [`path unblock`](https://ilpersi.github.io/EasyUOReforged/commands/path/unblock/), [`path clear`](https://ilpersi.github.io/EasyUOReforged/commands/path/clear/) or the script is started again. [`#PathState`](https://ilpersi.github.io/EasyUOReforged/variables/pathstate/) is `ok`, or `error: …` for bad arguments. ## Example ```euo path block 1450 1680 1460 1690 ; a house on the way path find 1500 1690 display ok #PathState - #PathCnt steps halt ``` --- # path Can > Says whether a character can stand at a place, and at what height. - **Syntax:** `path can {x} {y} [z]` - **Needs a client:** yes - **New in Reforged:** EasyUO 1.5 does not have it. - **Sets:** #PathState, #PathX, #PathY, #PathZ - **Related:** path find, Tile - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/path/can/ `path can` checks whether a character can stand at `x`, `y` on the facet you are on: something to stand on, enough head room above it, and not a [`path block`](https://ilpersi.github.io/EasyUOReforged/commands/path/block/)ed place. Near the character it also looks at what your client holds there: items, creatures and house pieces, as [`path find`](https://ilpersi.github.io/EasyUOReforged/commands/path/find/) does. [`#PathState`](https://ilpersi.github.io/EasyUOReforged/variables/pathstate/) is `ok` or `blocked` (or `noclient` / `nomap`, as for [`path find`](https://ilpersi.github.io/EasyUOReforged/commands/path/find/)). [`#PathZ`](https://ilpersi.github.io/EasyUOReforged/variables/pathz/) is the height the character would stand at: of the floors there, the one nearest to `z`. Without `z`, the nearest to your character's own height (or to the height given to [`path from`](https://ilpersi.github.io/EasyUOReforged/commands/path/from/)). It doesn't check whether the place can be reached. ## Example ```euo path can 1434 1699 if #PathState = ok display ok You can stand there, at height #PathZ halt ``` --- # path Check > Asks the client itself whether the character can take a step, and at what height it lands. - **Syntax:** ``` path check {n} path check {x} {y} [z] [dir] ``` - **Needs a client:** yes - **New in Reforged:** EasyUO 1.5 does not have it. - **Sets:** #PathState, #PathX, #PathY, #PathZ, #PathDir - **Related:** path can, path find, path go, event PathFind - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/path/check/ `path check` asks your client whether the character can take a step, with the same check the client runs before every step it sends, and that its own pathfinder ([`event PathFind`](https://ilpersi.github.io/EasyUOReforged/commands/event/pathfind/)) uses. The client knows everything it holds: house walls and floors, custom houses, items players placed, as well as the map. [`path can`](https://ilpersi.github.io/EasyUOReforged/commands/path/can/) answers from the map files plus what EasyUO Reforged can read of those. - `path check {n}` checks step `n` of the last route ([`path find`](https://ilpersi.github.io/EasyUOReforged/commands/path/find/) or [`path go`](https://ilpersi.github.io/EasyUOReforged/commands/path/go/)), from the step before it, at the height the route has there. A diagonal step also needs both straight steps beside it free, so those are checked too. - `path check {x} {y} [z] [dir]` checks the step onto `x`, `y` in direction `dir` (0 north to 7 north-west, as [`#CharDir`](https://ilpersi.github.io/EasyUOReforged/variables/chardir/); default 0) from the tile behind it, at height `z` (default: your character's [`#CharPosZ`](https://ilpersi.github.io/EasyUOReforged/variables/charposz/)). The tile behind it is the one the step comes from: south of `x`, `y` for direction 0. ```euo path check #CharPosX #CharPosY event SysMessage My own tile: #PathState at #PathZ path find 2708 490 for %i 1 #PathCnt { path check %i if #PathState <> ok { event SysMessage Step %i: #PathState at #PathX #PathY break } } halt ``` ## Results | Variable | Value | |---|---| | [`#PathState`](https://ilpersi.github.io/EasyUOReforged/variables/pathstate/) | `ok`: the client allows the step. `blocked`: it doesn't (a shut door is `blocked` too). `noclient`, `nocheck` (EasyUO Reforged doesn't know this client's check, or the client didn't answer), or `error: …`. | | [`#PathX`](https://ilpersi.github.io/EasyUOReforged/variables/pathx/), [`#PathY`](https://ilpersi.github.io/EasyUOReforged/variables/pathy/) | The tile checked. For a diagonal step the client refused, the tile that was in the way, which can be one of the two beside it. | | [`#PathZ`](https://ilpersi.github.io/EasyUOReforged/variables/pathz/) | The height the character lands at; 0 when the step is refused. | | [`#PathDir`](https://ilpersi.github.io/EasyUOReforged/variables/pathdir/) | The direction of the step. | [`#PathCnt`](https://ilpersi.github.io/EasyUOReforged/variables/pathcnt/) and the route are left alone. ## Notes - **Only what the client has loaded.** A tile the client hasn't loaded has nothing to stand on, so it reads as `blocked`. Both clients keep about 18 tiles round the character loaded, often more. - **A step, not a place.** The answer depends on the height you step from and the direction: a staircase can be climbed from one side only, a high floor reached only by its stairs. To ask whether a character could stand on a tile at all, use [`path can`](https://ilpersi.github.io/EasyUOReforged/commands/path/can/). - **Creatures** block only when your character's stamina isn't full, as when walking. Your own character never does. - The walker asks the same of the client by itself, about the next 12 tiles of its route (`check` in [`path set`](https://ilpersi.github.io/EasyUOReforged/commands/path/set/)). ## Reforged notes New in EasyUO Reforged. It calls the same function in the client as the `uo.dll` method [`BlockInfo`](https://ilpersi.github.io/EasyUOReforged/dll/blockinfo/), one step at a time instead of an area at height `z` stepping north. --- # path Clear > Forgets the path blocks, avoid areas, links and refused places, or one kind of them. - **Syntax:** `path clear [blocks|avoid|links|learned|all]` - **Needs a client:** no - **New in Reforged:** EasyUO 1.5 does not have it. - **Sets:** #PathState - **Related:** path block, path avoid, path link, path go - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/path/clear/ `path clear` removes every [`path block`](https://ilpersi.github.io/EasyUOReforged/commands/path/block/) (`blocks`), every [`path avoid`](https://ilpersi.github.io/EasyUOReforged/commands/path/avoid/) area (`avoid`) or every [`path link`](https://ilpersi.github.io/EasyUOReforged/commands/path/link/) (`links`), on every facet. `learned` forgets the places where a walk had a step refused, which the walker otherwise avoids for a while (see [`path go`](https://ilpersi.github.io/EasyUOReforged/commands/path/go/#how-it-walks)). Without a word, or with `all`, it removes all four. The options of [`path set`](https://ilpersi.github.io/EasyUOReforged/commands/path/set/) are not touched. Starting the script again clears them too. [`#PathState`](https://ilpersi.github.io/EasyUOReforged/variables/pathstate/) is `ok`, or `error: …` for an unknown word. ## Example ```euo path link 1500 1600 0 1700 1600 0 path clear links ; forget the link again halt ``` --- # path Find > Plans a walking route from your character to a place on the same facet. - **Syntax:** `path find {x} {y} [z]` - **Needs a client:** yes - **New in Reforged:** EasyUO 1.5 does not have it. - **Sets:** #PathState, #PathCnt, #PathX, #PathY, #PathZ, #PathDir - **Related:** path get, path walk, path go, path set, path from, event PathFind - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/path/find/ `path find` plans a route from your character to `x`, `y` on the facet you are on, and keeps it for [`path get`](https://ilpersi.github.io/EasyUOReforged/commands/path/get/) and [`path walk`](https://ilpersi.github.io/EasyUOReforged/commands/path/walk/). The character does not move. ## Parameters | Parameter | Meaning | |---|---| | `x`, `y` | World position, as in [`#CharPosX`](https://ilpersi.github.io/EasyUOReforged/variables/charposx/) and [`#CharPosY`](https://ilpersi.github.io/EasyUOReforged/variables/charposy/). | | `z` | Optional height. Without it, any height at `x`, `y` will do. With it, the route ends within 5 of it (see `accuracyz` in [`path set`](https://ilpersi.github.io/EasyUOReforged/commands/path/set/)): use it to pick a floor of a building or a dungeon level. | ## Results - **[`#PathState`](https://ilpersi.github.io/EasyUOReforged/variables/pathstate/)** is `ok` when a route was found. Otherwise: - `nopath`: there is no way there; - `budget` or `timeout`: the search gave up before finding one; - `stopped`: you pressed Stop; - `noclient`: no client is attached; - `nomap`: the client's folder lacks this facet's map files; - `error: …`: the arguments are wrong. - **[`#PathCnt`](https://ilpersi.github.io/EasyUOReforged/variables/pathcnt/)** is the number of steps, 0 when there is no route or you are already there. - **[`#PathX`](https://ilpersi.github.io/EasyUOReforged/variables/pathx/), [`#PathY`](https://ilpersi.github.io/EasyUOReforged/variables/pathy/), [`#PathZ`](https://ilpersi.github.io/EasyUOReforged/variables/pathz/)** are where the route ends, and [`#PathDir`](https://ilpersi.github.io/EasyUOReforged/variables/pathdir/) is the direction of its last step. ## Details - The route starts where your character stands: [`#CharPosX`](https://ilpersi.github.io/EasyUOReforged/variables/charposx/), [`#CharPosY`](https://ilpersi.github.io/EasyUOReforged/variables/charposy/), [`#CharPosZ`](https://ilpersi.github.io/EasyUOReforged/variables/charposz/), on facet [`#CursKind`](https://ilpersi.github.io/EasyUOReforged/variables/curskind/). The way it faces doesn't matter. [`path from`](https://ilpersi.github.io/EasyUOReforged/commands/path/from/) starts it elsewhere. - **Arriving.** The route ends exactly at `x`, `y`, unless `accuracy` is set ([`path set`](https://ilpersi.github.io/EasyUOReforged/commands/path/set/)). If nothing can stand there (a tree, a rock, a chest), the route ends next to it. - **The shortest walk.** A diagonal step takes as long as a straight one, so the route is the one with the fewest steps, and it avoids needless changes of direction (each costs a little, see `turncost` in [`path set`](https://ilpersi.github.io/EasyUOReforged/commands/path/set/)). - **The script waits** while the route is planned: up to 5 seconds, a fraction of a second for most routes. Stop interrupts it. A route that can't exist (an island, a closed room) answers `nopath` quickly as long as the goal is near, because the search only looks within 100 tiles around start and goal (`margin`). - **Blocks, avoid areas and links** set with [`path block`](https://ilpersi.github.io/EasyUOReforged/commands/path/block/), [`path avoid`](https://ilpersi.github.io/EasyUOReforged/commands/path/avoid/) and [`path link`](https://ilpersi.github.io/EasyUOReforged/commands/path/link/) are used. - The map is read from the client's files. On top of it, the route sees what your client holds around the character: items on the ground, doors, creatures and, on `client_beta.exe` 7.0.117.31, the pieces of player houses. Farther away, those are not on it. See [What the route knows about](https://ilpersi.github.io/EasyUOReforged/commands/path/#what-the-route-knows-about). - Places where a walk had a step refused are avoided for a while (`blocktime` in [`path set`](https://ilpersi.github.io/EasyUOReforged/commands/path/set/)). - A walk [`path step`](https://ilpersi.github.io/EasyUOReforged/commands/path/step/) is moving on ends. ## Example Plan a route to the Britain bank and walk it: ```euo path find 1434 1699 if #PathState <> ok halt path walk halt ``` [`path walk`](https://ilpersi.github.io/EasyUOReforged/commands/path/walk/) does all the work. By hand, a script can walk the route a stretch at a time with the client's own pathfinder: ```euo path find 1434 1699 if #PathState <> ok halt set %i 0 while %i < #PathCnt { set %i %i + 10 if %i > #PathCnt set %i #PathCnt path get %i event PathFind #PathX #PathY #PathZ set %until #SCnt + 10 while #CharPosX <> #PathX || #CharPosY <> #PathY { if #SCnt > %until halt wait 5 } } halt ``` --- # path From > Plans routes from another place instead of your character's position. - **Syntax:** `path from [{x} {y} {z} [facet]]` - **Needs a client:** no - **New in Reforged:** EasyUO 1.5 does not have it. - **Sets:** #PathState - **Related:** path find, path can - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/path/from/ `path from` makes [`path find`](https://ilpersi.github.io/EasyUOReforged/commands/path/find/) and [`path can`](https://ilpersi.github.io/EasyUOReforged/commands/path/can/) start from `x`, `y`, `z` on `facet` instead of from your character, until the next `path from`. Without arguments, they start from your character again. `facet` is a number as in [`#CursKind`](https://ilpersi.github.io/EasyUOReforged/variables/curskind/); the default is the facet you are on. Use it to plan a route before going there, for example to check that a list of places can all be reached. A client must still be attached: the map is read from its files. ## Example ```euo path from 1434 1699 0 ; the Britain bank path find 1823 2821 ; to Trinsic display ok Britain to Trinsic: #PathCnt steps path from halt ``` --- # path Get > Loads one step of the last planned route into #PathX, #PathY, #PathZ and #PathDir. - **Syntax:** `path get {n}` - **Needs a client:** no - **New in Reforged:** EasyUO 1.5 does not have it. - **Sets:** #PathState, #PathX, #PathY, #PathZ, #PathDir - **Related:** path find, #PathCnt - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/path/get/ `path get` loads step `n` (from `1` to [`#PathCnt`](https://ilpersi.github.io/EasyUOReforged/variables/pathcnt/)) of the route the last [`path find`](https://ilpersi.github.io/EasyUOReforged/commands/path/find/) planned: [`#PathX`](https://ilpersi.github.io/EasyUOReforged/variables/pathx/), [`#PathY`](https://ilpersi.github.io/EasyUOReforged/variables/pathy/) and [`#PathZ`](https://ilpersi.github.io/EasyUOReforged/variables/pathz/) are where the step ends, [`#PathDir`](https://ilpersi.github.io/EasyUOReforged/variables/pathdir/) the direction it goes in. A number out of range sets all four to `0` (`#PathDir` to `-1`) and [`#PathState`](https://ilpersi.github.io/EasyUOReforged/variables/pathstate/) to `error: no step …`. ## Example ```euo path find 1600 1690 for %i 1 #PathCnt { path get %i if #PathZ > 10 event SysMessage Step %i goes up to #PathZ } halt ``` --- # path Go > Plans a route to a place and walks it, waiting until the character gets there. - **Syntax:** `path go {x} {y} [z] [accuracy] [timeout]` - **Needs a client:** yes - **New in Reforged:** EasyUO 1.5 does not have it. - **Sets:** #PathState, #PathCnt, #PathX, #PathY, #PathZ, #PathDir - **Related:** path walk, path step, path stop, path find, Move - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/path/go/ `path go` plans a route from your character to `x`, `y` and walks it. Like [`Move`](https://ilpersi.github.io/EasyUOReforged/commands/move/), the script waits until the walk is over; [`#PathState`](https://ilpersi.github.io/EasyUOReforged/variables/pathstate/) then says how it went. ```euo path go 1434 1699 if #PathState <> arrived display ok Did not get there: #PathState halt ``` ## Parameters | Parameter | Meaning | |---|---| | `x`, `y` | Where to go, as in [`#CharPosX`](https://ilpersi.github.io/EasyUOReforged/variables/charposx/) and [`#CharPosY`](https://ilpersi.github.io/EasyUOReforged/variables/charposy/). | | `z` | Optional height, as for [`path find`](https://ilpersi.github.io/EasyUOReforged/commands/path/find/): to pick a floor of a building or a dungeon level. | | `accuracy` | Arrive within this many tiles. Without it, the `accuracy` of [`path set`](https://ilpersi.github.io/EasyUOReforged/commands/path/set/) (0: exactly there). To give it, give `z` too. | | `timeout` | Give up after this long: a number of ticks of 50 ms, or a whole number of seconds followed by `s`, as for [`Move`](https://ilpersi.github.io/EasyUOReforged/commands/move/). Without it, there is no time limit. | ## Results [`#PathState`](https://ilpersi.github.io/EasyUOReforged/variables/pathstate/) is one of: | Value | Meaning | |---|---| | `arrived` | The character is there, within `accuracy`. When nothing can stand on the goal (a tree, a chest), next to it. | | `blocked` | The way was cut on the way there, and no other route was found. | | `failed` | The character couldn't get on: it stood still for 15 seconds, got no closer to the goal for 30, or every step from where it stands was refused. | | `link` | The route uses a [`path link`](https://ilpersi.github.io/EasyUOReforged/commands/path/link/) the walker can't use by itself, a gate or a ladder: the character stands on its start. Use it, then [`path walk`](https://ilpersi.github.io/EasyUOReforged/commands/path/walk/) goes on. | | `timeout` | The `timeout` ran out (or the first route took longer to plan than the `timeout` of [`path set`](https://ilpersi.github.io/EasyUOReforged/commands/path/set/)). | | `stopped` | You pressed Stop. | | `nopath`, `budget` | No route was found at the start, as for [`path find`](https://ilpersi.github.io/EasyUOReforged/commands/path/find/). | | `noclient`, `nomap`, `error: …` | As for [`path find`](https://ilpersi.github.io/EasyUOReforged/commands/path/find/). | [`#PathCnt`](https://ilpersi.github.io/EasyUOReforged/variables/pathcnt/), [`#PathX`](https://ilpersi.github.io/EasyUOReforged/variables/pathx/) … [`#PathDir`](https://ilpersi.github.io/EasyUOReforged/variables/pathdir/) show the route that was being walked, as after [`path find`](https://ilpersi.github.io/EasyUOReforged/commands/path/find/). The walker plans again on the way when it has to, so it can differ from the first one. [`path get`](https://ilpersi.github.io/EasyUOReforged/commands/path/get/) reads its steps. ## How it walks - **One step at a time.** By default the walker walks the route step by step, with the walk macro ([`event Macro 5`](https://ilpersi.github.io/EasyUOReforged/commands/event/macro/)). A step the character doesn't take is sent again, and it counts as refused when the character still hasn't moved after one and a half seconds. Steps go out no faster than one every 0.2 seconds on foot and 0.1 seconds on a mount, about as fast as the client moves a running character. - **Walking or running.** The client decides: it runs when its Always Run option is on, and also when your mouse pointer rests away from the character. See [Running](https://ilpersi.github.io/EasyUOReforged/commands/path/#running) for how a script can make it run. - **With the client's own pathfinder**, after [`path set mode client`](https://ilpersi.github.io/EasyUOReforged/commands/path/set/). The walker sends the client's pathfinder, the one [`event PathFind`](https://ilpersi.github.io/EasyUOReforged/commands/event/pathfind/) uses, to points along the route, each up to 18 tiles from the character (`lead` in [`path set`](https://ilpersi.github.io/EasyUOReforged/commands/path/set/)). Before sending a point, the walker runs the client's search on its own map, and only sends a point the client should accept. It is a little faster on open ground, but on `client_beta.exe` the client's walk often ends early or takes its own way, so it isn't the default. - The client's own walk ends by itself after a handful of steps, so the walker sends a fresh point every 3 steps, and before the character gets to the last one. The character doesn't stop for them. - When the client's walk ends a few tiles before a point anyway, the walker takes those steps itself. - When the client refuses a point anyway ("Can't get there"), the next one is nearer. After a few refusals, it walks the next stretch one step at a time. - When the client takes a point but the character doesn't start moving, the walker walks the next stretch one step at a time straight away. - On a client whose pathfinder EasyUO Reforged doesn't know, it walks one step at a time anyway. - **What it sees.** Besides the map files, it reads what your client holds around the character about once a second: items on the ground, doors, creatures and the walls and floors of player houses (on `client.exe` 7.0.117.1, `client_beta.exe` 7.0.117.31, and other builds where EasyUO Reforged finds them). When something new stands on the next steps of the route, it plans again from where the character is. It also plans again when the character ends up off the route. - **It asks the client.** About once a second, and whenever the route changes, the walker asks the client itself whether the next 12 tiles of the route can be walked (`check` in [`path set`](https://ilpersi.github.io/EasyUOReforged/commands/path/set/)), with the check the client runs before every step ([`path check`](https://ilpersi.github.io/EasyUOReforged/commands/path/check/)). A tile the client refuses is avoided like a refused step, before the character gets there, and the walker asks about the tiles round it too, so a house it couldn't see is learned in one go. Doors it opens and creatures are left to it. Where the client lands a step at another height (stairs it can't see), the walker takes the client's. - **Refused steps.** A place where a step was refused is avoided for a minute (`blocktime` in [`path set`](https://ilpersi.github.io/EasyUOReforged/commands/path/set/)), and the walker plans around it. Planning around such a place first looks for a short way back onto the route; only if there is none does it plan the whole way again. [`path clear learned`](https://ilpersi.github.io/EasyUOReforged/commands/path/clear/) forgets these places. - **Doors.** A door costs a little more than open ground (`doorcost`), so a route goes through one only when that saves steps. In front of a closed door, the walker turns to it and uses the Open Door macro ([`event Macro 12`](https://ilpersi.github.io/EasyUOReforged/commands/event/macro/)) before it steps through. The doors of player houses count as walls: a route doesn't go through somebody's house. [`path set doors all`](https://ilpersi.github.io/EasyUOReforged/commands/path/set/) opens them too, and `doors off` treats every door as a wall. - **Put back.** When the server refuses a step the client had already shown, the client puts the character back. A tile the character is put back off twice is avoided like a refused step. - **Giving up.** A walk that has got no closer to the goal for 30 seconds ends with `failed`. - **Creatures** are in the way, except your own character. [`path set mobiles ignore`](https://ilpersi.github.io/EasyUOReforged/commands/path/set/) walks as if they weren't there; with full stamina a character can push through them. - **Links.** On a teleporter added with [`path link`](https://ilpersi.github.io/EasyUOReforged/commands/path/link/), the walker steps on and waits up to 3 seconds for the jump. A link that needs using, such as a gate or a ladder, ends the walk with `link`. - **Stop and Pause** work during the walk, as for [`Move`](https://ilpersi.github.io/EasyUOReforged/commands/move/). Time spent paused doesn't count as standing still. ## Notes - The options, blocks, avoid areas and links of the other `path` commands apply to the walk. - `path go` remembers its goal: after `link`, `timeout` or `stopped`, [`path walk`](https://ilpersi.github.io/EasyUOReforged/commands/path/walk/) goes on toward it. - To do other things while walking, such as healing or reading the journal, use [`path step`](https://ilpersi.github.io/EasyUOReforged/commands/path/step/) in a loop instead. ## Reforged notes New in EasyUO Reforged. Walking only happens on the facet you are on: a link to another facet is not followed. See [Known limitations](https://ilpersi.github.io/EasyUOReforged/reforged/known-limitations/) for what has been checked on a live client. --- # Path > Plans a walking route across the map, around walls, water and buildings, with stairs and bridges, and walks it. - **Syntax:** `path {go|walk|step|stop|find|get|can|check|from|set|block|unblock|avoid|link|clear} [arguments...]` - **Needs a client:** yes - **New in Reforged:** EasyUO 1.5 does not have it. - **Sets:** #PathState, #PathCnt, #PathX, #PathY, #PathZ, #PathDir - **Related:** path go, path find, event PathFind, Move, Tile - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/path/ `path` plans a route from your character to a place anywhere on the facet, around walls, rivers and buildings, over bridges, up and down stairs, and walks it. It reads the map from the client's own files, so it knows the whole facet, not only what is on screen. ```euo path go 1823 2821 ; from here to Trinsic, on foot if #PathState <> arrived display ok Did not get there: #PathState halt ``` To look at the route first, plan it with [`path find`](https://ilpersi.github.io/EasyUOReforged/commands/path/find/), then walk it: ```euo path find 1823 2821 if #PathState <> ok { display ok No route: #PathState halt } for %i 1 #PathCnt { path get %i ; #PathX #PathY #PathZ is where step %i ends, #PathDir its direction } path walk halt ``` ## Sub-commands | Command | What it does | |---|---| | [`path go`](https://ilpersi.github.io/EasyUOReforged/commands/path/go/) | Plans a route to a place and walks it. | | [`path walk`](https://ilpersi.github.io/EasyUOReforged/commands/path/walk/) | Walks the route `path find` planned. | | [`path step`](https://ilpersi.github.io/EasyUOReforged/commands/path/step/) | Moves a walk on and returns at once, so the script can do other things meanwhile. | | [`path stop`](https://ilpersi.github.io/EasyUOReforged/commands/path/stop/) | Ends the walk `path step` is moving on. | | [`path find`](https://ilpersi.github.io/EasyUOReforged/commands/path/find/) | Plans a route from your character (or from `path from`) to a place. | | [`path get`](https://ilpersi.github.io/EasyUOReforged/commands/path/get/) | Loads one step of the route into `#PathX`, `#PathY`, `#PathZ`, `#PathDir`. | | [`path can`](https://ilpersi.github.io/EasyUOReforged/commands/path/can/) | Says whether a character can stand at a place, and at what height. | | [`path check`](https://ilpersi.github.io/EasyUOReforged/commands/path/check/) | Asks the client itself whether the character can take a step of the route, or onto a place. | | [`path from`](https://ilpersi.github.io/EasyUOReforged/commands/path/from/) | Plans from another place instead of your character. | | [`path set`](https://ilpersi.github.io/EasyUOReforged/commands/path/set/) | Changes an option: accuracy, search limits, how to walk, doors, creatures, … | | [`path block`](https://ilpersi.github.io/EasyUOReforged/commands/path/block/) | Marks places the route must never use. | | [`path unblock`](https://ilpersi.github.io/EasyUOReforged/commands/path/unblock/) | Removes blocked places. | | [`path avoid`](https://ilpersi.github.io/EasyUOReforged/commands/path/avoid/) | Marks areas the route should go around if it can. | | [`path link`](https://ilpersi.github.io/EasyUOReforged/commands/path/link/) | Adds a teleporter, gate or ladder the route may use. | | [`path clear`](https://ilpersi.github.io/EasyUOReforged/commands/path/clear/) | Forgets blocks, avoid areas, links and the places where a step was refused. | A `path` line never stops the script. [`#PathState`](https://ilpersi.github.io/EasyUOReforged/variables/pathstate/) says how the last `path` command went: `ok` or `arrived`, or what went wrong. ## What the route knows about The route is planned from the map designers' world: terrain and water, town buildings and walls, trees, bridges, stairs and dungeons. The map files don't have the dynamic world: **player houses, items players placed, open or closed doors, and creatures**. Your client only learns about those when they come within about 18 tiles. So `path` adds what your client holds around the character: items on the ground, doors, creatures, and the walls and floors of player houses (on `client.exe` 7.0.117.1 and `client_beta.exe` 7.0.117.31, and on other builds where EasyUO Reforged finds them). While walking, it also asks the client itself about the next 12 tiles of the route ([`path check`](https://ilpersi.github.io/EasyUOReforged/commands/path/check/)), which covers whatever is left: custom houses, or a build where it can't read house pieces. A route is right everywhere about the map, and right near the character about the rest. Farther away it can lead into a house or a crowd the client hasn't shown yet; the walker sees those as it gets near, and goes round them (see [How it walks](https://ilpersi.github.io/EasyUOReforged/commands/path/go/#how-it-walks)). Use [`path block`](https://ilpersi.github.io/EasyUOReforged/commands/path/block/) for places you know about. The options, blocks, avoid areas, links and the places where a step was refused last until the script is started again. ## Running The walker walks with the client's own walk macro, and the client decides whether each step is a walk or a run. It runs a step when either of these holds: - **Always Run** is on in the client's options. - **The mouse pointer rests away from the character**, more than about 213 pixels to the side or 160 pixels up or down from the middle of the game view ([`#CliLeft`](https://ilpersi.github.io/EasyUOReforged/variables/clileft/), [`#CliTop`](https://ilpersi.github.io/EasyUOReforged/variables/clitop/), [`#CliXRes`](https://ilpersi.github.io/EasyUOReforged/variables/clixres/), [`#CliYRes`](https://ilpersi.github.io/EasyUOReforged/variables/cliyres/)). It is the real pointer that counts: the client reads it itself many times a second. So if you leave the mouse beside the game window while a walk runs, the character runs; with the mouse over the character, it walks. Neither holds at very low stamina: the client walks then. `path` doesn't change either setting: running is your choice. A mounted character's steps go out twice as fast as on foot, so a run on a mount gets its full speed ([`#MountID`](https://ilpersi.github.io/EasyUOReforged/variables/mountid/) says whether you ride). A script can switch Always Run on for a walk. [`event Macro 32`](https://ilpersi.github.io/EasyUOReforged/commands/event/macro/) is the client's Always Run toggle, and the client answers it in the journal with "Always Run is now on." or "Always Run is now off." (the same English text in every client language). This switches it on, walks, and puts it back as it was: ```euo gosub ToggleAlwaysRun set %switched #false if %run = on set %switched #true ; it was off: switch it back off after the walk if %run = off gosub ToggleAlwaysRun ; it was on already: switch it back on, and leave it on path go 2505 552 if %switched = #true { gosub ToggleAlwaysRun if %run = on gosub ToggleAlwaysRun ; it had been switched off meanwhile: off again } halt ; Toggles Always Run. %run becomes on or off, as the client's answer in the journal says, or none ; when no answer came within a second. sub ToggleAlwaysRun set %next #JIndex + 1 set %run none set %tries 0 event macro 32 0 repeat wait 1 set %tries %tries + 1 while %next <= #JIndex { scanjournal %next if Always_Run_is_now_on in #Journal set %run on if Always_Run_is_now_off in #Journal set %run off set %next %next + 1 } until %run <> none || %tries >= 20 return ``` A script can also park the mouse pointer away from the character, at a corner of the game view. `click` with `n` doesn't press anything, and `mc` moves the real pointer there: ```euo set %x #CliLeft + 20 set %y #CliTop + 20 click %x %y n mc ; the pointer moves to the game view's top-left corner, without a click path go 2505 552 ; leave the mouse there until the walk ends halt ``` `click … dmc` can't do this: it leaves the real pointer where it is, and the client goes by the real pointer. Moving the mouse back near the character during the walk makes the next steps walk. ## Reforged notes `path` and the `#Path…` variables are new in EasyUO Reforged. [`event PathFind`](https://ilpersi.github.io/EasyUOReforged/commands/event/pathfind/), [`Move`](https://ilpersi.github.io/EasyUOReforged/commands/move/) and [`Tile`](https://ilpersi.github.io/EasyUOReforged/commands/tile/) are unchanged; the walker uses `event PathFind` and the walk and Open Door macros itself. The step rules (how high a character can climb, how much head room it needs, how stairs and bridges work) are those of the ClassicUO client. Programs that drive the client through [`uo.dll`](https://ilpersi.github.io/EasyUOReforged/dll/) get the planning too: [`GetPath`](https://ilpersi.github.io/EasyUOReforged/dll/getpath/) returns a whole route in one call, and `PathCan`, `PathCheck`, `PathSet`, `PathBlock`, `PathUnblock`, `PathAvoid`, `PathLink` and `PathClear` match the sub-commands. There is no walker in `uo.dll`. The first route on a facet loads that facet's map files, which takes a moment. Current clients ship Felucca and Trammel as `.uop` files, which use about 90 MB of memory each once loaded. A long route takes under a second: Britain to Minoc, about 1,500 steps, took 0.7 s on the developer's PC. --- # path Link > Adds a teleporter, gate or ladder that routes may use: a one-way jump between two places. - **Syntax:** `path link {x} {y} {z} {x2} {y2} {z2} [cost] [facet]` - **Needs a client:** no - **New in Reforged:** EasyUO 1.5 does not have it. - **Sets:** #PathState - **Related:** path find, path clear, #PathDir - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/path/link/ `path link` tells [`path find`](https://ilpersi.github.io/EasyUOReforged/commands/path/find/) that a character standing at `x`, `y`, `z` can get to `x2`, `y2`, `z2` in one go: a teleporter tile, a gate, a ladder. The map files don't know about these; they depend on the shard. - It is **one way**. Add a second link for the way back. - It is used by a route that reaches `x`, `y` within 5 of the height `z`. - `cost` is in hundredths of a step; the default `100` makes the jump count as one step. Give a gate you must double-click, or a slow ladder, a higher cost. - In the route, the step through a link has [`#PathDir`](https://ilpersi.github.io/EasyUOReforged/variables/pathdir/) `8`. Your script does what the link needs there: wait for the teleporter, use the gate. - Both ends are on the same facet: `facet`, a number as in [`#CursKind`](https://ilpersi.github.io/EasyUOReforged/variables/curskind/), by default the facet you are on. Links last until [`path clear`](https://ilpersi.github.io/EasyUOReforged/commands/path/clear/) or the script is started again. [`#PathState`](https://ilpersi.github.io/EasyUOReforged/variables/pathstate/) is `ok`, or `error: …` for bad arguments. ## Example ```euo path link 1500 1600 0 1700 1600 0 ; a teleporter, and where it leads path find 1720 1600 for %i 1 #PathCnt { path get %i if #PathDir = 8 event SysMessage Step %i uses the teleporter } halt ``` --- # path Set > Changes an option of the pathfinder: accuracy, search limits, how to walk, doors, creatures and more. - **Syntax:** `path set {option} {value}` - **Needs a client:** no - **New in Reforged:** EasyUO 1.5 does not have it. - **Sets:** #PathState - **Related:** path find, path go - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/path/set/ `path set` changes one option of [`path find`](https://ilpersi.github.io/EasyUOReforged/commands/path/find/) and of the walk ([`path go`](https://ilpersi.github.io/EasyUOReforged/commands/path/go/), [`path walk`](https://ilpersi.github.io/EasyUOReforged/commands/path/walk/), [`path step`](https://ilpersi.github.io/EasyUOReforged/commands/path/step/)). The options last until the script is started again, which puts them back to the defaults below. | Option | Default | Meaning | |---|---|---| | `accuracy` | `0` | The route may end this many tiles from the goal, in any direction. | | `accuracyz` | `5` | When `path find` is given a height, the route may end this much above or below it. | | `maxnodes` | `1000000` | How many places the search may look at before it gives up (`#PathState` `budget`). | | `timeout` | `5s` | How long the search may take before it gives up (`timeout`). A time is a number of **ticks** of 50 ms, or a whole number of **seconds** followed by `s`. | | `margin` | `100` | The search only looks this many tiles beyond the rectangle around start and goal (and around the links it can use). A route that needs a longer detour needs a bigger margin. | | `turncost` | `30` | What a change of direction costs, in hundredths of a step. The client turns before it steps in a new direction, which takes time. | | `heuristic` | `100` | How strongly the search heads for the goal, in percent. Above 100 the search is faster, but the route may be a little longer, with more turns. | | `difs` | `off` | `on` also reads the client's map patch files (`mapdif*`, `stadif*`). The client only uses them when the shard tells it to. | The walk: | Option | Default | Meaning | |---|---|---| | `mode` | `auto` | How to walk. `steps`: one step at a time with the walk macro. `client`: send the client's own pathfinder to points along the route (where EasyUO Reforged knows it; else `steps`). `auto` is `steps` for now. | | `lead` | `18` | In `client` mode, how far from the character, in tiles, a point may be. | | `mobiles` | `block` | `ignore` plans through creatures, as if they weren't there. Your own character is never in the way. | | `doors` | `on` | `on`: a route may go through a door, which the walker opens, except the doors of player houses. `all`: those too, to walk into your own house. `off`: doors are walls. | | `doorcost` | `50` | What going through a door costs on top of the step, in hundredths of a step. | | `blocktime` | `60s` | How long the walker avoids a place where a step was refused. A time, as for `timeout`. | | `check` | `12` | How far ahead, in tiles from the character, the walker asks the client itself whether the route can be walked (see [`path check`](https://ilpersi.github.io/EasyUOReforged/commands/path/check/)). A tile the client refuses is avoided like a refused step, before the character gets there. `0` never asks. | | `log` | `off` | A file the walker writes what it does to, one line each time it decides something: the waypoints it sends, the refusals and why, the replans, the steps, the doors. A name without a folder goes in the EasyUO Reforged folder; lines are added at the end. `off` stops it. For when a walk doesn't do what you expect. | [`#PathState`](https://ilpersi.github.io/EasyUOReforged/variables/pathstate/) is `ok`, or `error: …` for an unknown option or a bad value. ## Example ```euo path set accuracy 1 ; next to the goal is close enough path set timeout 10s ; long trips across the facet path set mobiles ignore ; push through crowds path go 2505 552 halt ``` --- # path Step > Moves a walk on and returns at once, so the script can do other things while the character walks. - **Syntax:** `path step` - **Needs a client:** yes - **New in Reforged:** EasyUO 1.5 does not have it. - **Sets:** #PathState, #PathCnt, #PathX, #PathY, #PathZ, #PathDir - **Related:** path walk, path go, path stop, path find - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/path/step/ `path step` moves a walk on and returns at once. Call it in a loop: between two calls the script can heal, read the journal or fight, while the character keeps walking. [`#PathState`](https://ilpersi.github.io/EasyUOReforged/variables/pathstate/) stays `walking` until the walk ends; then it says how it ended, as for [`path go`](https://ilpersi.github.io/EasyUOReforged/commands/path/go/). ```euo path find 1434 1699 if #PathState <> ok halt repeat path step if #HITS < 40 event SysMessage Low on hits! wait 1 until #PathState <> walking display ok Walk over: #PathState halt ``` ## Details - The first `path step` starts walking the route of the last [`path find`](https://ilpersi.github.io/EasyUOReforged/commands/path/find/) (or [`path go`](https://ilpersi.github.io/EasyUOReforged/commands/path/go/)), as [`path walk`](https://ilpersi.github.io/EasyUOReforged/commands/path/walk/) would. Each one after it looks where the character is and sends what comes next: one step, the Open Door macro, or in client mode a point for the client's pathfinder. It never waits. - Call it often: every tick (`wait 1`) or so. The walk only goes on while `path step` is called. - Stop the walk with [`path stop`](https://ilpersi.github.io/EasyUOReforged/commands/path/stop/). A new [`path find`](https://ilpersi.github.io/EasyUOReforged/commands/path/find/) also ends it. - After the walk has ended, the next `path step` starts walking toward the same goal again. ## Reforged notes New in EasyUO Reforged. --- # path Stop > Ends the walk that path step is moving on. - **Syntax:** `path stop` - **Needs a client:** no - **New in Reforged:** EasyUO 1.5 does not have it. - **Sets:** #PathState - **Related:** path step, path walk, path go - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/path/stop/ `path stop` ends the walk [`path step`](https://ilpersi.github.io/EasyUOReforged/commands/path/step/) has been moving on. [`#PathState`](https://ilpersi.github.io/EasyUOReforged/variables/pathstate/) is `stopped`, also when no walk was going on. The character stops when the step under way ends. In client mode ([`path set mode client`](https://ilpersi.github.io/EasyUOReforged/commands/path/set/)) the client keeps walking to the point it was sent to last, up to 18 tiles away. The goal is kept: [`path walk`](https://ilpersi.github.io/EasyUOReforged/commands/path/walk/) or [`path step`](https://ilpersi.github.io/EasyUOReforged/commands/path/step/) go on toward it. ## Example ```euo path find 1434 1699 if #PathState <> ok halt repeat path step if #HITS < 20 { path stop display ok Low on hits: the walk is stopped. break } wait 1 until #PathState <> walking halt ``` ## Reforged notes New in EasyUO Reforged. [`path go`](https://ilpersi.github.io/EasyUOReforged/commands/path/go/) and [`path walk`](https://ilpersi.github.io/EasyUOReforged/commands/path/walk/) wait until their walk is over; the Stop button ends those. --- # path Unblock > Removes the path blocks that cover a place or a rectangle. - **Syntax:** `path unblock {x} {y} [{x2} {y2}] [facet]` - **Needs a client:** no - **New in Reforged:** EasyUO 1.5 does not have it. - **Sets:** #PathState - **Related:** path block, path clear - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/path/unblock/ `path unblock` removes every [`path block`](https://ilpersi.github.io/EasyUOReforged/commands/path/block/) that covers the place `x`, `y`, or any place of the rectangle from `x`, `y` to `x2`, `y2`. A block is removed whole, also where it reaches beyond the rectangle. `facet` is a number as in [`#CursKind`](https://ilpersi.github.io/EasyUOReforged/variables/curskind/); the default is the facet you are on. [`#PathState`](https://ilpersi.github.io/EasyUOReforged/variables/pathstate/) is `ok`, or `error: …` for bad arguments. ## Example ```euo path block 1450 1680 1460 1690 path unblock 1455 1685 ; removes the whole block above halt ``` --- # path Walk > Walks the route the last path find planned, waiting until the character gets there. - **Syntax:** `path walk [timeout]` - **Needs a client:** yes - **New in Reforged:** EasyUO 1.5 does not have it. - **Sets:** #PathState, #PathCnt, #PathX, #PathY, #PathZ, #PathDir - **Related:** path find, path go, path step, path stop - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/path/walk/ `path walk` walks the route [`path find`](https://ilpersi.github.io/EasyUOReforged/commands/path/find/) planned, to the goal it was planned for. The script waits until the walk is over, as for [`path go`](https://ilpersi.github.io/EasyUOReforged/commands/path/go/), and [`#PathState`](https://ilpersi.github.io/EasyUOReforged/variables/pathstate/) then says how it went: `arrived`, `blocked`, `failed`, `link`, `timeout` or `stopped` (see [`path go`](https://ilpersi.github.io/EasyUOReforged/commands/path/go/)). ```euo path find 1434 1699 if #PathState <> ok halt display ok #PathCnt steps to the bank path walk halt ``` ## Parameters | Parameter | Meaning | |---|---| | `timeout` | Give up after this long: ticks of 50 ms, or seconds followed by `s`. Without it, there is no time limit. | ## Details - The character doesn't need to stand at the start of the route: the walker finds it anywhere on the route. Off the route, for example after [`path from`](https://ilpersi.github.io/EasyUOReforged/commands/path/from/), it plans again from where the character stands, to the same goal. - After a walk [`path step`](https://ilpersi.github.io/EasyUOReforged/commands/path/step/) started, `path walk` carries it on and waits for its end. - After a walk that ended with `link`, `timeout` or `stopped`, `path walk` goes on toward the same goal, from where the character is now. - Before any [`path find`](https://ilpersi.github.io/EasyUOReforged/commands/path/find/) or [`path go`](https://ilpersi.github.io/EasyUOReforged/commands/path/go/), there is nothing to walk: [`#PathState`](https://ilpersi.github.io/EasyUOReforged/variables/pathstate/) is `error: …`. How the walk works, and what it sees, is described on [`path go`](https://ilpersi.github.io/EasyUOReforged/commands/path/go/#how-it-walks). ## Reforged notes New in EasyUO Reforged. --- # Pause > Pauses the script until Play is pressed. - **Syntax:** `pause` - **Needs a client:** no - **Related:** halt, stop - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/pause/ `pause` pauses the script. Pressing Play goes on with the line after it, with every variable as it was. Use [`halt`](https://ilpersi.github.io/EasyUOReforged/commands/halt/) to stop the script instead. While a script is paused, the variable inspector shows the current values, which makes `pause` a simple breakpoint. EasyUO Reforged also has real breakpoints: see [Editing and debugging](https://ilpersi.github.io/EasyUOReforged/guide/debugging/). ## Example ```euo set %debug #true gosub somesub 5 display ok #Result halt sub somesub if %debug = #true pause ; check the variables here set %something %1 return %something ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # PlayCD > Obsolete: a leftover from early EasyUO versions that does nothing. - **Syntax:** `playcd` - **Needs a client:** no - **Obsolete.** - **Related:** StopCD - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/playcd/ `PlayCD` is a leftover from early EasyUO versions. EasyUO 1.5 still recognised the word but did nothing with it, and EasyUO Reforged keeps it that way: a line starting with `PlayCD` is accepted and does nothing, whatever follows it. Remove it from your scripts. --- # Repeat … Until > Repeats lines until a condition is true, testing it after each round. - **Syntax:** ``` repeat ... until {condition} ``` - **Needs a client:** no - **Related:** while, for, break, continue - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/repeat/ `repeat` and `until` repeat the lines between them. After each round the condition of `until` is tested: when it is true the loop ends, otherwise it starts again from `repeat`. The lines therefore always run at least once, unlike a [`while`](https://ilpersi.github.io/EasyUOReforged/commands/while/) loop, which tests its condition before the first round. The condition is true only when it evaluates to [`#true`](https://ilpersi.github.io/EasyUOReforged/variables/true/), which is `-1`. Comparisons (`=`, `<`, `in`, …) produce `-1` or `0`, and `&&`, `||` and `!` combine those as expected. A plain value is **not** turned into true or false: `if 1` and `if yes` are both false, and `if %flag` is true only when `%flag` holds `#true`. See [`#True` and `#False`](https://ilpersi.github.io/EasyUOReforged/guides/true-and-false/). Braces between `repeat` and `until` are optional; they only make the loop easier to read. Loops can be nested: each `until` belongs to the nearest `repeat` before it that is not already taken. Leave the loop early with [`break`](https://ilpersi.github.io/EasyUOReforged/commands/break/), or skip to the test with [`continue`](https://ilpersi.github.io/EasyUOReforged/commands/continue/). ## Example ```euo set %str Hello , #spc , World repeat set %str %str , ! str len %str until #StrRes >= 30 display ok %str halt ``` The `!` is added and `str len` runs once before `#StrRes >= 30` is tested for the first time. *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # Return > Ends a sub and goes back to the line after its gosub, optionally with a value. - **Syntax:** `return [value]` - **Needs a client:** no - **Related:** gosub, sub, #Result - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/return/ `return` ends the [`sub`](https://ilpersi.github.io/EasyUOReforged/commands/sub/) it is in. The script goes on with the line after the [`gosub`](https://ilpersi.github.io/EasyUOReforged/commands/gosub/) that called it. ## Parameters | Parameter | Meaning | |---|---| | `value` | Optional. A value or [expression](https://ilpersi.github.io/EasyUOReforged/language/expressions/) to put in [`#Result`](https://ilpersi.github.io/EasyUOReforged/variables/result/). Without it, `#Result` reads `N/A`. | A `return` that is not inside a sub called with `gosub` does nothing at all, and leaves `#Result` as it was. ## Example ```euo gosub lowercase #CharName event sysmessage My name is #Result halt ; returns its first parameter in lower case sub lowercase str lower %1 return #StrRes ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # SavePix > Reads the colour of a pixel into #PixCol and a numbered slot for cmppix. - **Syntax:** `savepix {x} {y} {slot} [colour]` - **Needs a client:** yes - **Sets:** #PixCol - **Related:** CmpPix, #PixCol - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/savepix/ `savepix` reads the colour of the pixel at `x`, `y` in the client window. It stores it in [`#PixCol`](https://ilpersi.github.io/EasyUOReforged/variables/pixcol/) and in a numbered slot, together with the position, for [`cmppix`](https://ilpersi.github.io/EasyUOReforged/commands/cmppix/) to compare later. ## Parameters | Parameter | Meaning | |---|---| | `x`, `y` | Position in the client window. | | `slot` | Slot number, `0` to `1000`. | | `colour` | Optional. Store this colour instead of reading the screen; `#PixCol` is not changed. | Pixels are read from the screen, so the client window has to be visible, not covered by another window. ## Example ```euo ; remember the colour under the mouse in slot 1 savepix #CursorX #CursorY 1 display ok Colour #PixCol saved halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # ScanBuffs > Reads the client's buff bar into the #Buff… variables, optionally only one buff icon. - **Syntax:** `scanbuffs [iconID]` - **Needs a client:** yes - **New in Reforged:** EasyUO 1.5 does not have it. - **Sets:** #BuffCnt, #BuffIndex, #BuffID, #BuffCliloc, #BuffName, #BuffDesc, #BuffTime - **Related:** #BuffBarOpen, #BuffIndex, FindItem, ScanJournal - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/scanbuffs/ `ScanBuffs` reads the buffs and debuffs shown in the client's buff bar. Like [`FindItem`](https://ilpersi.github.io/EasyUOReforged/commands/finditem/), it takes a snapshot, selects the first entry and says how many there are in [`#BuffCnt`](https://ilpersi.github.io/EasyUOReforged/variables/buffcnt/). Set [`#BuffIndex`](https://ilpersi.github.io/EasyUOReforged/variables/buffindex/) (1-based) to walk through the rest, the way [`#FindIndex`](https://ilpersi.github.io/EasyUOReforged/variables/findindex/) walks `FindItem`'s results. `ScanBuffs` only **reads** client memory. It writes nothing and patches nothing, so it cannot disturb the client. ## Parameters | Parameter | Meaning | |---|---| | `iconID` | Optional. Keep only the buffs with this icon ID, a plain number. Bless is `30018` (`$7542`). | ## Reading the results For the selected buff: | Variable | Value | |---|---| | [`#BuffID`](https://ilpersi.github.io/EasyUOReforged/variables/buffid/) | Icon ID, a plain number. | | [`#BuffCliloc`](https://ilpersi.github.io/EasyUOReforged/variables/buffcliloc/) | Cliloc number of the buff's title. | | [`#BuffName`](https://ilpersi.github.io/EasyUOReforged/variables/buffname/) | First line of the tooltip, e.g. `Bless`. | | [`#BuffDesc`](https://ilpersi.github.io/EasyUOReforged/variables/buffdesc/) | Second line of the tooltip. | | [`#BuffTime`](https://ilpersi.github.io/EasyUOReforged/variables/bufftime/) | Seconds left, as the tooltip shows them. `-1` means the buff has no timer (Hiding, for one). | `#BuffCnt` is the number of buffs, and [`#BuffBarOpen`](https://ilpersi.github.io/EasyUOReforged/variables/buffbaropen/) tells whether the buff bar window is open at all. ## Examples List every active buff in the journal: ```euo scanbuffs for %i 1 #BuffCnt { set #BuffIndex %i event sysmessage #BuffName : #BuffTime s } halt ``` Recast Bless when it is about to run out: ```euo scanbuffs 30018 if #BuffCnt = 0 || #BuffTime < 10 display ok Time to recast Bless. halt ``` Tell a closed buff bar from an empty one: ```euo scanbuffs if #BuffBarOpen = #false display ok Open the buff bar first. halt ``` ## Notes - **The buff bar window must be open.** The data lives in the client's `BuffIcons` gump. With the window closed, `#BuffCnt` is `0` and the other variables read `N/A`. The same `N/A` appears for a buff that has no tooltip text. - **Texts come from the client's own cliloc table**, so they are in the client's language. `~1_STR~` arguments are filled in, `
` becomes a space and other markup is dropped. Spaces become `_`, as in every string variable, so `str pos #BuffName Bless` works. - **`#BuffTime` updates in coarse steps** (about every 5 seconds), because that is how often the client refreshes the tooltip. A buff whose timer the client no longer knows shows `0`. - **The variables follow the client live.** The selected buff is found again by its icon ID when other buffs come and go. Once it leaves the bar, `#BuffID`, `#BuffCliloc`, `#BuffName`, `#BuffDesc`, `#BuffTime` and `#BuffIndex` read `N/A` until the next `ScanBuffs` or `set #BuffIndex`. `#BuffCnt` is always the live count. Inside a loop over `#BuffIndex`, positions can shift if a buff ends meanwhile: run `ScanBuffs` again if you need a fixed list. ## Reforged notes `ScanBuffs` and all `#Buff…` variables are new in EasyUO Reforged. No existing command, variable or script changes meaning because of them. It works on clients whose buff bar layout has been verified: the 7.0.117.1 beta (`client_beta.exe`) and the fixed-base clients (checked on 7.0.117.1 and on a 2013 client). On any other client the command does nothing and the variables read `N/A`, so it never reads garbage from an unverified layout. --- # ScanGumps > Lists every gump window open in the client, front to back, into the #Gump… variables. - **Syntax:** `scangumps [T_typeIDs] [A_artIDs]` - **Needs a client:** yes - **New in Reforged:** EasyUO 1.5 does not have it. - **Sets:** #GumpCnt, #GumpIndex, #GumpName, #GumpKind, #GumpPosX, #GumpPosY, #GumpSizeX, #GumpSizeY, #GumpArt, #GumpMin, #GumpObjID, #GumpSerial, #GumpTypeID - **Related:** #GumpIndex, #GumpTypeID, #ContKind, ScanBuffs, FindItem - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/scangumps/ `ScanGumps` lists the gump windows open in the client: the backpack and other containers, the paperdoll, the status bar, the skills window, and the gumps the server sends (menus, confirmations, quest windows). Like [`FindItem`](https://ilpersi.github.io/EasyUOReforged/commands/finditem/), it takes a snapshot, selects the first entry and puts the number of entries in [`#GumpCnt`](https://ilpersi.github.io/EasyUOReforged/variables/gumpcnt/). Set [`#GumpIndex`](https://ilpersi.github.io/EasyUOReforged/variables/gumpindex/) (1-based) to walk through the rest. The `#Cont…` variables describe only the gump on top. `ScanGumps` describes every one. `ScanGumps` only **reads** client memory. It writes nothing, so it cannot disturb the client. ## Parameters Both are optional and work like [`FindItem`](https://ilpersi.github.io/EasyUOReforged/commands/finditem/)'s filters. Each value is an ID in the usual EUO format, and several values are joined with `_`. | Parameter | Meaning | |---|---| | `T_typeIDs` | Keep only the server gumps with one of these type IDs: `T_JHEIIPI`, or `T_JHEIIPI_ABCDEF` for two. | | `A_artIDs` | Keep only the gumps with one of these graphics: `A_YE` is the backpack. | With both, a gump must match both. A server gump has no graphic, so `T_` and `A_` together find nothing. ## Reading the results For the selected gump: | Variable | Value | |---|---| | [`#GumpName`](https://ilpersi.github.io/EasyUOReforged/variables/gumpname/) | The client's own name for the window, e.g. `container_gump`, `generic_gump`. | | [`#GumpKind`](https://ilpersi.github.io/EasyUOReforged/variables/gumpkind/) | The same code as [`#ContKind`](https://ilpersi.github.io/EasyUOReforged/variables/contkind/). | | [`#GumpPosX`](https://ilpersi.github.io/EasyUOReforged/variables/gumpposx/), [`#GumpPosY`](https://ilpersi.github.io/EasyUOReforged/variables/gumpposy/) | Position of the window, as `#ContPosX` / `#ContPosY`. | | [`#GumpSizeX`](https://ilpersi.github.io/EasyUOReforged/variables/gumpsizex/), [`#GumpSizeY`](https://ilpersi.github.io/EasyUOReforged/variables/gumpsizey/) | Size of the window, as `#ContSizeX` / `#ContSizeY`. | | [`#GumpArt`](https://ilpersi.github.io/EasyUOReforged/variables/gumpart/) | The window's graphic: `YE` for the backpack. | | [`#GumpMin`](https://ilpersi.github.io/EasyUOReforged/variables/gumpmin/) | `#true` when the window is minimized, `#false` otherwise. | | [`#GumpObjID`](https://ilpersi.github.io/EasyUOReforged/variables/gumpobjid/) | The object the window belongs to: the container, or the character of a paperdoll or status bar. | | [`#GumpSerial`](https://ilpersi.github.io/EasyUOReforged/variables/gumpserial/) | Server gumps only: the serial the server gave this copy of the window. | | [`#GumpTypeID`](https://ilpersi.github.io/EasyUOReforged/variables/gumptypeid/) | Server gumps only: which gump it is. | ## Examples List every open window in the journal: ```euo scangumps for #GumpIndex 1 #GumpCnt event sysmessage #GumpName #GumpArt halt ``` Wait until the server opens a gump you know, then tell where it is: ```euo set %quest JHEIIPI ; #GumpTypeID of that gump, read once by hand repeat scangumps T_ , %quest wait 5 until #GumpCnt > 0 event sysmessage Quest window at #GumpPosX #GumpPosY halt ``` Is the backpack open? ```euo scangumps A_YE if #GumpCnt > 0 && #GumpObjID = #BackpackID event sysmessage The backpack is open. halt ``` ## Notes - **Only windows are listed, front to back.** Entry 1 is the window in front, usually the one opened, clicked or moved last; `client_beta.exe` keeps its menu bar in front of everything, as entry 1. Buttons, texts and other pieces inside a window are not entries. - **Match server gumps on [`#GumpTypeID`](https://ilpersi.github.io/EasyUOReforged/variables/gumptypeid/).** It is the same every time the server opens the same gump. [`#GumpSerial`](https://ilpersi.github.io/EasyUOReforged/variables/gumpserial/) changes every time. [`#GumpKind`](https://ilpersi.github.io/EasyUOReforged/variables/gumpkind/) changes with every client update, so don't keep it in a script for long: use the type ID, the graphic or the name. - **Formats.** IDs, the graphic and the kind are in the usual EUO format, like [`#ContID`](https://ilpersi.github.io/EasyUOReforged/variables/contid/). Positions and sizes are plain numbers. `#GumpMin` is `#true` or `#false`. - **`N/A`** means the value is not there: no gump is selected (none open, or `#GumpIndex` past `#GumpCnt`); the window has no graphic (server gumps) or belongs to no object; `#GumpSerial` and `#GumpTypeID` of a window that is not a server gump; or the value is not known on this client build. - **It is a snapshot.** The values are read when `ScanGumps` runs. A window that moves or closes afterwards keeps its old values until the next `ScanGumps`. ## Reforged notes `ScanGumps` and the `#Gump…` variables are new in EasyUO Reforged. Old EasyUO skips the line and reads the variables as `N/A`. No existing command, variable or script changes meaning because of them. The graphic, the minimized flag, the serial and the type ID are read from the client build's own table. They are known for client 7.0.29.97 and newer, and for the relocatable `client_beta.exe`. On older clients those four variables read `N/A`, and the others still work. The serial and type ID also read `N/A` on the builds from 7.0.30 to 7.0.46, where they are has not been checked. --- # ScanJournal > Reads one journal line into #Journal and #JColor. - **Syntax:** `scanjournal [line]` - **Needs a client:** yes - **Sets:** #Journal, #JColor - **Related:** FindJournal, DeleteJournal, #JIndex, #Journal, #SysMsg - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/scanjournal/ `scanjournal` reads one line of the client's journal into [`#Journal`](https://ilpersi.github.io/EasyUOReforged/variables/journal/), and its colour into [`#JColor`](https://ilpersi.github.io/EasyUOReforged/variables/jcolor/). > **Tip** > > To look for texts rather than read lines one by one, [`findjournal`](https://ilpersi.github.io/EasyUOReforged/commands/findjournal/) does the whole loop in one > line, and can wait for them. ## Parameters | Parameter | Meaning | |---|---| | `line` | Optional. `1` (the default) is the newest line, `2` the one before, and so on, up to 100 lines back. A number above 500 is a [`#JIndex`](https://ilpersi.github.io/EasyUOReforged/variables/jindex/) value instead: the line with that running number. | `#Journal` reads `N/A` when the line does not exist, is too old, or was hidden by [`deletejournal`](https://ilpersi.github.io/EasyUOReforged/commands/deletejournal/). Like every string variable, its spaces read as `_`. ## Examples Following `#JIndex` handles every new line exactly once, however many arrive between two checks: ```euo set %next #JIndex + 1 loop: while %next <= #JIndex { scanjournal %next if is_attacking_you in #Journal event macro 1 0 Guards! set %next %next + 1 } wait 5 goto loop ``` The older way only looks at the newest line, so it can miss lines that arrive together: ```euo check: scanjournal 1 if is_attacking_you in #Journal msg guards$ wait 5 goto check ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # Send > Sends an HTTP POST request and runs the reply as an EasyUO script. - **Syntax:** `send [debug]httppost[port] {host} {path} {data}` - **Needs a client:** no - **Related:** #SendHeader, Call, Execute, SQL - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/send/ `send` sends an HTTP POST request to a web server. **The server's reply is then run as an EasyUO script**, as if it had been started with [`call`](https://ilpersi.github.io/EasyUOReforged/commands/call/): when it ends, the script goes on after the `send`. ## Parameters | Parameter | Meaning | |---|---| | `httppost` | Send to port 80. Add a port number to use another one: `httppost8080`. Put `debug` in front (`debughttppost`) to see the request and the reply in two message boxes. | | `host` | The server, such as `www.example.com`. | | `path` | The page, such as `/euo/action.php`. | | `data` | The form data, such as `name=value&other=value`. | [`#SendHeader`](https://ilpersi.github.io/EasyUOReforged/variables/sendheader/) adds lines to the request's header. The script waits until the reply has arrived. An empty reply runs nothing. > **Danger: The reply runs as a script** > > Whatever the server sends back is run with all the rights of a script: it can read your variables, move your > character and use [`execute`](https://ilpersi.github.io/EasyUOReforged/commands/execute/). Only send to a server you control or trust completely. > There is no setting to turn `send` off. ## Example ```euo set %nick Bob set %text Hello set %data nick= , %nick , &text= , %text send httppost www.example.com /euo/chat.php %data halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # Set > Gives a variable a value, or the result of an expression. - **Syntax:** `set {variable} [value]` - **Needs a client:** no - **Related:** DeleteVar, For - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/set/ `set` gives a variable a value. The value can be an [expression](https://ilpersi.github.io/EasyUOReforged/language/expressions/), which is worked out first. ## Parameters | Parameter | Meaning | |---|---| | `variable` | Any variable a script can write: `%x`, `!x`, `*x`, or a read/write system variable such as [`#LPC`](https://ilpersi.github.io/EasyUOReforged/variables/lpc/). | | `value` | Optional. A value or expression. Without it, the variable becomes empty. | ## Details - **One word only.** A value is a single word: `set %a hello world` stores `hello`. Join words with `_`, or glue them with commas: `set %a hello , #spc , world`. - `abs` after the value stores its absolute value: `set %a -5 abs` stores `5`. - A lone `+` or `-` after a number adds or takes away 1: `set %i %i +` is the same as `set %i %i + 1`. ## Example ```euo set %a 2 set %b $A ; hexadecimal: 10 set %c ( %a * %b ) + 1 ; 21 set %d %a * ( %b + 1 ) ; 22 set %name Sir , #spc , Robin ; "Sir Robin" set %empty set #LPC 100 display ok %c %d %name halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # SetShopItem > Sets how many of an item to buy in the shop’s buy list. - **Syntax:** `setshopitem {id} {amount}` - **Needs a client:** yes - **Related:** GetShopInfo, #ShopItemID, #ShopItemMax - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/setshopitem/ `setshopitem` sets how many of the item with that ID to buy, in the shop's buy list (the bill). Take the ID from [`#ShopItemID`](https://ilpersi.github.io/EasyUOReforged/variables/shopitemid/) after [`getshopinfo`](https://ilpersi.github.io/EasyUOReforged/commands/getshopinfo/). - The item has to be **in the buy list already**: double-click it once in the shop gump so it is added with an amount of 1, then change the amount with `setshopitem`. - The buy list on screen does not show the new amount, but it is set, and it is what you buy. ## Example ```euo getshopinfo setshopitem #ShopItemID #ShopItemMax halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # SetUOTitle > Sets the title of the client window. - **Syntax:** `setuotitle {title}` - **Needs a client:** yes - **Related:** GetUOTitle, #CliTitle - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/setuotitle/ `setuotitle` changes the title of the client window, for example to tell several clients apart. Setting [`#CliTitle`](https://ilpersi.github.io/EasyUOReforged/variables/clititle/) does the same. > **Note** > > UOAssist and Razor can write their own information in the title bar. Turn that option off ("Use titlebar > for display") if they overwrite your title. ## Example ```euo setuotitle Mule - #CharName halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # ShutDown > Shuts down and powers off the computer. - **Syntax:** `shutdown [force]` - **Needs a client:** no - **Related:** Terminate, Execute - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/shutdown/ `shutdown` shuts down Windows and powers off the computer. With `force`, programs that do not close by themselves are closed anyway, and unsaved work in them is lost. > **Caution: Only run scripts you trust** > > There is no setting to turn this command off: any script you run can use it. ## Example ```euo if #CharGhost = yes shutdown halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # Sleep > Pauses the script for a number of milliseconds. - **Syntax:** `sleep {milliseconds}` - **Needs a client:** no - **Related:** Wait - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/sleep/ `sleep` pauses the script for the given number of milliseconds. ## Sleep or wait? `sleep` and [`wait`](https://ilpersi.github.io/EasyUOReforged/commands/wait/) pause the script the same way; only the unit differs. `wait` counts in ticks of 50 ms (or whole seconds) and can add a random extra; `sleep` counts in milliseconds. Use `sleep` for pauses shorter than 50 ms or that are not a multiple of it. Both stop at once when you press Stop, and neither uses CPU while it waits. Old advice to keep `sleep` short because it froze the EasyUO window does not apply: in EasyUO Reforged each script runs on its own thread. ## Example ```euo set %start #SysTime sleep 25 set %took #SysTime - %start display ok Slept %took ms halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # Sound > Plays a .wav file, or the Windows default beep. - **Syntax:** `sound [file]` - **Needs a client:** no - **Related:** Display - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/sound/ `sound` plays a sound. Without a file it plays the Windows default beep. With a `.wav` file it plays that, in the background: the script does not wait for the sound to end. A file that cannot be found plays nothing. Give the full path of the file. ## Example ```euo if #CharGhost = yes { sound C:\Windows\Media\chimes.wav halt } display ok Still alive. halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # sql Close > Closes the database; an open transaction is rolled back. - **Syntax:** `sql close` - **Needs a client:** no - **New in Reforged:** EasyUO 1.5 does not have it. - **Sets:** #SqlRes, #SqlCnt - **Related:** sql open - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/sql/close/ `sql close` closes the script tab's database. A transaction you left open (`sql exec BEGIN` without a `COMMIT`) is rolled back. `#SqlCnt` goes back to `0`. You rarely need it: the connection is also closed when the script is started again, when another script is loaded into the tab, and when the tab is closed. --- # sql Delete > Removes saved variables from the database. - **Syntax:** `sql delete {%var|!var} [...]` - **Needs a client:** no - **New in Reforged:** EasyUO 1.5 does not have it. - **Sets:** #SqlRes, #SqlChanges - **Related:** sql save, sql load - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/sql/delete/ `sql delete` removes the listed variables from the `euo_vars` table. The variables themselves keep their values. [`#SqlChanges`](https://ilpersi.github.io/EasyUOReforged/variables/sqlchanges/) is the number removed. `sql save`, `sql load` and `sql delete` keep variables in a table called `euo_vars`, created when first needed. It works like the `*` variables, but in a file of your choice instead of the registry. - Write the variables as you normally would (`%runs`, not its value). Only `%` and `!` variables can be used. - Names do not depend on case. A `!` variable is saved under its plain name: `!x` saved in one namespace loads into `!x` of whatever namespace is current. - `euo_vars` is an ordinary table: `sql query SELECT name, value FROM euo_vars` lists it. ## Example ```euo sql open mychar.db set %lastloot gold sql save %lastloot sql delete %lastloot display ok Removed #SqlChanges saved variable halt ``` --- # sql Exec > Runs one SQL statement and discards any rows it returns. - **Syntax:** `sql exec {statement}` - **Needs a client:** no - **New in Reforged:** EasyUO 1.5 does not have it. - **Sets:** #SqlRes, #SqlChanges, #SqlLastID - **Related:** sql query, #SqlChanges - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/sql/exec/ `sql exec` runs one statement: `CREATE`, `INSERT`, `UPDATE`, `DELETE`, `BEGIN`, `COMMIT`, `PRAGMA`, … Rows it returns are discarded, and the rows of the last [`sql query`](https://ilpersi.github.io/EasyUOReforged/commands/sql/query/) are kept, so you can run `sql exec` inside a loop over a query's rows. The statement is everything after `sql exec`, exactly as written. `%x`, `!x`, `#x` and `*x` where a value goes are passed to SQLite as values, never pasted into the text. ## Example ```euo sql open mychar.db sql exec CREATE TABLE IF NOT EXISTS kills(mob TEXT, at INTEGER) set %mob orc sql exec INSERT INTO kills(mob, at) VALUES(%mob, #SysTime) display ok Row #SqlLastID added halt ``` Each `sql exec` that changes data is its own transaction, which is slow for many rows. Wrap a batch in `sql exec BEGIN` … `sql exec COMMIT`. See [Using SQL](https://ilpersi.github.io/EasyUOReforged/guides/sql/) for how statements are written and how variables go in and out. --- # SQL > Keeps data in an SQLite database file: raw SQL, or a quick save and load of variables. - **Syntax:** `sql {open|close|exec|query|row|save|load|delete} [arguments...]` - **Needs a client:** no - **New in Reforged:** EasyUO 1.5 does not have it. - **Sets:** #SqlRes, #SqlCnt, #SqlChanges, #SqlLastID - **Related:** sql query, #SqlRes - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/sql/ `SQL` lets a script keep data in an [SQLite](https://sqlite.org) database file: anything from a few variables that survive a restart to real tables you can query. Nothing is installed: EasyUO Reforged uses the SQLite that ships with Windows. ```euo sql open mychar.db sql exec CREATE TABLE IF NOT EXISTS pets(id TEXT PRIMARY KEY, name TEXT, hp INTEGER) set %petid ABCDEFG set %petname Buttercup set %pethp 45 sql exec INSERT OR REPLACE INTO pets VALUES(%petid, %petname, %pethp) set %limit 50 sql query SELECT name, hp FROM pets WHERE hp < %limit ORDER BY hp for %i 1 #SqlCnt { sql row %i ; sets %name and %hp display ok %name has %hp hp } if #SqlRes <> OK display ok SQL error: #SqlRes sql load %runs ; restore last session's value set %runs %runs + 1 display ok Run number %runs sql save %runs ; and keep it for the next one halt ``` ## Sub-commands | Command | What it does | |---|---| | [`sql open`](https://ilpersi.github.io/EasyUOReforged/commands/sql/open/) | Opens (or creates) the database file. | | [`sql close`](https://ilpersi.github.io/EasyUOReforged/commands/sql/close/) | Closes it. | | [`sql exec`](https://ilpersi.github.io/EasyUOReforged/commands/sql/exec/) | Runs one statement and discards any rows it returns. | | [`sql query`](https://ilpersi.github.io/EasyUOReforged/commands/sql/query/) | Runs one statement and keeps its rows; row 1 is loaded into variables. | | [`sql row`](https://ilpersi.github.io/EasyUOReforged/commands/sql/row/) | Loads another row of the last query into variables. | | [`sql save`](https://ilpersi.github.io/EasyUOReforged/commands/sql/save/) | Stores variables in the database. | | [`sql load`](https://ilpersi.github.io/EasyUOReforged/commands/sql/load/) | Restores them. | | [`sql delete`](https://ilpersi.github.io/EasyUOReforged/commands/sql/delete/) | Removes saved variables. | An `sql` line never stops the script. When something goes wrong, [`#SqlRes`](https://ilpersi.github.io/EasyUOReforged/variables/sqlres/) says what, and the script goes on with the next line. Each script tab has **one** database connection, shared with scripts started by `call`. It is closed when you press Play on a stopped script, when a script is loaded into the tab, when the tab is closed, and by `sql open` / `sql close`. See [Using SQL](https://ilpersi.github.io/EasyUOReforged/guides/sql/) for how statements are written and how variables go in and out, and [SQL or * variables?](https://ilpersi.github.io/EasyUOReforged/guides/sql-or-persistent-variables/) for when to use `SQL` instead of `*` variables. ## Reforged notes `SQL` and the `#Sql…` variables are new in EasyUO Reforged. `SQL` is the only new command word; nothing else in the language changes because of it, and the SQLite library is only loaded when a script runs its first `sql` line. --- # sql Load > Restores % and ! variables saved with sql save. - **Syntax:** `sql load {%var|!var} [...]` - **Needs a client:** no - **New in Reforged:** EasyUO 1.5 does not have it. - **Sets:** #SqlRes, #SqlChanges - **Related:** sql save, sql delete - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/sql/load/ `sql load` sets the listed variables to the values saved with [`sql save`](https://ilpersi.github.io/EasyUOReforged/commands/sql/save/). A variable that was never saved is left as it is. [`#SqlChanges`](https://ilpersi.github.io/EasyUOReforged/variables/sqlchanges/) is the number found. `sql save`, `sql load` and `sql delete` keep variables in a table called `euo_vars`, created when first needed. It works like the `*` variables, but in a file of your choice instead of the registry. - Write the variables as you normally would (`%runs`, not its value). Only `%` and `!` variables can be used. - Names do not depend on case. A `!` variable is saved under its plain name: `!x` saved in one namespace loads into `!x` of whatever namespace is current. - `euo_vars` is an ordinary table: `sql query SELECT name, value FROM euo_vars` lists it. ## Example ```euo sql open mychar.db sql load %runs !lastloot ; what was saved last time set %runs %runs + 1 display ok Run %runs - last loot: !lastloot set !lastloot gold sql save %runs !lastloot ; save for next time halt ``` --- # sql Open > Opens an SQLite database file, creating it if needed. - **Syntax:** `sql open {file|:memory:}` - **Needs a client:** no - **New in Reforged:** EasyUO 1.5 does not have it. - **Sets:** #SqlRes, #SqlCnt - **Related:** sql close, #CurPath - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/sql/open/ `sql open` opens the database file for this script tab, creating it if it does not exist. An already open database is closed first. ## Parameters | Parameter | Meaning | |---|---| | `file` | Path of the database file. A relative path starts from [`#CurPath`](https://ilpersi.github.io/EasyUOReforged/variables/curpath/) (the folder of `EasyUOReforged.exe`), the same rule as [`call`](https://ilpersi.github.io/EasyUOReforged/commands/call/). | | `:memory:` | A throw-away database that lives only until it is closed. | ## Example ```euo sql open C:\EasyUO\mychar.db if #SqlRes <> OK display ok Could not open the database: #SqlRes halt ``` To use several files at once, attach them: `sql exec ATTACH 'C:\data\other.db' AS other`, then write `other.table`. `ATTACH` paths are relative to the working directory of EasyUO Reforged, not to `#CurPath`, so give a full path. See [Using SQL](https://ilpersi.github.io/EasyUOReforged/guides/sql/) for how statements are written and how variables go in and out. --- # sql Query > Runs one SQL statement, keeps its rows and loads row 1 into variables. - **Syntax:** `sql query {statement}` - **Needs a client:** no - **New in Reforged:** EasyUO 1.5 does not have it. - **Sets:** #SqlRes, #SqlCnt, #SqlChanges - **Related:** sql row, sql exec, #SqlCnt - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/sql/query/ `sql query` runs one statement and keeps the rows it returns. [`#SqlCnt`](https://ilpersi.github.io/EasyUOReforged/variables/sqlcnt/) is the number of rows, and row 1 is loaded straight away: each column goes into a `%` variable named after it. Load the other rows with [`sql row`](https://ilpersi.github.io/EasyUOReforged/commands/sql/row/). - `SELECT name, hp FROM pets` sets `%name` and `%hp`. Use `AS` to choose the variable name: `SELECT count(*) AS n …` sets `%n`. - SQL `NULL` reads back as `N/A`, like an unset variable. - All rows stay in memory until the next `sql query`. Add a `LIMIT` when a table can be large. ## Example ```euo sql open :memory: sql exec CREATE TABLE pets(name TEXT, hp INTEGER) sql exec INSERT INTO pets VALUES('Rex', 80), ('Buttercup', 45), ('Fluffy', 20) set %limit 50 sql query SELECT name, hp FROM pets WHERE hp < %limit ORDER BY hp for %i 1 #SqlCnt { sql row %i display ok %name has %hp hp } halt ``` See [Using SQL](https://ilpersi.github.io/EasyUOReforged/guides/sql/) for how statements are written and how variables go in and out. --- # sql Row > Loads one row of the last sql query into variables. - **Syntax:** `sql row {n}` - **Needs a client:** no - **New in Reforged:** EasyUO 1.5 does not have it. - **Sets:** #SqlRes - **Related:** sql query, #SqlCnt - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/sql/row/ `sql row` loads row `n` (from `1` to [`#SqlCnt`](https://ilpersi.github.io/EasyUOReforged/variables/sqlcnt/)) of the last [`sql query`](https://ilpersi.github.io/EasyUOReforged/commands/sql/query/) into `%` variables named after the columns. A number out of range leaves the variables alone and sets `#SqlRes` to `row … out of range`. ## Example ```euo sql open :memory: sql exec CREATE TABLE wanted(item TEXT, price INTEGER) sql exec INSERT INTO wanted VALUES('bandage', 5), ('arrow', 2) sql query SELECT item, price FROM wanted for %i 1 #SqlCnt { sql row %i display ok Buy %item for up to %price gold } halt ``` See [Using SQL](https://ilpersi.github.io/EasyUOReforged/guides/sql/) for how statements are written and how variables go in and out. --- # sql Save > Stores the values of % and ! variables in the database. - **Syntax:** `sql save {%var|!var} [...]` - **Needs a client:** no - **New in Reforged:** EasyUO 1.5 does not have it. - **Sets:** #SqlRes, #SqlChanges - **Related:** sql load, sql delete - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/sql/save/ `sql save` stores the current values of the listed variables in the database. It writes all of them or none of them. [`#SqlChanges`](https://ilpersi.github.io/EasyUOReforged/variables/sqlchanges/) is the number saved. `sql save`, `sql load` and `sql delete` keep variables in a table called `euo_vars`, created when first needed. It works like the `*` variables, but in a file of your choice instead of the registry. - Write the variables as you normally would (`%runs`, not its value). Only `%` and `!` variables can be used. - Names do not depend on case. A `!` variable is saved under its plain name: `!x` saved in one namespace loads into `!x` of whatever namespace is current. - `euo_vars` is an ordinary table: `sql query SELECT name, value FROM euo_vars` lists it. ## Example ```euo sql open mychar.db sql load %runs !lastloot ; what was saved last time set %runs %runs + 1 display ok Run %runs - last loot: !lastloot set !lastloot gold sql save %runs !lastloot ; save for next time halt ``` --- # Stop > Stops the script; exactly the same as halt. - **Syntax:** `stop` - **Needs a client:** no - **Related:** halt, pause - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/stop/ `stop` stops the script. It does exactly the same as [`halt`](https://ilpersi.github.io/EasyUOReforged/commands/halt/): it cannot be resumed, and pressing Play starts the script again from the first line. ## Example ```euo gosub work stop sub work display ok Working... return ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # StopCD > Obsolete: a leftover from early EasyUO versions that does nothing. - **Syntax:** `stopcd` - **Needs a client:** no - **Obsolete.** - **Related:** PlayCD - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/stopcd/ `StopCD` is a leftover from early EasyUO versions. EasyUO 1.5 still recognised the word but did nothing with it, and EasyUO Reforged keeps it that way: a line starting with `StopCD` is accepted and does nothing, whatever follows it. Remove it from your scripts. --- # Str > Works on a piece of text (length, position, part, case, replace, split, trim, join, insert, delete, count); the result goes to #StrRes. - **Syntax:** `str {operation} {text} [parameters...]` - **Needs a client:** no - **Changed in Reforged:** see "Reforged notes" below. - **Sets:** #StrRes - **Related:** #StrRes, #SPC, #DOT, #SMC - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/str/ `str` works on a piece of text and puts the result in [`#StrRes`](https://ilpersi.github.io/EasyUOReforged/variables/strres/). | Operation | Result in `#StrRes` | EasyUO 1.5 | |---|---|---| | `str len {text}` | The number of characters. | Yes | | `str pos {text} {part} [n]` | Where `part` starts in `text`, counting from 1; with `n`, where its `n`-th occurrence starts. `0` when it is not there. | Yes | | `str count {text} {part}` | How many times `part` occurs in `text`. | Yes | | `str left {text} {n}` | The first `n` characters. | Yes | | `str right {text} {n}` | The last `n` characters. | Yes | | `str mid {text} {start} {n}` | `n` characters starting at character `start`. | Yes | | `str lower {text}` | The text in lower case. | Yes | | `str upper {text}` | The text in upper case. | Yes | | `str ins {text} {part} {start}` | The text with `part` inserted at character `start`. | Yes | | `str del {text} {start} {n}` | The text with `n` characters removed, starting at character `start`. | Yes | | `str replace {text} {search} [with]` | The text with every `search` replaced by `with`, or removed when `with` is left out. | **No:** new in Reforged | | `str part {text} {separator} {n}` | The `n`-th field between separators, counting from 1. `N/A` when there is no such field. | **No:** new in Reforged | | `str trim {text} [chars]` | The text without those characters at either end. Without `chars`: spaces and `_`. | **No:** new in Reforged | | `str join {separator} {text} [text...]` | The texts in order, with the separator between them. | **No:** new in Reforged | | `str concat {text} [text...]` | The texts in order, with nothing between them. | **No:** new in Reforged | > **Note: Writing for EasyUO 1.5 too** > > `replace`, `part`, `trim`, `join` and `concat` are new in EasyUO Reforged. EasyUO 1.5 knows only the other ten: > there, these five set `#StrRes` to `N/A` and do nothing else, with no error. A script that must also run on > EasyUO 1.5 uses only the operations marked *Yes*, and does the rest with `pos`, `left`, `mid` and `del`. `pos`, `count`, `replace`, `part` and `trim` ignore case when they look for something, and the result keeps the case of the text. When parameters are missing, `#StrRes` is `N/A`. ## Examples ```euo set %s HELLO str len %s ; 5 str pos %s LL ; 3 str left %s 4 ; HELL str right %s 2 ; LO str mid %s 2 3 ; ELL str lower %s ; hello str upper hello ; HELLO str ins %s I 3 ; HEILLO str del %s 3 2 ; HEO str count %s L ; 2 display ok #StrRes halt ``` ### Replace (Reforged) ```euo str replace red_red_blue RED green ; green_green_blue display ok #StrRes str replace a-b-c - ; abc: nothing to replace it with, so it is removed display ok #StrRes halt ``` A replacement may contain what it replaces: `str replace a_b _ __` gives `a__b`. When `search` isn't in the text, or is empty, the result is the text unchanged. ### Split (Reforged) `str part` takes one field out of a text. Use it with `for` and `str count` to go through all of them: a text has one field more than it has separators. ```euo set %list iron_gold_agapite str count %list _ set %n #StrRes + 1 for %i 1 %n { str part %list _ %i display ok #StrRes } halt ``` A separator at the start, at the end or doubled makes an empty field, so `_a__b` has the fields *empty*, `a`, *empty* and `b`. An empty field is empty text, and asking for a field past the last one gives `N/A`. To read a field into a numbered variable, write `set %ore . %i #StrRes` in the loop. A separator can be several characters. To take what stands between two markers, use `str part` twice: ```euo set %list iron^10|gold^20|agapite^30| str part %list gold^ 2 ; 20|agapite^30| str part #StrRes | 1 ; 20 display ok #StrRes halt ``` ### Trim (Reforged) ```euo str trim __hello_world__ ; hello_world display ok #StrRes str trim /ore/gold/ / ; ore/gold display ok #StrRes halt ``` Without `chars`, `trim` removes spaces and `_`. Every character of `chars` counts on its own: `str trim %s $/` removes both `$` and `/`. To remove characters everywhere in a text and not only at its ends, go through them with `str replace`: ```euo set %name My?Shard! set %bad ?!/ str len %bad set %n #StrRes for %i 1 %n { str mid %bad %i 1 str replace %name #StrRes set %name #StrRes } display ok %name ; MyShard halt ``` ### Join and concat (Reforged) ```euo str join _ iron gold agapite ; iron_gold_agapite display ok #StrRes str join #SPC Sir Robin ; Sir Robin display ok #StrRes str concat Sir #SPC Robin ; Sir Robin display ok #StrRes halt ``` An empty value keeps its place in `join`, so `str part` finds the same fields again. `str join _ a %empty c`, with `%empty` holding empty text, gives `a__c`. ## Spaces and `_` Text from the client holds its spaces in one of two ways, and `replace` and `part` take you at your word: `_` doesn't match a real space, as with `str pos` and `in`. | The text | Spaces are | Write | |---|---|---| | [`#Journal`](https://ilpersi.github.io/EasyUOReforged/variables/journal/), [`#SysMsg`](https://ilpersi.github.io/EasyUOReforged/variables/sysmsg/), `#ContName`, `#TileName`, `#ShopName` | `_` | `_` | | [`#Property`](https://ilpersi.github.io/EasyUOReforged/variables/property/), `#CharName`, `#Shard`, `#CliTitle` | real spaces | [`#SPC`](https://ilpersi.github.io/EasyUOReforged/variables/spc/) | ```euo set %line You_must_wait ; as #Journal holds it str part %line _ 3 ; wait display ok #StrRes str replace %line _ #SPC ; You must wait display ok #StrRes halt ``` `#Property` also ends each line with `$`, so `$` separates its lines, and it has one more field than it has lines, an empty one after the last `$`. Here is the number from a line like `Uses Remaining: 25`: ```euo event Property #FindID str part #Property Remaining: 2 ; " 25$", and whatever lines follow str part #StrRes $ 1 ; " 25" str trim #StrRes ; 25 set %uses #StrRes str part #Property $ 1 ; the first line, the item's name str part #StrRes #SPC 1 ; its first word set %firstWord #StrRes halt ``` To compare a `#Property` text the way you would a journal line, `str replace #Property #SPC _` gives you `_` everywhere. ## Words that can't be passed A line is split into words, and a few words are read as part of the line before `str` gets them. This is true of every command. | To pass | Write | Why | |---|---|---| | A space | [`#SPC`](https://ilpersi.github.io/EasyUOReforged/variables/spc/) | A space ends a word. | | A `.` | [`#DOT`](https://ilpersi.github.io/EasyUOReforged/variables/dot/) | A lone `.` glues the words on either side together, unless it is the last word. | | A `;` at the start of a word | [`#SMC`](https://ilpersi.github.io/EasyUOReforged/variables/smc/) | A word starting with `;` starts a comment. | | A `,` | Only as the last word | A lone `,` glues the words on either side together, even when it comes from a variable. | So `str replace %s ,` removes the commas, but `str replace %s , _`, `str part %s , 2` and `str join , %a %b` can't work and give `N/A`. To cut a text at a comma, use `str pos %s ,` followed by `str left` and `str del`. ## Reforged notes - `str replace`, `str part`, `str trim`, `str join` and `str concat` are new. In EasyUO 1.5 these words did nothing but set `#StrRes` to `N/A`, as any unknown operation still does. - The other operations are unchanged. *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # Sub > Starts a named block of lines that gosub can call. - **Syntax:** ``` sub {name} ... return [value] ``` - **Needs a client:** no - **Related:** gosub, return, goto - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/sub/ `sub` starts a sub: a named group of lines that [`gosub`](https://ilpersi.github.io/EasyUOReforged/commands/gosub/) runs, ending with [`return`](https://ilpersi.github.io/EasyUOReforged/commands/return/). Parameters passed by `gosub` are in `%1`, `%2`, … and their number is in `%0`. ```euo gosub say hello world halt sub say display ok %0 words: %1 %2 return ``` ## Where to put subs When the normal flow of the script reaches a `sub` line, it does not run the sub: it jumps over it, to the line after the sub's **first** `return`. A sub with an early `return`, such as one inside an `if`, is therefore not skipped completely: the script lands in the middle of it. Two ways to avoid that: - **Put the subs after the main part of the script**, after its `halt` or its final `goto`, where the flow never reaches them. This is the usual layout. - **Or wrap the body in a block** right after the `sub` line. The script then skips the whole block: ```euo sub check { if %x = 0 return 0 return 1 } set %x 0 gosub check display ok #Result ; 0 halt ``` ## Details - Names are not case-sensitive. When two subs have the same name, `gosub` uses the last one in the script. - Leave a sub with `return`, never with [`goto`](https://ilpersi.github.io/EasyUOReforged/commands/goto/). *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # Target > Waits until a target cursor appears, or the timeout passes. - **Syntax:** `target [timeout]` - **Needs a client:** yes - **Related:** #TargCurs, #LTargetID, event Macro, WaitFor - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/target/ `target` waits until the client shows a target cursor. It returns at once if one is already showing. ## Parameters | Parameter | Meaning | |---|---| | `timeout` | Optional. The longest to wait. Default: 2 seconds. A time is a number of **ticks** of 50 ms (`20` is one second), or a whole number of **seconds** followed by `s` (`5s`). | `target` does not say whether the cursor appeared. Check [`#TargCurs`](https://ilpersi.github.io/EasyUOReforged/variables/targcurs/) afterwards, or use [`waitfor #TargCurs = 1`](https://ilpersi.github.io/EasyUOReforged/commands/waitfor/), which reports it. ## Example ```euo event macro 15 28 ; cast Greater Heal, which needs a target target 3s if #TargCurs = 1 event macro 22 0 ; target the last target halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # Terminate > Closes the client, or the EasyUO Reforged window. - **Syntax:** `terminate {uo|euo}` - **Needs a client:** no - **Related:** UOXL, #CliCnt - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/terminate/ `terminate` closes something: | Parameter | Effect | |---|---| | `uo` | Closes the client the script drives, then waits one second. [`#CliCnt`](https://ilpersi.github.io/EasyUOReforged/variables/clicnt/) and [`#CliNr`](https://ilpersi.github.io/EasyUOReforged/variables/clinr/) change accordingly. | | `euo` | Closes the EasyUO Reforged window, as if you had closed it yourself. | Without a parameter, `terminate` does nothing. ## Example ```euo if #CharGhost = yes terminate uo halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # Tile > Reads the map: how many tiles are at a spot, and the type, height, name and flags of each. - **Syntax:** ``` tile init [nooverrides] tile cnt {x} {y} [facet] tile get {x} {y} {n} [facet] ``` - **Needs a client:** yes - **Changed in Reforged:** see "Reforged notes" below. - **Sets:** #TileCnt, #TileType, #TileZ, #TileName, #TileFlags - **Related:** #TileFlags, #CursKind - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/tile/ `tile` reads the client's map files: what lies at a world position, layer by layer (ground, then statics). | Form | What it does | |---|---| | `tile init [nooverrides]` | Loads the map files. Needed once before `cnt` and `get`. | | `tile cnt {x} {y} [facet]` | Puts the number of tiles at `x`, `y` in [`#TileCnt`](https://ilpersi.github.io/EasyUOReforged/variables/tilecnt/). | | `tile get {x} {y} {n} [facet]` | Reads tile `n` (from 1 to `#TileCnt`) at `x`, `y` into [`#TileType`](https://ilpersi.github.io/EasyUOReforged/variables/tiletype/), [`#TileZ`](https://ilpersi.github.io/EasyUOReforged/variables/tilez/), [`#TileName`](https://ilpersi.github.io/EasyUOReforged/variables/tilename/) and [`#TileFlags`](https://ilpersi.github.io/EasyUOReforged/variables/tileflags/). | ## Details - **`tile init`** reads the files from the attached client's own folder. `nooverrides` skips the client's map and statics patch files (`mapdif*.mul`, `mapdifl*.mul`, `stadif*.mul`, `stadifl*.mul` and `stadifi*.mul`) and reads only the base map files, for shards that do not use the patches. Without `tile init`, `cnt` gives 0 and `get` reads nothing. - **`facet`** is the facet number, as in [`#CursKind`](https://ilpersi.github.io/EasyUOReforged/variables/curskind/). Default: the facet you are on. - See [`#TileFlags`](https://ilpersi.github.io/EasyUOReforged/variables/tileflags/) for what the flags mean. ## Example ```euo tile init tile cnt #CharPosX #CharPosY for %n 1 #TileCnt { tile get #CharPosX #CharPosY %n event sysmessage #TileName at height #TileZ } halt ``` ## Reforged notes - Newer client installs ship the maps packed in `.uop` files (`map0LegacyMUL.uop`, …) instead of the classic `map0.mul`. EasyUO Reforged reads those directly, so `tile` works on these installs without extracting the files to the old MUL format first. When both exist, the classic `.mul` file is used. - **Trammel** (facet 1) is read from its own map files (`map1`, `staidx1.mul` and `statics1.mul`). EasyUO 1.5 read Felucca's files for Trammel, which matched clients before Mondain's Legacy but not current ones, where places such as New Haven differ. Installs without Trammel files still use Felucca's. - **Felucca and Trammel are 7168 tiles wide** on current clients. EasyUO 1.5 stopped at x 6143, so `cnt` and `get` gave nothing further east. The width now comes from the map files, so older 6144-wide installs work as before. - **Ter Mur** (facet 5) is read from the right place. EasyUO 1.5 computed the position in the map files wrongly there and returned tiles from elsewhere on the facet. - **`tile init` works when patch files are missing.** Current installs no longer ship the map patch files, and EasyUO 1.5's `tile init` stopped the script with an error when Felucca's or Trammel's were not there, so only `tile init nooverrides` worked. Now a facet's patches are used only when all of their files are present (`mapdifl` and `mapdif` for the map, `stadifl`, `stadifi` and `stadif` for the statics), and are skipped otherwise. - Scripts that read Trammel, Ter Mur or the far east of Felucca can see different tiles than in EasyUO 1.5: those are the client's real tiles. *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # UOXL > Starts another client, or switches the script to the next running one. - **Syntax:** `uoxl {new|swap}` - **Needs a client:** no - **Related:** #CliNr, #CliCnt, Terminate - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/uoxl/ `uoxl` manages several clients. | Parameter | Effect | |---|---| | `new` | Starts another client, like *Tools → New Client*. You are asked where `client.exe` is the first time. | | `swap` | Makes the script drive the next running client, wrapping around after the last one, like *Tools → Swap To Next Client*. | [`#CliCnt`](https://ilpersi.github.io/EasyUOReforged/variables/clicnt/) is the number of clients and [`#CliNr`](https://ilpersi.github.io/EasyUOReforged/variables/clinr/) the one the script drives. ## Example ```euo ; say hello on every client for %i 1 #CliCnt { msg hello$ uoxl swap wait 10 } halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # Wait > Pauses the script for a time, in 50 ms ticks or seconds, plus an optional random extra. - **Syntax:** `wait {time} [random]` - **Needs a client:** no - **Related:** Sleep, Pause, WaitFor - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/wait/ `wait` pauses the script. ## Parameters | Parameter | Meaning | |---|---| | `time` | How long. A time is a number of **ticks** of 50 ms (`20` is one second), or a whole number of **seconds** followed by `s` (`5s`). | | `random` | Optional. Up to this much longer, a different random amount each time. Same units. | For pauses in milliseconds, or shorter than one tick, use [`sleep`](https://ilpersi.github.io/EasyUOReforged/commands/sleep/). Pressing Stop ends a `wait` at once. ## Examples ```euo wait 20 ; 1 second wait 5s ; 5 seconds wait 2s 1s ; between 2 and 3 seconds halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # WaitFor > Waits until a condition is true or a timeout passes, and reports which happened in #WaitRes. - **Syntax:** `waitfor {condition} [timeout]` - **Needs a client:** no - **New in Reforged:** EasyUO 1.5 does not have it. - **Sets:** #WaitRes - **Related:** If, Target, Wait, FindJournal, #WaitRes - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/waitfor/ `waitfor` checks a condition every tick (50 ms) until it is true or the timeout passes. [`#WaitRes`](https://ilpersi.github.io/EasyUOReforged/variables/waitres/) then says which happened: `#true` if the condition was met, `#false` if the time ran out. If the condition is already true, the script goes on without any delay. It replaces the loops scripts write to wait for the client, and the fixed waits they guess at: ```euo event macro 8 7 ; open the backpack waitfor #ContName = container_gump 3s if #WaitRes = #false display ok The backpack did not open. halt ``` ## Parameters | Parameter | Meaning | |---|---| | `condition` | What to wait for, written as for [`if`](https://ilpersi.github.io/EasyUOReforged/commands/if/). | | `timeout` | Optional. The longest to wait. Default: 2 seconds. A time is a number of **ticks** of 50 ms (`20` is one second), or a whole number of **seconds** followed by `s` (`5s`). `0` checks once and doesn't wait. A value that can't be read as a time, such as an unset variable, counts as the default. | ## Conditions The condition is read exactly as `if` reads it, so `=`, `<>`, `<`, `>`, `<=`, `>=`, `in`, `notin`, `&&`, `||`, `!` and parentheses all work the same. Combine as many conditions as you need and nest them to any depth: ```euo event macro 8 7 waitfor ( ( #ContName = generic_gump || #ContName = container_gump ) && #ContSizeX > 100 ) || #TargCurs = 1 5s if #WaitRes event sysmessage Something happened halt ``` Variables are read again on every check. The rules are those of `if`: - Every word, including each parenthesis and operator, needs a space around it: `( #ContID = %id )`, not `(#ContID = %id)`. - `&&` binds tighter than `||`. Without parentheses, `%a = 1 || %b = 2 && %c = 3` means `%a = 1 || ( %b = 2 && %c = 3 )`. - A parenthesis left unbalanced gives no error. The condition just can't come true as you meant it, and the timeout may count as the default. - A single variable counts as true only when it holds `#true` (`-1`). A long condition can go on over [`+` lines](https://ilpersi.github.io/EasyUOReforged/language/expressions/#lines-and-blocks). They join without a space, so write the space after the `+`: ```euo waitfor ( #ContName = generic_gump && #ContSizeX > 100 ) + || ( #ContName = container_gump && #ContSizeX > 50 ) + || #TargCurs = 1 5s halt ``` `#WaitRes` tells only whether the whole condition came true. To know which part did, test it afterwards: ```euo event macro 15 28 ; cast Greater Heal, which needs a target waitfor #TargCurs = 1 || recovered in #SysMsg 3s if #TargCurs = 1 event macro 22 0 halt ``` ## Pause, Stop and stepping - **Pause** holds the wait, and the time paused doesn't count towards the timeout. The condition is checked again on resuming, so one that came true during the pause counts as met. - **Stop** ends the wait at once and leaves `#WaitRes` as it was. - **Step Into** and **Step Over** treat the whole wait as one step. - The editor stays responsive during a wait, and the variable inspector keeps updating. ## Notes - `waitfor` works without a client. Client variables then read `N/A`, so a condition on them never comes true and the command runs its timeout. Conditions on `%` variables or [`#SCnt`](https://ilpersi.github.io/EasyUOReforged/variables/scnt/) work as usual. - A state that lasts less than a tick can be missed between two checks. - To wait for a text in the journal, use [`findjournal`](https://ilpersi.github.io/EasyUOReforged/commands/findjournal/) with a timeout. A condition can't search the journal. - The wait can end up to one tick after the timeout. - `waitfor 5s` has `5s` as its **condition**, which is never true, so it waits for the default 2 seconds. To wait a fixed time, use [`wait`](https://ilpersi.github.io/EasyUOReforged/commands/wait/). - In a `for` loop whose body is a single line with no braces, the loop variable has already moved on when `waitfor` checks for the second time. If the condition uses that variable, put the body in `{ }`. ## Reforged notes `waitfor` and `#WaitRes` are new in EasyUO Reforged. No existing command changes because of them, and a sub or label called `waitfor` keeps working. It's the only change for old scripts: a line starting with the word `waitfor` used to be ignored and is now this command. `uo.dll` has no equivalent. A program using it polls the properties itself. --- # While > Repeats a line or block as long as a condition is true, testing it first. - **Syntax:** `while {condition}` - **Needs a client:** no - **Related:** repeat, for, break, continue, if - **Online:** https://ilpersi.github.io/EasyUOReforged/commands/while/ `while` tests its condition and, as long as it is true, runs the line or block after it and tests again. When the condition is false the script goes on after the loop. If it is false from the start, the loop does not run at all; use [`repeat … until`](https://ilpersi.github.io/EasyUOReforged/commands/repeat/) to run the lines at least once. The condition is true only when it evaluates to [`#true`](https://ilpersi.github.io/EasyUOReforged/variables/true/), which is `-1`. Comparisons (`=`, `<`, `in`, …) produce `-1` or `0`, and `&&`, `||` and `!` combine those as expected. A plain value is **not** turned into true or false: `if 1` and `if yes` are both false, and `if %flag` is true only when `%flag` holds `#true`. See [`#True` and `#False`](https://ilpersi.github.io/EasyUOReforged/guides/true-and-false/). A block is a `{` line, the lines to run, and a matching `}` line. The `{` has to be **the very next line**: a blank line or a comment in between means only that line belongs to the command, and the block after it runs every time. Braces go on lines of their own. Without a block, only the next line is repeated. Leave the loop early with [`break`](https://ilpersi.github.io/EasyUOReforged/commands/break/), or skip to the next test with [`continue`](https://ilpersi.github.io/EasyUOReforged/commands/continue/). ## Example ```euo set %test 1 while %test < 10 set %test %test + 1 display ok %test ; shows 10 halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #AR > Your character’s physical resistance (armour rating before Age of Shadows). - **Access:** read-only - **Type:** number - **Needs a client:** yes - **Related:** #FR, #CR, #PR, #ER - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/ar/ `#AR` is your character's physical resistance; on shards without the Age of Shadows resistances, its armour rating. It is read from your character's status, which the client only has once the status window has been opened. If it reads `N/A`, open the status window once, by hand or with `event Macro 8 2`. ## Example ```euo display ok My physical resist is #AR halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #BackpackID > ID of your character’s backpack. - **Access:** read-only - **Type:** id - **Needs a client:** yes - **Related:** #CharID, FindItem, exevent DropC - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/backpackid/ `#BackpackID` is the ID of your character's main backpack. Use it to search the backpack with [`finditem`](https://ilpersi.github.io/EasyUOReforged/commands/finditem/) or to drop things into it with [`exevent DropC`](https://ilpersi.github.io/EasyUOReforged/commands/exevent/dropc/). It reads `N/A` while the client does not know the backpack yet, for example right after logging in. ## Example ```euo finditem * C_ , #BackpackID display ok There are #FindCnt items in your backpack. halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #BuffBarOpen > #true when the client’s buff bar window is open, #false when it is closed. - **Access:** read-only - **Type:** boolean - **Needs a client:** yes - **New in Reforged:** EasyUO 1.5 does not have it. - **Related:** ScanBuffs, #BuffCnt, #BuffIndex - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/buffbaropen/ `#BuffBarOpen` is [`#true`](https://ilpersi.github.io/EasyUOReforged/variables/true/) (`-1`) when the buff bar window is open and [`#false`](https://ilpersi.github.io/EasyUOReforged/variables/false/) (`0`) when it is closed, so a script can compare it with either. It reads `N/A` with no client, or on a client whose buff bar cannot be read. [`ScanBuffs`](https://ilpersi.github.io/EasyUOReforged/commands/scanbuffs/) can only see buffs while the window is open, so this tells an open bar with no buffs (`#BuffBarOpen` `#true`, `#BuffCnt` 0) apart from a closed one. ## Reforged notes Up to v26.10.29 it was `1` when open, like [`#CliLogged`](https://ilpersi.github.io/EasyUOReforged/variables/clilogged/). A script that compares it with `1` must compare it with `#true` now; one that compares it with `0` works as before. ## Example ```euo if #BuffBarOpen = #false display ok Open the buff bar so the script can see your buffs. halt ``` --- # #BuffCliloc > Cliloc number of the selected buff’s title. - **Access:** read-only - **Type:** number - **Needs a client:** yes - **New in Reforged:** EasyUO 1.5 does not have it. - **Set by:** ScanBuffs - **Related:** ScanBuffs, #BuffCnt, #BuffIndex, #BuffBarOpen, #BuffName - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/buffcliloc/ `#BuffCliloc` is the number of the client's localized text (cliloc) that names the buff selected by [`#BuffIndex`](https://ilpersi.github.io/EasyUOReforged/variables/buffindex/). Unlike [`#BuffName`](https://ilpersi.github.io/EasyUOReforged/variables/buffname/), it is the same in every client language, so it is the safer value to compare in a script you share. Reads `N/A` when no buff is selected: the buff bar is closed or empty, the client's buff bar layout is not supported, or the selected buff has left the bar since the last [`ScanBuffs`](https://ilpersi.github.io/EasyUOReforged/commands/scanbuffs/) or `set #BuffIndex`. --- # #BuffCnt > Number of buffs on the buff bar, counted live. - **Access:** read-only - **Type:** number - **Needs a client:** yes - **New in Reforged:** EasyUO 1.5 does not have it. - **Set by:** ScanBuffs - **Related:** ScanBuffs, #BuffIndex, #BuffBarOpen - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/buffcnt/ `#BuffCnt` is the number of buffs and debuffs shown on the client's buff bar. It is the live count: it changes as buffs come and go, even without a new [`ScanBuffs`](https://ilpersi.github.io/EasyUOReforged/commands/scanbuffs/). It is `0` when the buff bar window is closed. Use [`#BuffBarOpen`](https://ilpersi.github.io/EasyUOReforged/variables/buffbaropen/) to tell a closed bar from an open one with no buffs. ## Example ```euo scanbuffs if #BuffCnt = 0 display ok No buffs right now. halt ``` --- # #BuffDesc > Second line of the selected buff’s tooltip. - **Access:** read-only - **Type:** string - **Needs a client:** yes - **New in Reforged:** EasyUO 1.5 does not have it. - **Set by:** ScanBuffs - **Related:** ScanBuffs, #BuffCnt, #BuffIndex, #BuffBarOpen, #BuffName - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/buffdesc/ `#BuffDesc` is the second line of the tooltip of the buff selected by [`#BuffIndex`](https://ilpersi.github.io/EasyUOReforged/variables/buffindex/): usually what the buff does, such as the stat bonus. It is processed like [`#BuffName`](https://ilpersi.github.io/EasyUOReforged/variables/buffname/): client language, arguments filled in, markup dropped, spaces as `_`. It also reads `N/A` for a buff without a description. Reads `N/A` when no buff is selected: the buff bar is closed or empty, the client's buff bar layout is not supported, or the selected buff has left the bar since the last [`ScanBuffs`](https://ilpersi.github.io/EasyUOReforged/commands/scanbuffs/) or `set #BuffIndex`. --- # #BuffID > Icon ID of the selected buff, a plain number (Bless is 30018). - **Access:** read-only - **Type:** number - **Needs a client:** yes - **New in Reforged:** EasyUO 1.5 does not have it. - **Set by:** ScanBuffs - **Related:** ScanBuffs, #BuffCnt, #BuffIndex, #BuffBarOpen - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/buffid/ `#BuffID` is the icon ID of the buff selected by [`#BuffIndex`](https://ilpersi.github.io/EasyUOReforged/variables/buffindex/). It is a plain number, not a Sys26 ID: Bless is `30018` (`$7542`). Pass it to `ScanBuffs` to look for one buff only: `scanbuffs 30018`. Reads `N/A` when no buff is selected: the buff bar is closed or empty, the client's buff bar layout is not supported, or the selected buff has left the bar since the last [`ScanBuffs`](https://ilpersi.github.io/EasyUOReforged/commands/scanbuffs/) or `set #BuffIndex`. ## Example ```euo scanbuffs for %i 1 #BuffCnt { set #BuffIndex %i if #BuffID = 30018 display ok Blessed: #BuffTime s left } halt ``` --- # #BuffIndex > Selects which buff the #Buff… variables describe; 1 is the first. - **Access:** read / write - **Type:** number - **Needs a client:** yes - **New in Reforged:** EasyUO 1.5 does not have it. - **Set by:** ScanBuffs - **Related:** ScanBuffs, #BuffCnt, #BuffBarOpen - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/buffindex/ `#BuffIndex` selects one entry of the snapshot [`ScanBuffs`](https://ilpersi.github.io/EasyUOReforged/commands/scanbuffs/) took, the way [`#FindIndex`](https://ilpersi.github.io/EasyUOReforged/variables/findindex/) selects one `FindItem` match. Set it to a number from `1` to `#BuffCnt`; [`#BuffID`](https://ilpersi.github.io/EasyUOReforged/variables/buffid/), [`#BuffName`](https://ilpersi.github.io/EasyUOReforged/variables/buffname/) and the other `#Buff…` variables then describe that buff. Reading it gives the position of the selected buff. Reads `N/A` when no buff is selected: the buff bar is closed or empty, the client's buff bar layout is not supported, or the selected buff has left the bar since the last [`ScanBuffs`](https://ilpersi.github.io/EasyUOReforged/commands/scanbuffs/) or `set #BuffIndex`. ## Example ```euo scanbuffs for #BuffIndex 1 #BuffCnt event sysmessage #BuffName halt ``` Positions can shift while you loop if a buff ends meanwhile. Run `ScanBuffs` again when you need a fixed list. --- # #BuffName > Title of the selected buff, as its tooltip shows it. - **Access:** read-only - **Type:** string - **Needs a client:** yes - **New in Reforged:** EasyUO 1.5 does not have it. - **Set by:** ScanBuffs - **Related:** ScanBuffs, #BuffCnt, #BuffIndex, #BuffBarOpen, #BuffDesc, #BuffCliloc - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/buffname/ `#BuffName` is the first line of the tooltip of the buff selected by [`#BuffIndex`](https://ilpersi.github.io/EasyUOReforged/variables/buffindex/), for example `Bless`. The text comes from the client's own cliloc table, so it is in the client's language. `~1_STR~`-style arguments are filled in, `
` becomes a space, other markup is dropped, and spaces become `_` as in every string variable, so `str pos #BuffName Bless` works. It also reads `N/A` for a buff without a title. Reads `N/A` when no buff is selected: the buff bar is closed or empty, the client's buff bar layout is not supported, or the selected buff has left the bar since the last [`ScanBuffs`](https://ilpersi.github.io/EasyUOReforged/commands/scanbuffs/) or `set #BuffIndex`. ## Example ```euo scanbuffs for %i 1 #BuffCnt { set #BuffIndex %i event sysmessage #BuffName : #BuffDesc } halt ``` --- # #BuffTime > Seconds left on the selected buff; -1 when it has no timer. - **Access:** read-only - **Type:** number - **Needs a client:** yes - **New in Reforged:** EasyUO 1.5 does not have it. - **Set by:** ScanBuffs - **Related:** ScanBuffs, #BuffCnt, #BuffIndex, #BuffBarOpen - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/bufftime/ `#BuffTime` is the number of seconds left on the buff selected by [`#BuffIndex`](https://ilpersi.github.io/EasyUOReforged/variables/buffindex/), exactly as its tooltip shows it. - `-1` means the buff has no countdown (Hiding, for example). - `0` means the client no longer knows the timer. - The client refreshes the tooltip in coarse steps, about every 5 seconds, so the value jumps rather than counting down second by second. It is read live: the variable inspector shows it counting down without a new `ScanBuffs`. Reads `N/A` when no buff is selected: the buff bar is closed or empty, the client's buff bar layout is not supported, or the selected buff has left the bar since the last [`ScanBuffs`](https://ilpersi.github.io/EasyUOReforged/commands/scanbuffs/) or `set #BuffIndex`. ## Example ```euo scanbuffs 30018 if #BuffCnt = 0 || #BuffTime < 10 display ok Time to recast Bless. halt ``` --- # #CharDir > Direction your character is facing, 0 (north) to 7. - **Access:** read-only - **Type:** number - **Needs a client:** yes - **Related:** #CharPosX, Move - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/chardir/ `#CharDir` is the direction your character is facing: | Value | Facing | Value | Facing | |---|---|---|---| | 0 | North | 4 | South | | 1 | North-east | 5 | South-west | | 2 | East | 6 | West | | 3 | South-east | 7 | North-west | ## Example ```euo if #CharDir = 0 display ok Looking north. halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #CharGhost > yes when your character is dead (a ghost), no otherwise. - **Access:** read-only - **Type:** string - **Needs a client:** yes - **Related:** #CharType, #Hits - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/charghost/ `#CharGhost` is `yes` when your character is a ghost and `no` when it is alive. It looks at the character's body, so it recognises the human and elf ghost bodies. Comparisons ignore case: `#CharGhost = YES` works. ## Example ```euo if #CharGhost = yes { display ok You are dead: the script stops here. halt } display ok You are alive. halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #CharID > ID of your character. - **Access:** read-only - **Type:** id - **Needs a client:** yes - **Related:** #BackpackID, #CharName, FindItem - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/charid/ `#CharID` is the ID of your character. It is unique, so a script can tell which character it is running on. It also works as a container for [`finditem`](https://ilpersi.github.io/EasyUOReforged/commands/finditem/): `finditem * C_ , #CharID` finds what your character is wearing. ## Example ```euo finditem * C_ , #CharID for #FindIndex 1 #FindCnt event ExMsg #FindID 3 0 worn halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #CharName > Your character’s name. - **Access:** read-only - **Type:** string - **Needs a client:** yes - **Related:** #CharID, #Shard - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/charname/ `#CharName` is your character's name. Unlike most string variables, its spaces stay spaces. It is read from your character's status, which the client only has once the status window has been opened. If it reads `N/A`, open the status window once, by hand or with `event Macro 8 2`. ## Example ```euo display ok My name is #CharName halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #CharPosX > Your character’s X position in the world (west–east). - **Access:** read-only - **Type:** number - **Needs a client:** yes - **Related:** #CharPosY, #CharPosZ, event PathFind, Move - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/charposx/ `#CharPosX` is your character's X coordinate in the world, the west–east position, in the same coordinates as map tools such as UO Auto Map use. [`#CharPosZ`](https://ilpersi.github.io/EasyUOReforged/variables/charposz/) is the height. ## Example ```euo if #CharPosX = 4515 display ok X marks the spot! halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #CharPosY > Your character’s Y position in the world (north–south). - **Access:** read-only - **Type:** number - **Needs a client:** yes - **Related:** #CharPosX, #CharPosZ, event PathFind, Move - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/charposy/ `#CharPosY` is your character's Y coordinate in the world, the north–south position, in the same coordinates as map tools such as UO Auto Map use. [`#CharPosZ`](https://ilpersi.github.io/EasyUOReforged/variables/charposz/) is the height. ## Example ```euo if #CharPosY = 4515 display ok X marks the spot! halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #CharPosZ > Your character’s height (Z coordinate). - **Access:** read-only - **Type:** number - **Needs a client:** yes - **Related:** #CharPosX, #CharPosY - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/charposz/ `#CharPosZ` is your character's height in the world, the Z coordinate. Ground level is usually around 0; upper floors and hills are higher. ## Example ```euo if #CharPosZ > 20 display ok You are upstairs. halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #CharStatus > Letters for your character’s states: frozen, female, flying or poisoned, yellow health bar, war mode, hidden. - **Access:** read-only - **Type:** string - **Needs a client:** yes - **Related:** #CharGhost, event Macro - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/charstatus/ `#CharStatus` is a short string of letters, one for each state your character is in, or empty when none applies. Test a letter with `in`: | Letter | State | |---|---| | `A` | Frozen: paralysed, held in place by the server, or casting a spell that stops you moving. The client won't let you walk. | | `B` | Female. | | `C` | Flying (a gargoyle in flight), or poisoned: see [Poison](#poison). | | `D` | Yellow health bar: for example when you are hit by a lethal strike, or when you are invulnerable. | | `E` | You can walk through other characters. | | `G` | War mode. | | `H` | Hidden. | Each letter is one of the status flags the server sends for your character: `A` for the first, `B` for the second, and so on up to `H`. No other letter appears. `F` is a flag the client only uses for items, and servers don't set it on a character. The letters after `H` would come from the next byte in the client's memory, which for a character is always 0. The letters are in reverse order: war mode and female read `GB`. ## Poison On current clients the server doesn't send poison as a status flag. It sends poison and the yellow health bar as two separate health-bar states, and `#CharStatus` adds `C` when exactly one of the two is on: | You are | `C` | |---|---| | Poisoned | yes | | Poisoned, with a yellow health bar | no | | Not poisoned, with a yellow health bar | yes | The yellow bar always comes with `D`, so you are poisoned when you have `C` without `D`, or `D` without `C`. Flying also sets `C`, so for a gargoyle this only holds while it is on the ground. ## Example ```euo set %poisoned #false if C in #CharStatus set %poisoned #true if D in #CharStatus ; a yellow bar reverses what C says set %poisoned ! %poisoned if %poisoned display ok You are poisoned. if H notin #CharStatus event macro 13 21 ; use Hiding halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #CharType > Body type of your character, as a Sys26 type. - **Access:** read-only - **Type:** id - **Needs a client:** yes - **Related:** #CharID, #FindType - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/chartype/ `#CharType` is your character's body type: the graphic the client draws for it, in the same Sys26 form as [`#FindType`](https://ilpersi.github.io/EasyUOReforged/variables/findtype/). It changes when the body does, for example when you polymorph or turn into a ghost. ## Example ```euo set %normal #CharType wait 10s ; change form in the meantime if #CharType <> %normal display ok Your body changed. halt ``` --- # #CliCnt > Number of supported UO clients running. - **Access:** read-only - **Type:** number - **Needs a client:** no - **Related:** #CliNr, UOXL - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/clicnt/ `#CliCnt` is the number of supported UO clients running, the ones EasyUO Reforged can attach to. Clients of an unsupported version, or that cannot be opened (for example because they run as administrator and EasyUO Reforged does not), are not counted. ## Example ```euo for %i 1 #CliCnt { msg hello$ uoxl swap } halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #CliLang > Language code of the client, such as ENU. - **Access:** read-only - **Type:** string - **Needs a client:** yes - **Related:** #CliVer - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/clilang/ `#CliLang` is the three-letter language code of the attached client, for example `ENU` for English. It is empty when the client does not report one. Texts such as [`#BuffName`](https://ilpersi.github.io/EasyUOReforged/variables/buffname/) and journal lines are in this language, so a shared script can check it before comparing text. ## Example ```euo if #CliLang <> ENU display ok This script expects an English client. halt ``` --- # #CliLeft > X position of the game area inside the client window; set it to move the game area. - **Access:** read / write - **Type:** number - **Needs a client:** yes - **Related:** #CliTop, #CliXRes, #CliYRes - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/clileft/ `#CliLeft` is the X position of the game area (where the world is drawn) inside the client window, in pixels. Setting it moves the game area. The value lives in the client: setting it changes it for every script attached to that client. ## Example ```euo set #CliLeft 0 set #CliTop 0 ; game area in the top-left corner halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #CliLogged > 1 when a character is logged in, 0 at the login screens. - **Access:** read-only - **Type:** boolean - **Needs a client:** yes - **Related:** #CliVer, #CharName - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/clilogged/ `#CliLogged` is `1` when a character is logged into the game and `0` while the client is at the login screens. ## Example ```euo if #CliLogged = 0 display ok Log in first. halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #CliNr > Which of the running clients the script drives, counting from 1. - **Access:** read-only - **Type:** number - **Needs a client:** no - **Related:** #CliCnt, UOXL - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/clinr/ `#CliNr` is the number of the client the script drives, from `1` to [`#CliCnt`](https://ilpersi.github.io/EasyUOReforged/variables/clicnt/), or `0` when none is attached. Switch with [`uoxl swap`](https://ilpersi.github.io/EasyUOReforged/commands/uoxl/) or *Tools → Swap To Next Client*; `#CliNr` itself cannot be set. ## Example ```euo display ok This is client #CliNr of #CliCnt halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #CliTitle > Title of the client window; set it to rename the window. - **Access:** read / write - **Type:** string - **Needs a client:** yes - **Related:** SetUOTitle, GetUOTitle, #CliNr - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/clititle/ `#CliTitle` is the title of the attached client's window. Setting it changes the title, which helps tell several clients apart. `set #CliTitle` and [`SetUOTitle`](https://ilpersi.github.io/EasyUOReforged/commands/setuotitle/) both rename the window; reading `#CliTitle` gives the same text as [`GetUOTitle`](https://ilpersi.github.io/EasyUOReforged/commands/getuotitle/) without a separate command. ## Example ```euo set #CliTitle #CharName halt ``` The value is used as it is: an `_` stays an `_` in the title. --- # #CliTop > Y position of the game area inside the client window; set it to move the game area. - **Access:** read / write - **Type:** number - **Needs a client:** yes - **Related:** #CliLeft, #CliXRes, #CliYRes - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/clitop/ `#CliTop` is the Y position of the game area (where the world is drawn) inside the client window, in pixels. Setting it moves the game area. The value lives in the client: setting it changes it for every script attached to that client. ## Example ```euo set #CliLeft 0 set #CliTop 0 ; game area in the top-left corner halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #CliVer > Version of the attached client, such as 7.0.117.1. - **Access:** read-only - **Type:** string - **Needs a client:** yes - **Related:** #CliLang, #EUOVer - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/cliver/ `#CliVer` is the version of the attached client, as EasyUO Reforged recognised it, for example `7.0.117.1`. ## Example ```euo if #CliVer <> 7.0.117.1 display ok This script was written for 7.0.117.1. halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #CliXRes > Width of the game area in pixels; set it to resize the game area. - **Access:** read / write - **Type:** number - **Needs a client:** yes - **Related:** #CliYRes, #CliLeft, #CliTop - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/clixres/ `#CliXRes` is the width of the game area (where the world is drawn), in pixels. Setting it resizes the game area. The value lives in the client: setting it changes it for every script attached to that client. ## Example ```euo set #CliXRes 800 set #CliYRes 600 halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #CliYRes > Height of the game area in pixels; set it to resize the game area. - **Access:** read / write - **Type:** number - **Needs a client:** yes - **Related:** #CliXRes, #CliLeft, #CliTop - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/cliyres/ `#CliYRes` is the height of the game area (where the world is drawn), in pixels. Setting it resizes the game area. The value lives in the client: setting it changes it for every script attached to that client. ## Example ```euo set #CliXRes 800 set #CliYRes 600 halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #ContHP > Health in percent of the creature whose health bar is the top gump. - **Access:** read-only - **Type:** number - **Needs a client:** yes - **Related:** #ContName, #EnemyHits - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/conthp/ When the gump on top is a health bar (the client calls it `status gump`), `#ContHP` is that creature's health as a percentage, `0` to `100`. For any other gump it is `0`. ## Example ```euo ; drag a pet's health bar out first, then click it so it is on top if #ContName = status_gump && #ContHP < 50 display ok Your pet is below half health. halt ``` --- # #ContID > ID of the item a container gump on top belongs to. - **Access:** read-only - **Type:** id - **Needs a client:** yes - **Related:** #ContType, #ContName, FindItem - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/contid/ `#ContID` is the ID of the item the gump on top belongs to: for a container gump, the container itself, so you can search it with [`finditem`](https://ilpersi.github.io/EasyUOReforged/commands/finditem/). For a gump that belongs to no item, such as a crafting menu, it reads `YC`, the code for 0. Like all `#Cont…` variables, it describes the gump on top: the one opened, clicked or moved last. Gumps on the [`IgnoreCont`](https://ilpersi.github.io/EasyUOReforged/commands/ignorecont/) list are skipped. ## Example ```euo ; search whatever container was opened last finditem * C_ , #ContID display ok #FindCnt items in it halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #ContKind > Kind of the gump on top, as a code; tells crafting menus, runebooks and more apart. - **Access:** read-only - **Type:** id - **Needs a client:** yes - **Related:** #ContName, IgnoreCont - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/contkind/ `#ContKind` is a short code for the kind of the gump on top. Most gumps have one, so it tells whether a crafting menu, a runebook or something else is open. Like all `#Cont…` variables, it describes the gump on top: the one opened, clicked or moved last. Gumps on the [`IgnoreCont`](https://ilpersi.github.io/EasyUOReforged/commands/ignorecont/) list are skipped. The codes can change when the client is updated. Keep them in variables at the top of your script, so they are easy to change. [`IgnoreCont`](https://ilpersi.github.io/EasyUOReforged/commands/ignorecont/) accepts a `#ContKind` value to skip that kind of gump. ## Example ```euo set %craftmenu GHCE ; the crafting menu's #ContKind on your client if #ContKind <> %craftmenu display ok Open the crafting menu first. halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #ContName > Name of the gump on top, such as container_gump or paperdoll_gump. - **Access:** read-only - **Type:** string - **Needs a client:** yes - **Related:** #ContKind, #ContID, IgnoreCont - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/contname/ `#ContName` is the client's internal name for the gump on top. Spaces in the name read as `_`. Like all `#Cont…` variables, it describes the gump on top: the one opened, clicked or moved last. Gumps on the [`IgnoreCont`](https://ilpersi.github.io/EasyUOReforged/commands/ignorecont/) list are skipped. Some names seen so far (shards can add their own): | Name | Gump | |---|---| | `container_gump` | Any container: backpack, bag, chest, corpse. | | `paperdoll_gump` | A paperdoll. | | `status_gump` | Your status window, or a health bar (see [`#ContHP`](https://ilpersi.github.io/EasyUOReforged/variables/conthp/)). | | `skill_gump` | The skills list. | | `generic_gump` | Server gumps: crafting menus, runebooks, the help menu. | | `stack_gump` | The amount prompt when you drag part of a stack. | | `drag_gump` | Something hanging on the cursor. | | `text_gump` | The journal. | | `YesNo_gump` | A yes/no question, such as the logout confirmation. | | `OptionsGump` | The options window. | | `normal_gump` | The chat window and the shard list. | | `MainMenu_gump`, `login_gump`, `waiting_gump` | Login screens and messages. | ## Example ```euo if #ContName = container_gump display ok A container is on top. halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #ContPosX > X position of the gump on top; set it to move the gump. - **Access:** read / write - **Type:** number - **Needs a client:** yes - **Related:** #ContPosY, ContPos, #ContSize - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/contposx/ `#ContPosX` is the X position of the gump on top, in pixels from the left edge of the client window. Setting it moves the gump; [`contpos`](https://ilpersi.github.io/EasyUOReforged/commands/contpos/) sets both positions at once. Like all `#Cont…` variables, it describes the gump on top: the one opened, clicked or moved last. Gumps on the [`IgnoreCont`](https://ilpersi.github.io/EasyUOReforged/commands/ignorecont/) list are skipped. ## Example ```euo set #ContPosX 10 set #ContPosY 10 ; move the gump to the top-left corner halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #ContPosY > Y position of the gump on top; set it to move the gump. - **Access:** read / write - **Type:** number - **Needs a client:** yes - **Related:** #ContPosX, ContPos, #ContSize - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/contposy/ `#ContPosY` is the Y position of the gump on top, in pixels from the top edge of the client window. Setting it moves the gump; [`contpos`](https://ilpersi.github.io/EasyUOReforged/commands/contpos/) sets both positions at once. Like all `#Cont…` variables, it describes the gump on top: the one opened, clicked or moved last. Gumps on the [`IgnoreCont`](https://ilpersi.github.io/EasyUOReforged/commands/ignorecont/) list are skipped. ## Example ```euo set #ContPosY 10 set #ContPosX 10 ; move the gump to the top-left corner halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #ContSize > Width and height of the gump on top, as width_height. - **Access:** read-only - **Type:** string - **Needs a client:** yes - **Related:** #ContSizeX, #ContSizeY, #ContName - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/contsize/ `#ContSize` is the size of the gump on top, in pixels, written `width_height`, for example `230_204`. The size often tells gumps apart that share a name. [`#ContSizeX`](https://ilpersi.github.io/EasyUOReforged/variables/contsizex/) and [`#ContSizeY`](https://ilpersi.github.io/EasyUOReforged/variables/contsizey/) give the two numbers separately. Like all `#Cont…` variables, it describes the gump on top: the one opened, clicked or moved last. Gumps on the [`IgnoreCont`](https://ilpersi.github.io/EasyUOReforged/commands/ignorecont/) list are skipped. ## Example ```euo if #ContSize = 230_204 display ok The gump on top is 230 by 204 pixels. halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #ContSizeX > Width of the top gump in pixels. - **Access:** read-only - **Type:** number - **Needs a client:** yes - **Related:** #ContSizeY, #ContSize, #ContPosX, IgnoreCont - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/contsizex/ `#ContSizeX` is the width, in pixels, of the gump on top (the last one opened or clicked). It is the first half of [`#ContSize`](https://ilpersi.github.io/EasyUOReforged/variables/contsize/) as a plain number, so you can calculate with it without splitting the `x_y` text. Gumps on the ignore list (see [`IgnoreCont`](https://ilpersi.github.io/EasyUOReforged/commands/ignorecont/)) are skipped. ## Example ```euo ; click the bottom-right corner of the top gump set %x #ContPosX + #ContSizeX - 10 set %y #ContPosY + #ContSizeY - 10 click %x %y halt ``` --- # #ContSizeY > Height of the top gump in pixels. - **Access:** read-only - **Type:** number - **Needs a client:** yes - **Related:** #ContSizeX, #ContSize, #ContPosY, IgnoreCont - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/contsizey/ `#ContSizeY` is the height, in pixels, of the gump on top. It is the second half of [`#ContSize`](https://ilpersi.github.io/EasyUOReforged/variables/contsize/) as a plain number. See [`#ContSizeX`](https://ilpersi.github.io/EasyUOReforged/variables/contsizex/) for an example. --- # #ContType > Type of the item a container gump on top belongs to. - **Access:** read-only - **Type:** id - **Needs a client:** yes - **Related:** #ContID, #FindType - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/conttype/ `#ContType` is the item type of the container the gump on top belongs to, in the same form as [`#FindType`](https://ilpersi.github.io/EasyUOReforged/variables/findtype/). It reads `YC` for a gump that belongs to no item. Like all `#Cont…` variables, it describes the gump on top: the one opened, clicked or moved last. Gumps on the [`IgnoreCont`](https://ilpersi.github.io/EasyUOReforged/commands/ignorecont/) list are skipped. ## Example ```euo if #ContType = ZJF ; a backpack display ok A backpack is on top. halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #CR > Your character’s cold resistance. - **Access:** read-only - **Type:** number - **Needs a client:** yes - **Related:** #AR, #FR, #PR, #ER - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/cr/ `#CR` is your character's cold resistance. It is read from your character's status, which the client only has once the status window has been opened. If it reads `N/A`, open the status window once, by hand or with `event Macro 8 2`. It also needs a client with the extended status of Age of Shadows and later; on older clients it reads `N/A`. ## Example ```euo display ok My cold resist is #CR halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #CurPath > Folder of EasyUOReforged.exe, ending with a backslash. - **Access:** read-only - **Type:** string - **Needs a client:** no - **Related:** Call, sql open - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/curpath/ `#CurPath` is the folder `EasyUOReforged.exe` was started from, ending with `\`, for example `C:\Games\EasyUO\`. Relative paths in [`call`](https://ilpersi.github.io/EasyUOReforged/commands/call/) and [`sql open`](https://ilpersi.github.io/EasyUOReforged/commands/sql/open/) start from this folder. ## Example ```euo display ok EasyUO Reforged was started from #CurPath call #CurPath , healing.euo halt ``` `healing.euo`, in that folder: ```euo title="healing.euo" display ok healing.euo runs. exit ``` --- # #CursKind > Facet you are on: 0 Felucca, 1 Trammel, 2 Ilshenar, 3 Malas, 4 Tokuno, 5 Ter Mur. - **Access:** read-only - **Type:** number - **Needs a client:** yes - **Related:** Tile, #CharPosX - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/curskind/ `#CursKind` is the facet your character is on: | Value | Facet | |---|---| | 0 | Felucca | | 1 | Trammel | | 2 | Ilshenar | | 3 | Malas | | 4 | Tokuno | | 5 | Ter Mur | [`tile`](https://ilpersi.github.io/EasyUOReforged/commands/tile/) uses the same numbers. ## Example ```euo if #CursKind = 0 display ok Careful - this is Felucca. halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #CursorX > Mouse cursor X position relative to the game area. - **Access:** read-only - **Type:** number - **Needs a client:** yes - **Related:** #CursorY, Click, SavePix - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/cursorx/ `#CursorX` is the horizontal position of the mouse cursor, in pixels from the left edge of the game area; to its left the value is negative. [`#CursorY`](https://ilpersi.github.io/EasyUOReforged/variables/cursory/) is the vertical position. ## Example ```euo savepix #CursorX #CursorY 1 display ok The mouse is at #CursorX #CursorY halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #CursorY > Mouse cursor Y position relative to the game area. - **Access:** read-only - **Type:** number - **Needs a client:** yes - **Related:** #CursorX, Click - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/cursory/ `#CursorY` is the vertical position of the mouse cursor, in pixels from the top edge of the game area; above it the value is negative. [`#CursorX`](https://ilpersi.github.io/EasyUOReforged/variables/cursorx/) is the horizontal position. *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #Date > Local date of the computer as yymmdd. - **Access:** read-only - **Type:** string - **Needs a client:** no - **Related:** #Time, #SysTime - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/date/ `#Date` is the computer's local date, written `yymmdd`: `261225` is 25 December 2026. ## Example ```euo str right #Date 4 if #StrRes = 1225 display ok Merry Christmas! halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #Dex > Your character’s dexterity. - **Access:** read-only - **Type:** number - **Needs a client:** yes - **Related:** #Str, #Int, #MaxStats - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/dex/ `#Dex` is your character's dexterity. It is read from your character's status, which the client only has once the status window has been opened. If it reads `N/A`, open the status window once, by hand or with `event Macro 8 2`. ## Example ```euo display ok My dexterity is #Dex halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #DispRes > Button the user pressed in the last display box: Ok, Yes, No or Cancel. - **Access:** read-only - **Type:** string - **Needs a client:** no - **Set by:** Display - **Related:** Display - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/dispres/ `#DispRes` is the button pressed in the last [`display`](https://ilpersi.github.io/EasyUOReforged/commands/display/) message box: `Ok`, `Yes`, `No` or `Cancel`. Comparisons ignore case. ## Example ```euo display yesno Continue? if #DispRes = no halt display ok Going on. halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #DOT > A full stop, which could not be typed alone because . joins words. - **Access:** read-only - **Type:** string - **Needs a client:** no - **Related:** #SPC, #SMC - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/dot/ `#DOT` is a full stop (`.`). A lone `.` in a line glues the words on either side together, so use `#DOT` when the text needs a separate full stop. ## Example ```euo set %file mylog , #DOT , txt ; mylog.txt display ok %file halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #EnemyHits > Health in percent of the enemy in #EnemyID. - **Access:** read-only - **Type:** number - **Needs a client:** yes - **Changed in Reforged:** see "Reforged notes" below. - **Related:** #EnemyID, #ContHP - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/enemyhits/ `#EnemyHits` is the health of the enemy in [`#EnemyID`](https://ilpersi.github.io/EasyUOReforged/variables/enemyid/), in percent: `100` is full health. It reads `N/A` when the client shows no enemy health bar. The shard decides how fine the steps are. Shards that send enemy health out of 25 (RunUO and those based on it) move it in steps of 4; ModernUO sends it out of 100, so it moves by 1. ## Example ```euo if #EnemyHits < 20 display ok Almost dead! halt ``` ## Reforged notes - EasyUO multiplies the client's number by 4, which gives a percentage only on shards that send health out of 25. On ModernUO shards it read up to 400. Reforged divides by the maximum the shard sent, so it reads a percentage on every shard, and the same numbers as EasyUO on shards that count out of 25. - On `client_beta.exe` 7.0.117.31 it used to read `N/A` in combat, or the maximum after you selected a mobile with the targeting macros. It now reads the health bar the client opens for the enemy you attack, as on the other clients. *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #EnemyID > ID of the enemy whose health bar the client shows, or N/A. - **Access:** read-only - **Type:** id - **Needs a client:** yes - **Related:** #EnemyHits, event StatBar - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/enemyid/ `#EnemyID` is the ID of the enemy the client shows a health bar for, usually the one you are fighting, or `N/A` when there is none. With more than one enemy, it shows whichever the client currently tracks, which can change from moment to moment. ## Example ```euo if #EnemyID <> N/A display ok You are fighting! The enemy has #EnemyHits percent health. halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #ER > Your character’s energy resistance. - **Access:** read-only - **Type:** number - **Needs a client:** yes - **Related:** #AR, #FR, #CR, #PR - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/er/ `#ER` is your character's energy resistance. It is read from your character's status, which the client only has once the status window has been opened. If it reads `N/A`, open the status window once, by hand or with `event Macro 8 2`. It also needs a client with the extended status of Age of Shadows and later; on older clients it reads `N/A`. ## Example ```euo display ok My energy resist is #ER halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #EUOVer > Always 1_50_00, the EasyUO version Reforged is ported from; see #ReforgedVer. - **Access:** read-only - **Type:** string - **Needs a client:** no - **Related:** #ReforgedVer - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/euover/ `#EUOVer` is the version of EasyUO, written `major_minor_build`. EasyUO Reforged always returns `1_50_00`, the version it is ported from, so scripts that check for EasyUO 1.5 keep working. To tell EasyUO Reforged apart, or one build from another, use [`#ReforgedVer`](https://ilpersi.github.io/EasyUOReforged/variables/reforgedver/). ## Example ```euo str left #EUOVer 4 if #StrRes <> 1_50 display ok This script needs EasyUO 1.5. halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #False > The value false: 0. - **Access:** read-only - **Type:** boolean - **Needs a client:** no - **Related:** #True, If - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/false/ `#False` is `0`, the value comparisons give when they are false. See [`#True` and `#False`](https://ilpersi.github.io/EasyUOReforged/guides/true-and-false/). ## Example ```euo set %done #False set %round 0 while %done = #False { set %round %round + 1 if %round = 3 set %done #True } display ok Done after %round rounds. halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #FindBagID > ID of the container holding the object FindItem selected. - **Access:** read-only - **Type:** id - **Needs a client:** yes - **Set by:** FindItem - **Related:** #FindKind, #ContID - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/findbagid/ `#FindBagID` is the ID of the container the object is in. It describes the object [`FindItem`](https://ilpersi.github.io/EasyUOReforged/commands/finditem/) selected, at the current [`#FindIndex`](https://ilpersi.github.io/EasyUOReforged/variables/findindex/). It reads `X` for objects on the ground. ## Example ```euo finditem POF C if #FindCnt > 0 display ok Gold found in container #FindBagID halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #FindCnt > How many objects the last FindItem found. - **Access:** read-only - **Type:** number - **Needs a client:** yes - **Set by:** FindItem - **Related:** FindItem, #FindIndex, #FindKind - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/findcnt/ `#FindCnt` is the number of objects the last [`FindItem`](https://ilpersi.github.io/EasyUOReforged/commands/finditem/) found; `0` means none. It is the way to check whether a search found anything, and the upper bound for [`#FindIndex`](https://ilpersi.github.io/EasyUOReforged/variables/findindex/). ## Example ```euo finditem * C_ , #BackpackID if #FindCnt > 0 display ok There are #FindCnt items in your backpack. halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #FindCol > Colour (hue) of the object FindItem selected. - **Access:** read-only - **Type:** number - **Needs a client:** yes - **Set by:** FindItem - **Related:** FindItem, #FindType - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/findcol/ `#FindCol` is the colour (hue) number of the object. It describes the object [`FindItem`](https://ilpersi.github.io/EasyUOReforged/commands/finditem/) selected, at the current [`#FindIndex`](https://ilpersi.github.io/EasyUOReforged/variables/findindex/). `0` is the item's normal colour. It tells apart items of the same type that differ only in colour, such as dyed cloth or coloured ore. ## Example ```euo set %ore DWJ_EWJ_GWJ_TVJ finditem %ore C_ , #BackpackID if #FindCol = 0 display ok Plain iron ore. halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #FindDist > Distance in tiles to the object FindItem selected, for objects on the ground. - **Access:** read-only - **Type:** number - **Needs a client:** yes - **Set by:** FindItem - **Related:** #FindX, #FindKind, FindItem - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/finddist/ `#FindDist` is how many tiles away the object is: the larger of the X and Y distance, the way UO measures range. It describes the object [`FindItem`](https://ilpersi.github.io/EasyUOReforged/commands/finditem/) selected, at the current [`#FindIndex`](https://ilpersi.github.io/EasyUOReforged/variables/findindex/). It is worked out from your position when you read it, so it changes as you walk. It reads `N/A` for an object in a container, and when nothing was found. ## Example ```euo finditem POF G_15 if #FindCnt > 0 display ok Gold #FindDist tiles away. halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #FindID > ID of the object FindItem selected, or X when nothing was found. - **Access:** read-only - **Type:** id - **Needs a client:** yes - **Set by:** FindItem - **Related:** #FindType, #FindCnt, #FindIndex, #FindKind - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/findid/ `#FindID` holds the ID of the object at the current [`#FindIndex`](https://ilpersi.github.io/EasyUOReforged/variables/findindex/) position of the last [`FindItem`](https://ilpersi.github.io/EasyUOReforged/commands/finditem/) search: the unique 6–8 letter ID of that one item or character, not its type. Use it to act on the object: drag it, use it, target it. When the search found nothing, `#FindID` reads `X`. Check `#FindCnt > 0` (or `#FindKind <> -1`) before you use it. ## Example ```euo finditem POF C_ , #BackpackID if #FindCnt > 0 msg #FindID is the ID of the gold in my bag. There is #FindStack gold in that stack.$ halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #FindIndex > Selects which FindItem match the #Find… variables describe, without searching again. - **Access:** read / write - **Type:** number - **Needs a client:** yes - **Set by:** FindItem - **Related:** #FindCnt, #FindID, IgnoreItem - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/findindex/ [`FindItem`](https://ilpersi.github.io/EasyUOReforged/commands/finditem/) selects one match (the first, unless you pass an index) and keeps the rest of its snapshot. Setting `#FindIndex` selects another match from that snapshot and refreshes every `#Find…` variable, without running the slow search again. Valid values go from `1` to `#FindCnt`. Reading it gives the position of the match currently selected. ## Examples Ignore every item of one type in the backpack: ```euo finditem %TypeToIgnore C_ , #BackpackID ignoreAgain: if #FindIndex <= #FindCnt { ignoreitem #FindID set #FindIndex #FindIndex + 1 goto ignoreAgain } halt ``` `#FindIndex` also works as a `for` counter. This lists the properties of everything worn by the character in the journal: ```euo finditem * C_ , #CharID for #FindIndex 1 #FindCnt { event property #FindID event sysmessage #Property wait 20 } halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #FindKind > Where the object FindItem selected is: 0 in a container, 1 on the ground, -1 not found. - **Access:** read-only - **Type:** number - **Needs a client:** yes - **Set by:** FindItem - **Related:** #FindCnt, #FindX, #FindBagID - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/findkind/ `#FindKind` tells where the object is. It describes the object [`FindItem`](https://ilpersi.github.io/EasyUOReforged/commands/finditem/) selected, at the current [`#FindIndex`](https://ilpersi.github.io/EasyUOReforged/variables/findindex/). | Value | Meaning | |---|---| | `-1` | Nothing was found. | | `0` | In a container. | | `1` | On the ground. | To test whether something was found, [`#FindCnt`](https://ilpersi.github.io/EasyUOReforged/variables/findcnt/) is clearer to read. ## Example ```euo finditem POF if #FindKind = 1 display ok There is gold on the ground. halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #FindLayer > Layer a character wears the object FindItem selected in, or N/A when nobody wears it. - **Access:** read-only - **Type:** number - **Needs a client:** yes - **New in Reforged:** EasyUO 1.5 does not have it. - **Set by:** FindItem - **Related:** FindItem, #FindBagID, #FindKind, #MountID - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/findlayer/ `#FindLayer` is the layer, in decimal, in which a character wears the object [`FindItem`](https://ilpersi.github.io/EasyUOReforged/commands/finditem/) selected at the current [`#FindIndex`](https://ilpersi.github.io/EasyUOReforged/variables/findindex/). [`#FindBagID`](https://ilpersi.github.io/EasyUOReforged/variables/findbagid/) is then the ID of the character wearing it. It reads `N/A` when the object isn't worn (it lies in a container or on the ground), when nothing was found, and without a client. FindItem finds worn objects by the same rules as objects in containers: other characters' equipment, for one, only with its `A` filter (see FindItem's notes). ## Layers The shard decides which layer an object goes in, by the same numbers on every shard: | Layer | Slot | Layer | Slot | |---|---|---|---| | 1 | one-handed weapon | 16 | facial hair | | 2 | two-handed weapon or shield | 17 | middle torso (tunic, surcoat, sash) | | 3 | shoes | 18 | earrings | | 4 | pants | 19 | arms | | 5 | shirt | 20 | cloak | | 6 | helm or hat | 21 | backpack | | 7 | gloves | 22 | outer torso (robe) | | 8 | ring | 23 | outer legs (skirt, kilt) | | 9 | talisman | 24 | inner legs (leg armour) | | 10 | necklace | 25 | mount | | 11 | hair | 26 | a vendor's stock to buy | | 12 | waist (half apron) | 27 | a vendor's stock to resell | | 13 | inner torso (chest armour) | 28 | a vendor's stock to sell | | 14 | bracelet | 29 | bank box | | 15 | face | | | ## Example ```euo ; the backpack type: is the one found worn, or inside another bag? finditem ZJF if #FindCnt > 0 { if #FindLayer = 21 display ok #FindID is a backpack worn by #FindBagID else display ok #FindID is not worn ( #FindLayer ) } halt ``` --- # #FindMod > Offset added to #FindX and #FindY for objects in containers, written x_y. - **Access:** read / write - **Type:** string - **Needs a client:** yes - **Related:** #FindX, #FindY - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/findmod/ `#FindMod` is an offset added to [`#FindX`](https://ilpersi.github.io/EasyUOReforged/variables/findx/) and [`#FindY`](https://ilpersi.github.io/EasyUOReforged/variables/findy/) for objects in containers, written `x_y`, for example `140_220`. It is `0_0` until you set it. Use it to click a fixed spot relative to an item, such as the backpack icon on a paperdoll. ## Example ```euo set %something ABCDEFG ; the ID of the item to put away set #FindMod 140_220 ; from the paperdoll to its backpack icon finditem #BackpackID C_ , #CharID event Drag %something wait 2s click #FindX #FindY p ; drop it on the backpack icon halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #FindRep > Notoriety of the character FindItem selected: 1 innocent to 7 invulnerable. - **Access:** read-only - **Type:** number - **Needs a client:** yes - **Set by:** FindItem - **Related:** FindItem, #EnemyID - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/findrep/ `#FindRep` is the notoriety (name colour) of the character. It describes the object [`FindItem`](https://ilpersi.github.io/EasyUOReforged/commands/finditem/) selected, at the current [`#FindIndex`](https://ilpersi.github.io/EasyUOReforged/variables/findindex/). | Value | Notoriety | |---|---| | 1 | Innocent (blue) | | 2 | Friend, ally (green) | | 3 | Attackable without penalty, such as animals (grey) | | 4 | Criminal (grey) | | 5 | Enemy (orange) | | 6 | Murderer (red) | | 7 | Invulnerable (yellow) | ## Example ```euo finditem HS_IS G_10 if #FindRep = 6 display ok A murderer is near! halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #FindStack > Number of items in the stack FindItem selected; 0 for characters. - **Access:** read-only - **Type:** number - **Needs a client:** yes - **Set by:** FindItem - **Related:** #FindID, exevent Drag - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/findstack/ `#FindStack` is the number of items in the stack. It describes the object [`FindItem`](https://ilpersi.github.io/EasyUOReforged/commands/finditem/) selected, at the current [`#FindIndex`](https://ilpersi.github.io/EasyUOReforged/variables/findindex/). Characters (mobiles) read `0`, which is a quick way to tell them from items. ## Example ```euo finditem POF C_ , #BackpackID if #FindCnt > 0 display ok That pile holds #FindStack gold. halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #FindType > Type of the object FindItem selected. - **Access:** read-only - **Type:** id - **Needs a client:** yes - **Set by:** FindItem - **Related:** #FindID, FindItem - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/findtype/ `#FindType` is the item type of the object, the 2–3 letter code shared by all items of the same kind (`POF` for gold). It describes the object [`FindItem`](https://ilpersi.github.io/EasyUOReforged/commands/finditem/) selected, at the current [`#FindIndex`](https://ilpersi.github.io/EasyUOReforged/variables/findindex/). It reads `X` when nothing was found. ## Example ```euo finditem * C_ , #BackpackID for #FindIndex 1 #FindCnt event SysMessage #FindID is of type #FindType halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #FindX > X position of the object FindItem selected: world position on the ground, screen position in a container. - **Access:** read-only - **Type:** number - **Needs a client:** yes - **Set by:** FindItem - **Related:** #FindY, #FindZ, #FindKind, #FindMod - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/findx/ `#FindX` is the X position of the object. It describes the object [`FindItem`](https://ilpersi.github.io/EasyUOReforged/commands/finditem/) selected, at the current [`#FindIndex`](https://ilpersi.github.io/EasyUOReforged/variables/findindex/). - For an object **on the ground** ([`#FindKind`](https://ilpersi.github.io/EasyUOReforged/variables/findkind/) `1`), it is a world position, like [`#CharPosX`](https://ilpersi.github.io/EasyUOReforged/variables/charposx/). - For an object **in a container** (`#FindKind` `0`), it is its position on screen inside the container, where you would click it. [`#FindMod`](https://ilpersi.github.io/EasyUOReforged/variables/findmod/) is added to it. ## Example ```euo set %target POF ; gold finditem %target G_10 if #FindCnt > 0 event PathFind #FindX #FindY #FindZ halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #FindY > Y position of the object FindItem selected: world position on the ground, screen position in a container. - **Access:** read-only - **Type:** number - **Needs a client:** yes - **Set by:** FindItem - **Related:** #FindX, #FindZ, #FindKind, #FindMod - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/findy/ `#FindY` is the Y position of the object. It describes the object [`FindItem`](https://ilpersi.github.io/EasyUOReforged/commands/finditem/) selected, at the current [`#FindIndex`](https://ilpersi.github.io/EasyUOReforged/variables/findindex/). - For an object **on the ground** ([`#FindKind`](https://ilpersi.github.io/EasyUOReforged/variables/findkind/) `1`), it is a world position, like [`#CharPosY`](https://ilpersi.github.io/EasyUOReforged/variables/charposy/). - For an object **in a container** (`#FindKind` `0`), it is its position on screen inside the container, where you would click it. [`#FindMod`](https://ilpersi.github.io/EasyUOReforged/variables/findmod/) is added to it. ## Example ```euo set %target POF ; gold finditem %target G_10 if #FindCnt > 0 event PathFind #FindX #FindY #FindZ halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #FindZ > Height of the object FindItem selected. - **Access:** read-only - **Type:** number - **Needs a client:** yes - **Set by:** FindItem - **Related:** #FindX, #FindY - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/findz/ `#FindZ` is the height (Z position) of the object, for an object on the ground. It describes the object [`FindItem`](https://ilpersi.github.io/EasyUOReforged/commands/finditem/) selected, at the current [`#FindIndex`](https://ilpersi.github.io/EasyUOReforged/variables/findindex/). *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #Followers > How many follower slots your pets and summons use. - **Access:** read-only - **Type:** number - **Needs a client:** yes - **Related:** #MaxFol - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/followers/ `#Followers` is how many follower slots your pets and summons use now; [`#MaxFol`](https://ilpersi.github.io/EasyUOReforged/variables/maxfol/) is how many you have. It is read from your character's status, which the client only has once the status window has been opened. If it reads `N/A`, open the status window once, by hand or with `event Macro 8 2`. It also needs a client with the extended status of Age of Shadows and later; on older clients it reads `N/A`. ## Example ```euo if #Followers < #MaxFol display ok Room for another pet. halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #FR > Your character’s fire resistance. - **Access:** read-only - **Type:** number - **Needs a client:** yes - **Related:** #AR, #CR, #PR, #ER - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/fr/ `#FR` is your character's fire resistance. It is read from your character's status, which the client only has once the status window has been opened. If it reads `N/A`, open the status window once, by hand or with `event Macro 8 2`. It also needs a client with the extended status of Age of Shadows and later; on older clients it reads `N/A`. ## Example ```euo display ok My fire resist is #FR halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #Gold > Gold your character carries, as the status window shows it. - **Access:** read-only - **Type:** number - **Needs a client:** yes - **Related:** #Weight, FindItem - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/gold/ `#Gold` is the amount of gold your character carries, as shown in the status window. It is read from your character's status, which the client only has once the status window has been opened. If it reads `N/A`, open the status window once, by hand or with `event Macro 8 2`. ## Example ```euo if #Gold < 1000 display ok Only #Gold gold left. halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #GumpArt > Graphic of the selected gump window, as an ID: the backpack is YE. - **Access:** read-only - **Type:** id - **Needs a client:** yes - **New in Reforged:** EasyUO 1.5 does not have it. - **Set by:** ScanGumps - **Related:** ScanGumps, #GumpName, #GumpObjID - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/gumpart/ `#GumpArt` is the graphic the window selected by [`#GumpIndex`](https://ilpersi.github.io/EasyUOReforged/variables/gumpindex/) is drawn with, in the usual EUO format. It comes from the game's art files, so it is the same on every client build: | Window | `#GumpArt` | |---|---| | backpack | `YE` | | paperdoll | `YWC` | | status bar | `KZP` | | skills | `STL` | | buff bar | `EUB` | | spellbook | `AKD` | `ScanGumps A_YE` lists only the windows drawn with that graphic. Reads `N/A` for a window without a single graphic, which is every gump the server sends, and on client builds older than 7.0.29.97. Reads `N/A` when no gump is selected: none is open, [`ScanGumps`](https://ilpersi.github.io/EasyUOReforged/commands/scangumps/) has not run, or [`#GumpIndex`](https://ilpersi.github.io/EasyUOReforged/variables/gumpindex/) is past [`#GumpCnt`](https://ilpersi.github.io/EasyUOReforged/variables/gumpcnt/). ## Example ```euo scangumps A_YE for #GumpIndex 1 #GumpCnt event sysmessage A backpack-style container is open: #GumpObjID halt ``` --- # #GumpCnt > Number of gump windows ScanGumps found. - **Access:** read-only - **Type:** number - **Needs a client:** yes - **New in Reforged:** EasyUO 1.5 does not have it. - **Set by:** ScanGumps - **Related:** ScanGumps, #GumpIndex - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/gumpcnt/ `#GumpCnt` is the number of entries in the snapshot the last [`ScanGumps`](https://ilpersi.github.io/EasyUOReforged/commands/scangumps/) took: the open gump windows, or those that matched its filter. `0` when there are none. It does not change until the next `ScanGumps`, even if windows open or close meanwhile. ## Example ```euo scangumps event sysmessage #GumpCnt windows are open halt ``` --- # #GumpIndex > Selects which gump the #Gump… variables describe; 1 is the window in front. - **Access:** read / write - **Type:** number - **Needs a client:** yes - **New in Reforged:** EasyUO 1.5 does not have it. - **Set by:** ScanGumps - **Related:** ScanGumps, #GumpCnt - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/gumpindex/ `#GumpIndex` selects one entry of the snapshot [`ScanGumps`](https://ilpersi.github.io/EasyUOReforged/commands/scangumps/) took, the way [`#FindIndex`](https://ilpersi.github.io/EasyUOReforged/variables/findindex/) selects one `FindItem` match. Set it to a number from `1` to [`#GumpCnt`](https://ilpersi.github.io/EasyUOReforged/variables/gumpcnt/); [`#GumpName`](https://ilpersi.github.io/EasyUOReforged/variables/gumpname/) and the other `#Gump…` variables then describe that window. Entry `1` is the window in front (on `client_beta.exe`, its menu bar). `ScanGumps` sets it to `1`. Reading it gives the position selected. A position past `#GumpCnt` selects nothing, and the other `#Gump…` variables then read `N/A`. ## Example ```euo scangumps for #GumpIndex 1 #GumpCnt event sysmessage #GumpIndex : #GumpName halt ``` --- # #GumpKind > Kind of the selected gump window, the same code as #ContKind. - **Access:** read-only - **Type:** id - **Needs a client:** yes - **New in Reforged:** EasyUO 1.5 does not have it. - **Set by:** ScanGumps - **Related:** ScanGumps, #ContKind, #GumpTypeID - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/gumpkind/ `#GumpKind` is the code of the window's kind, the same value [`#ContKind`](https://ilpersi.github.io/EasyUOReforged/variables/contkind/) gives for the gump on top, in the usual EUO format. **It changes with every client update.** Don't keep it in a script for long: to recognise a window, use [`#GumpTypeID`](https://ilpersi.github.io/EasyUOReforged/variables/gumptypeid/) for a server gump, [`#GumpArt`](https://ilpersi.github.io/EasyUOReforged/variables/gumpart/) or [`#GumpName`](https://ilpersi.github.io/EasyUOReforged/variables/gumpname/) for the others. Reads `N/A` when no gump is selected: none is open, [`ScanGumps`](https://ilpersi.github.io/EasyUOReforged/commands/scangumps/) has not run, or [`#GumpIndex`](https://ilpersi.github.io/EasyUOReforged/variables/gumpindex/) is past [`#GumpCnt`](https://ilpersi.github.io/EasyUOReforged/variables/gumpcnt/). ## Example ```euo scangumps if #GumpKind = #ContKind event sysmessage The window in front is the gump on top. halt ``` --- # #GumpMin > Whether the selected gump window is minimized: #true or #false. - **Access:** read-only - **Type:** boolean - **Needs a client:** yes - **New in Reforged:** EasyUO 1.5 does not have it. - **Set by:** ScanGumps - **Related:** ScanGumps, #GumpSizeX, #GumpSizeY - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/gumpmin/ `#GumpMin` is `#true` when the window selected by [`#GumpIndex`](https://ilpersi.github.io/EasyUOReforged/variables/gumpindex/) is minimized, and `#false` when it is shown at full size. A minimized window keeps its place in the list; [`#GumpSizeX`](https://ilpersi.github.io/EasyUOReforged/variables/gumpsizex/) and [`#GumpSizeY`](https://ilpersi.github.io/EasyUOReforged/variables/gumpsizey/) then give its small size. Reads `N/A` on client builds older than 7.0.29.97. Reads `N/A` when no gump is selected: none is open, [`ScanGumps`](https://ilpersi.github.io/EasyUOReforged/commands/scangumps/) has not run, or [`#GumpIndex`](https://ilpersi.github.io/EasyUOReforged/variables/gumpindex/) is past [`#GumpCnt`](https://ilpersi.github.io/EasyUOReforged/variables/gumpcnt/). ## Example ```euo scangumps for #GumpIndex 1 #GumpCnt if #GumpMin = #true event sysmessage #GumpName is minimized halt ``` --- # #GumpName > The client's own name for the selected gump window, e.g. container_gump. - **Access:** read-only - **Type:** string - **Needs a client:** yes - **New in Reforged:** EasyUO 1.5 does not have it. - **Set by:** ScanGumps - **Related:** ScanGumps, #GumpKind, #ContName - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/gumpname/ `#GumpName` is the name the client gives the kind of window selected by [`#GumpIndex`](https://ilpersi.github.io/EasyUOReforged/variables/gumpindex/), the same text as [`#ContName`](https://ilpersi.github.io/EasyUOReforged/variables/contname/), with its spaces written as `_`. For example `container_gump`, `paperdoll_gump`, `status_gump`, `skill_gump`, `BuffIcons_Gump`, and `generic_gump` for every gump the server sends. The names are the same on every client build, so a script can rely on them. Reads `N/A` when no gump is selected: none is open, [`ScanGumps`](https://ilpersi.github.io/EasyUOReforged/commands/scangumps/) has not run, or [`#GumpIndex`](https://ilpersi.github.io/EasyUOReforged/variables/gumpindex/) is past [`#GumpCnt`](https://ilpersi.github.io/EasyUOReforged/variables/gumpcnt/). ## Example ```euo scangumps for #GumpIndex 1 #GumpCnt if #GumpName = generic_gump event sysmessage A server gump is open: #GumpTypeID halt ``` --- # #GumpObjID > ID of the object the selected gump window belongs to: a container or a character. - **Access:** read-only - **Type:** id - **Needs a client:** yes - **New in Reforged:** EasyUO 1.5 does not have it. - **Set by:** ScanGumps - **Related:** ScanGumps, #GumpArt, #ContID - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/gumpobjid/ `#GumpObjID` is the ID of the object the window selected by [`#GumpIndex`](https://ilpersi.github.io/EasyUOReforged/variables/gumpindex/) belongs to, in the usual EUO format, as [`#ContID`](https://ilpersi.github.io/EasyUOReforged/variables/contid/) gives it for the gump on top: the container of a container window, the character of a paperdoll or status bar, the spellbook of a spellbook window. Reads `N/A` for a window that belongs to no object (the skills window, the buff bar, the gumps the server sends). Reads `N/A` when no gump is selected: none is open, [`ScanGumps`](https://ilpersi.github.io/EasyUOReforged/commands/scangumps/) has not run, or [`#GumpIndex`](https://ilpersi.github.io/EasyUOReforged/variables/gumpindex/) is past [`#GumpCnt`](https://ilpersi.github.io/EasyUOReforged/variables/gumpcnt/). ## Example ```euo scangumps for #GumpIndex 1 #GumpCnt if #GumpObjID = #BackpackID event sysmessage The backpack is open at #GumpPosX #GumpPosY halt ``` --- # #GumpPosX > X position of the selected gump window, in pixels. - **Access:** read-only - **Type:** number - **Needs a client:** yes - **New in Reforged:** EasyUO 1.5 does not have it. - **Set by:** ScanGumps - **Related:** ScanGumps, #GumpPosY, #ContPosX - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/gumpposx/ `#GumpPosX` is the left edge of the window selected by [`#GumpIndex`](https://ilpersi.github.io/EasyUOReforged/variables/gumpindex/), as [`#ContPosX`](https://ilpersi.github.io/EasyUOReforged/variables/contposx/) gives it for the gump on top. Reads `N/A` when no gump is selected: none is open, [`ScanGumps`](https://ilpersi.github.io/EasyUOReforged/commands/scangumps/) has not run, or [`#GumpIndex`](https://ilpersi.github.io/EasyUOReforged/variables/gumpindex/) is past [`#GumpCnt`](https://ilpersi.github.io/EasyUOReforged/variables/gumpcnt/). ## Example ```euo scangumps event sysmessage The window in front is at #GumpPosX #GumpPosY halt ``` --- # #GumpPosY > Y position of the selected gump window, in pixels. - **Access:** read-only - **Type:** number - **Needs a client:** yes - **New in Reforged:** EasyUO 1.5 does not have it. - **Set by:** ScanGumps - **Related:** ScanGumps, #GumpPosX, #ContPosY - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/gumpposy/ `#GumpPosY` is the top edge of the window selected by [`#GumpIndex`](https://ilpersi.github.io/EasyUOReforged/variables/gumpindex/), as [`#ContPosY`](https://ilpersi.github.io/EasyUOReforged/variables/contposy/) gives it for the gump on top. Reads `N/A` when no gump is selected: none is open, [`ScanGumps`](https://ilpersi.github.io/EasyUOReforged/commands/scangumps/) has not run, or [`#GumpIndex`](https://ilpersi.github.io/EasyUOReforged/variables/gumpindex/) is past [`#GumpCnt`](https://ilpersi.github.io/EasyUOReforged/variables/gumpcnt/). ## Example ```euo scangumps set %x #GumpPosX + #GumpSizeX event sysmessage The window in front ends at x = %x halt ``` --- # #GumpReply > The last answer exevent GumpReply sent, type ID first, ready to send again. - **Access:** read-only - **Type:** string - **Needs a client:** no - **New in Reforged:** EasyUO 1.5 does not have it. - **Set by:** exevent GumpReply - **Related:** exevent GumpReply, #GumpReplyRes, #GumpReplyCnt, #GumpTypeID - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/gumpreply/ `#GumpReply` holds the last answer sent to a gump the server opened, in the words that follow `exevent GumpReply`: the gump's type ID first, then the button, the switches (`-` for none) and the text fields. For example `JHEIIPI 1 -`, or `YISCGQI 2 3/7 5:Iron_Golem`. It is the answer [`exevent GumpReply`](https://ilpersi.github.io/EasyUOReforged/commands/exevent/gumpreply/) sent, or the one you sent with a click: once a script has read [`#GumpReplyCnt`](https://ilpersi.github.io/EasyUOReforged/variables/gumpreplycnt/), EasyUO Reforged records the clicks too. A click sends the window's checkboxes and text fields with the button, so they are in it too. So `exevent GumpReply #GumpReply` sends the same answer again, to the gump of that type that is open now, with its new serial. Copy it into a variable to keep it: `set %answer #GumpReply`. So to find out what a gump expects, click the button once by hand and read `#GumpReply`: the script can then send the same answer itself. Reads `N/A` until an answer was recorded. With the click hook in the client, the last answer it recorded can come from before the run. ## Example ```euo exevent GumpReply JHEIIPI 0 if #GumpReplyRes = sent event sysmessage Sent: #GumpReply halt ``` --- # #GumpReplyCnt > How many gump answers were recorded: clicks by hand and exevent GumpReply. Goes up by one with each. - **Access:** read-only - **Type:** number - **Needs a client:** no - **New in Reforged:** EasyUO 1.5 does not have it. - **Set by:** exevent GumpReply - **Related:** #GumpReply, exevent GumpReply, #GumpReplyRes - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/gumpreplycnt/ `#GumpReplyCnt` goes up by one every time the client answers a gump the server sent: when you click one of its buttons, and when [`exevent GumpReply`](https://ilpersi.github.io/EasyUOReforged/commands/exevent/gumpreply/) answers one. Compare it with the value you read before to know that an answer went out; [`#GumpReply`](https://ilpersi.github.io/EasyUOReforged/variables/gumpreply/) then holds that answer. The first time a script reads `#GumpReplyCnt`, EasyUO Reforged puts a small hook into the client that records the answers. It stays until the client closes, and every later run, or another EasyUO Reforged, uses the same one, so the number keeps counting from where it was. Use the difference, not the number itself. Without a client, or where the hook can't be put in, it counts the answers `exevent GumpReply` sent in this run. ## Example Wait until you click a button in a gump, then show what the click sent: ```euo set %n #GumpReplyCnt event sysmessage Click a button in the gump. set %t #SCnt + 60 repeat wait 5 until #GumpReplyCnt <> %n || #SCnt > %t if #GumpReplyCnt <> %n display ok You sent: #GumpReply halt ``` --- # #GumpReplyRes > What the last exevent GumpReply did: sent, nogump or error. - **Access:** read-only - **Type:** string - **Needs a client:** no - **New in Reforged:** EasyUO 1.5 does not have it. - **Set by:** exevent GumpReply - **Related:** exevent GumpReply, #GumpReply - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/gumpreplyres/ `#GumpReplyRes` says what the last [`exevent GumpReply`](https://ilpersi.github.io/EasyUOReforged/commands/exevent/gumpreply/) did: | Value | Meaning | |---|---| | `sent` | The answer went out; [`#GumpReply`](https://ilpersi.github.io/EasyUOReforged/variables/gumpreply/) holds it. | | `nogump` | No such gump was open, so nothing was sent. | | `error` | The words were wrong, or this client build can't answer gumps. Nothing was sent. | Reads `N/A` until `exevent GumpReply` ran in this run. ## Example ```euo exevent GumpReply JHEIIPI 1 if #GumpReplyRes <> sent display ok The confirmation was not open ( #GumpReplyRes ). halt ``` --- # #GumpSerial > Serial of the selected server gump, new each time the server opens it. - **Access:** read-only - **Type:** id - **Needs a client:** yes - **New in Reforged:** EasyUO 1.5 does not have it. - **Set by:** ScanGumps - **Related:** ScanGumps, #GumpTypeID, #GumpName - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/gumpserial/ `#GumpSerial` is the serial the server gave the gump selected by [`#GumpIndex`](https://ilpersi.github.io/EasyUOReforged/variables/gumpindex/), in the usual EUO format. Only gumps the server sends have one ([`#GumpName`](https://ilpersi.github.io/EasyUOReforged/variables/gumpname/) is `generic_gump`). **It changes every time the server opens the gump**, even the same one. To recognise a gump, use [`#GumpTypeID`](https://ilpersi.github.io/EasyUOReforged/variables/gumptypeid/). The serial tells two copies apart: a window that closed and opened again has a new one. Reads `N/A` for a window that is not a server gump, and on client builds older than 7.0.29.97 or from 7.0.30 to 7.0.46. Reads `N/A` when no gump is selected: none is open, [`ScanGumps`](https://ilpersi.github.io/EasyUOReforged/commands/scangumps/) has not run, or [`#GumpIndex`](https://ilpersi.github.io/EasyUOReforged/variables/gumpindex/) is past [`#GumpCnt`](https://ilpersi.github.io/EasyUOReforged/variables/gumpcnt/). ## Example ```euo scangumps set %first #GumpSerial wait 20 scangumps if #GumpSerial <> %first event sysmessage The window in front is new. halt ``` --- # #GumpSizeX > Width of the selected gump window, in pixels. - **Access:** read-only - **Type:** number - **Needs a client:** yes - **New in Reforged:** EasyUO 1.5 does not have it. - **Set by:** ScanGumps - **Related:** ScanGumps, #GumpSizeY, #ContSizeX - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/gumpsizex/ `#GumpSizeX` is the width of the window selected by [`#GumpIndex`](https://ilpersi.github.io/EasyUOReforged/variables/gumpindex/), as [`#ContSizeX`](https://ilpersi.github.io/EasyUOReforged/variables/contsizex/) gives it for the gump on top. A minimized window has its small size. Reads `N/A` when no gump is selected: none is open, [`ScanGumps`](https://ilpersi.github.io/EasyUOReforged/commands/scangumps/) has not run, or [`#GumpIndex`](https://ilpersi.github.io/EasyUOReforged/variables/gumpindex/) is past [`#GumpCnt`](https://ilpersi.github.io/EasyUOReforged/variables/gumpcnt/). ## Example ```euo scangumps event sysmessage The window in front is #GumpSizeX by #GumpSizeY halt ``` --- # #GumpSizeY > Height of the selected gump window, in pixels. - **Access:** read-only - **Type:** number - **Needs a client:** yes - **New in Reforged:** EasyUO 1.5 does not have it. - **Set by:** ScanGumps - **Related:** ScanGumps, #GumpSizeX, #ContSizeY - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/gumpsizey/ `#GumpSizeY` is the height of the window selected by [`#GumpIndex`](https://ilpersi.github.io/EasyUOReforged/variables/gumpindex/), as [`#ContSizeY`](https://ilpersi.github.io/EasyUOReforged/variables/contsizey/) gives it for the gump on top. A minimized window has its small size. Reads `N/A` when no gump is selected: none is open, [`ScanGumps`](https://ilpersi.github.io/EasyUOReforged/commands/scangumps/) has not run, or [`#GumpIndex`](https://ilpersi.github.io/EasyUOReforged/variables/gumpindex/) is past [`#GumpCnt`](https://ilpersi.github.io/EasyUOReforged/variables/gumpcnt/). ## Example ```euo scangumps set %bottom #GumpPosY + #GumpSizeY event sysmessage The window in front ends at y = %bottom halt ``` --- # #GumpTypeID > Type ID of the selected server gump: which gump it is, the same every time. - **Access:** read-only - **Type:** id - **Needs a client:** yes - **New in Reforged:** EasyUO 1.5 does not have it. - **Set by:** ScanGumps - **Related:** ScanGumps, #GumpSerial, #GumpName, #GumpKind - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/gumptypeid/ `#GumpTypeID` says which gump the server sent, for the gump selected by [`#GumpIndex`](https://ilpersi.github.io/EasyUOReforged/variables/gumpindex/), in the usual EUO format. Only gumps the server sends have one ([`#GumpName`](https://ilpersi.github.io/EasyUOReforged/variables/gumpname/) is `generic_gump`). **It is the value to recognise a server gump by.** It is the same every time the server opens the same gump, and it does not depend on the client build. Read it once by hand with the gump open, keep it in your script, and look for it with `ScanGumps T_` and the ID. On most emulator shards it is a code made from the gump's name in the server's source, so it stays the same until the shard changes that gump. Reads `N/A` for a window that is not a server gump, and on client builds older than 7.0.29.97 or from 7.0.30 to 7.0.46. Reads `N/A` when no gump is selected: none is open, [`ScanGumps`](https://ilpersi.github.io/EasyUOReforged/commands/scangumps/) has not run, or [`#GumpIndex`](https://ilpersi.github.io/EasyUOReforged/variables/gumpindex/) is past [`#GumpCnt`](https://ilpersi.github.io/EasyUOReforged/variables/gumpcnt/). ## Example ```euo set %confirm JHEIIPI ; the gump's #GumpTypeID on your shard scangumps T_ , %confirm if #GumpCnt > 0 event sysmessage The confirmation is open. halt ``` --- # #Hits > Your character’s current hit points. - **Access:** read-only - **Type:** number - **Needs a client:** yes - **Related:** #MaxHits, #Stamina, #Mana - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/hits/ `#Hits` is your character's current hit points; [`#MaxHits`](https://ilpersi.github.io/EasyUOReforged/variables/maxhits/) is the most it can have. It is read from your character's status, which the client only has once the status window has been opened. If it reads `N/A`, open the status window once, by hand or with `event Macro 8 2`. ## Example ```euo if #Hits < #MaxHits / 2 display ok Below half health: heal! halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #Int > Your character’s intelligence. - **Access:** read-only - **Type:** number - **Needs a client:** yes - **Related:** #Str, #Dex, #MaxStats - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/int/ `#Int` is your character's intelligence. It is read from your character's status, which the client only has once the status window has been opened. If it reads `N/A`, open the status window once, by hand or with `event Macro 8 2`. ## Example ```euo display ok My intelligence is #Int halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #JColor > Colour of the journal line read by the last scanjournal. - **Access:** read-only - **Type:** number - **Needs a client:** yes - **Set by:** FindJournal, ScanJournal - **Related:** #Journal, ScanJournal, FindJournal - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/jcolor/ `#JColor` is the colour (hue) of the journal line read by the last [`scanjournal`](https://ilpersi.github.io/EasyUOReforged/commands/scanjournal/) or found by the last [`findjournal`](https://ilpersi.github.io/EasyUOReforged/commands/findjournal/), which can also search by it. It tells apart lines with the same text, such as system messages and speech. It cannot be set. *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #JFound > Running number of the journal line the last findjournal found, or 0 if it found none. - **Access:** read-only - **Type:** number - **Needs a client:** yes - **New in Reforged:** EasyUO 1.5 does not have it. - **Set by:** FindJournal - **Related:** FindJournal, #JIndex, #Journal, #JColor - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/jfound/ `#JFound` says what the last [`findjournal`](https://ilpersi.github.io/EasyUOReforged/commands/findjournal/) found: | Value | Meaning | |---|---| | a number above 0 | The running number of the line, the same numbering as [`#JIndex`](https://ilpersi.github.io/EasyUOReforged/variables/jindex/). | | `0` | No line matched, or the time ran out. | | `N/A` | No `findjournal` has finished yet in this run. | Pressing Stop during a `findjournal` leaves it as it was. Write `if #JFound > 0`. `if #JFound` alone is never true, because only `-1` counts as true. The line itself is in [`#Journal`](https://ilpersi.github.io/EasyUOReforged/variables/journal/) and its colour in [`#JColor`](https://ilpersi.github.io/EasyUOReforged/variables/jcolor/). Setting your bookmark to `#JFound` continues the search after this line, and [`scanjournal #JFound`](https://ilpersi.github.io/EasyUOReforged/commands/scanjournal/) reads the same line again. ## Example ```euo set %j #JIndex msg hello there$ findjournal %j * 3s hello_there if #JFound > 0 { set %j #JFound event sysmessage Found line #JFound } halt ``` --- # #JIndex > Running number of the newest journal line; follow it to read every new line once. - **Access:** read-only - **Type:** number - **Needs a client:** yes - **Related:** ScanJournal, FindJournal, #JFound, #Journal - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/jindex/ `#JIndex` is the running number of the newest journal line: every new line gets the next number. Give such a number to [`scanjournal`](https://ilpersi.github.io/EasyUOReforged/commands/scanjournal/) to read exactly that line. Remembering `#JIndex` and reading every number up to the current one handles each new line exactly once, however many arrive at once. [`findjournal`](https://ilpersi.github.io/EasyUOReforged/commands/findjournal/) searches those lines for you, starting from a saved `#JIndex`. ## Example ```euo set %from #JIndex + 1 msg #smc TestA$ msg #smc TestB$ wait 1s for %n %from #JIndex { scanjournal %n if TestB in #Journal event SysMessage Found it. } halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #Journal > Journal line read by the last scanjournal. - **Access:** read-only - **Type:** string - **Needs a client:** yes - **Set by:** FindJournal, ScanJournal - **Related:** ScanJournal, FindJournal, #JIndex, #JColor, #SysMsg - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/journal/ `#Journal` is the journal line read by the last [`scanjournal`](https://ilpersi.github.io/EasyUOReforged/commands/scanjournal/) or found by the last [`findjournal`](https://ilpersi.github.io/EasyUOReforged/commands/findjournal/); its colour is in [`#JColor`](https://ilpersi.github.io/EasyUOReforged/variables/jcolor/). Spaces read as `_`, so search it with `in`, writing `_` for spaces. It reads `N/A` when the line does not exist, is too old, or was hidden by [`deletejournal`](https://ilpersi.github.io/EasyUOReforged/commands/deletejournal/). ## Example ```euo scanjournal 1 if is_attacking_you in #Journal event macro 1 0 Guards! halt ``` See [`scanjournal`](https://ilpersi.github.io/EasyUOReforged/commands/scanjournal/) for a loop that never misses a line. *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #LHandID > ID of the item for the left hand; set it, then event Macro 24 1 arms it. - **Access:** read / write - **Type:** id - **Needs a client:** yes - **Related:** #RHandID, event Macro, exevent Equip - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/lhandid/ `#LHandID` is the ID of the item the client arms in your left hand (a shield or a two-handed weapon) with the *Arm/Disarm* macro, [`event Macro 24 1`](https://ilpersi.github.io/EasyUOReforged/commands/event/macro/). With your left hand empty, the macro equips the item with this ID. With something in your left hand, the macro saves that item's ID here and takes it off, so running the macro again puts it back. To arm a given item, set `#LHandID` to it and run the macro with your left hand empty. With the hand empty and no ID set, the client says "You must first disarm a weapon in order to arm one." The value lives in the client: setting it changes it for every script attached to that client. ## Example ```euo set %shield ABCDEFG ; your shield's ID set #LHandID %shield event Macro 24 1 halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #LLiftedID > ID of the object last picked up (dragged). - **Access:** read-only - **Type:** id - **Needs a client:** yes - **Related:** #LLiftedKind, #LLiftedType, event Drag - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/lliftedid/ `#LLiftedID` is the ID of the object you picked up (dragged) last, with the mouse or with [`event Drag`](https://ilpersi.github.io/EasyUOReforged/commands/event/drag/). [`#LLiftedKind`](https://ilpersi.github.io/EasyUOReforged/variables/lliftedkind/) tells whether it is still on the cursor. ## Example ```euo set %item ABCDEFG ; the ID of an item in your backpack event Drag %item wait 20 display ok You picked up #LLiftedID halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #LLiftedKind > 1 while something hangs on the cursor, 0 otherwise. - **Access:** read-only - **Type:** number - **Needs a client:** yes - **Related:** #LLiftedID, event Drag - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/lliftedkind/ `#LLiftedKind` is `1` while an object hangs on the cursor (picked up and not dropped yet) and `0` otherwise. [`event Drag`](https://ilpersi.github.io/EasyUOReforged/commands/event/drag/) does nothing while it is `1`. ## Example ```euo set %item ABCDEFG ; the ID of an item in your backpack event Drag %item wait 10 if #LLiftedKind = 0 display ok The pick-up failed. halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #LLiftedType > Type of the object last picked up (dragged). - **Access:** read-only - **Type:** id - **Needs a client:** yes - **Related:** #LLiftedID, #LLiftedKind - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/lliftedtype/ `#LLiftedType` is the item type of the object you picked up last, in the same form as [`#FindType`](https://ilpersi.github.io/EasyUOReforged/variables/findtype/). *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #LObjectID > ID of the last object used; set it, then event Macro 17 uses that object. - **Access:** read / write - **Type:** id - **Needs a client:** yes - **Related:** #LObjectType, event Macro, #LTargetID - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/lobjectid/ `#LObjectID` is the ID of the object you used last (double-clicked). Set it and run [`event Macro 17`](https://ilpersi.github.io/EasyUOReforged/commands/event/macro/) (*Last Object*) to use any object as if you had double-clicked it. The value lives in the client, not in the script: setting it changes it for every script attached to that client, and the client changes it too as you play. Save the old value and put it back if other scripts may rely on it. ## Example ```euo finditem ZLF C_ , #BackpackID ; bandages set %bandages #FindID set %old #LObjectID set #LObjectID %bandages event Macro 17 0 target 2s set #LObjectID %old halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #LObjectType > Type of the last object used. - **Access:** read-only - **Type:** id - **Needs a client:** yes - **Related:** #LObjectID - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/lobjecttype/ `#LObjectType` is the item type of the object you used last, in the same form as [`#FindType`](https://ilpersi.github.io/EasyUOReforged/variables/findtype/). *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #LPC > Lines run per 50 ms cycle; 10 by default. - **Access:** read / write - **Type:** number - **Needs a client:** no - **Related:** LinesPerCycle - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/lpc/ `#LPC` is how many lines the script runs before each 50 ms pause; [`linespercycle`](https://ilpersi.github.io/EasyUOReforged/commands/linespercycle/) sets the same value. It is `10` when a script starts. `0` and negative values are ignored. Raise it for plain calculations, or to build a big [`menu`](https://ilpersi.github.io/EasyUOReforged/commands/menu/) window quickly; commands that wait for the client take the time they need regardless. ## Example ```euo set #LPC 1000 set %sum 0 for %i 1 1000 ; a lot of quick work set %sum %sum + %i set #LPC 10 display ok The sum is %sum halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #LShard > Number of the last shard chosen; set it before logging in to preselect a shard. - **Access:** read / write - **Type:** number - **Needs a client:** yes - **Related:** #Shard - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/lshard/ `#LShard` is the number of the shard last chosen on the shard list, the one shown next to the globe. Setting it before logging in makes the client offer that shard as the last one, unless it is not available. The numbers below were collected in 2006 for the official shards and may have changed since: | Shard | `#LShard` | |---|---| | Atlantic | 0 | | Lake Superior | 1 | | Pacific | 2 | | Great Lakes | 3 | | Baja | 5 | | Chesapeake | 6 | | Napa Valley | 7 | | Catskills | 8 | | Sonoma | 9 | | Lake Austin | 10 | | Siege Perilous | 12 | | Legends | 14 | | Sakura | 16 | | Mugen | 18 | | Oceania | 19 | | Yamato | 20 | | Asuka | 21 | | Wakoku | 22 | | Hokuto | 23 | | Europa | 24 | | Drachenfels | 25 | | Formosa | 26 | | Izumo | 27 | | Arirang | 28 | | Balhae | 29 | | Minuho | 31 | | Test Center | 41 | | Origin | 45 | *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #LSkill > Number of the last skill used; set it, then event Macro 14 uses that skill. - **Access:** read / write - **Type:** number - **Needs a client:** yes - **Related:** event Macro, ChooseSkill, #LSpell - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/lskill/ `#LSkill` is the number of the skill you used last. Set it and run [`event Macro 14`](https://ilpersi.github.io/EasyUOReforged/commands/event/macro/) (*Last Skill*) to use a skill, as if you had clicked its button in the skills list. The numbers are listed under [Use Skills](https://ilpersi.github.io/EasyUOReforged/commands/event/macro/#use-skills) on the `event Macro` page; they are the same numbers that skill uses everywhere, for example Hiding is `21`, Meditation `46`, Spirit Speak `32`. The value lives in the client, not in the script: setting it changes it for every script attached to that client, and the client changes it too as you play. Save the old value and put it back if other scripts may rely on it. ## Example ```euo set #LSkill 21 ; Hiding event Macro 14 0 halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #LSpell > Number of the last spell cast; set it, then event Macro 16 casts that spell. - **Access:** read / write - **Type:** number - **Needs a client:** yes - **Related:** event Macro, #LSkill, Target - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/lspell/ `#LSpell` is the number of the spell you cast last. Set it and run [`event Macro 16`](https://ilpersi.github.io/EasyUOReforged/commands/event/macro/) (*Last Spell*) to cast that spell. The numbers are the client's own. They are the ones listed for casting on the `event Macro` page, except in three schools: [Magery](https://ilpersi.github.io/EasyUOReforged/commands/event/macro/#magery) counts from `1` (Clumsy) to `64` (Water Elemental) here, one more than `event Macro 15` takes, Bushido from `401` and Ninjitsu from `501`. [Necromancy](https://ilpersi.github.io/EasyUOReforged/commands/event/macro/#necromancy) from `101`, [Chivalry](https://ilpersi.github.io/EasyUOReforged/commands/event/macro/#chivalry) from `201` and the other schools are the same in both. The value lives in the client, not in the script: setting it changes it for every script attached to that client, and the client changes it too as you play. Save the old value and put it back if other scripts may rely on it. ## Example ```euo set #LSpell 29 ; Greater Heal (event Macro 15 28) event Macro 16 0 target 3s event Macro 23 0 ; target self halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #LTargetID > ID of the last object targeted; set it, then event Macro 22 targets that object. - **Access:** read / write - **Type:** id - **Needs a client:** yes - **Related:** #LTargetKind, #LObjectID, Target, event Macro - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/ltargetid/ `#LTargetID` is the ID of the object you targeted last. To target any object from a script: wait for the target cursor, set `#LTargetID` and [`#LTargetKind`](https://ilpersi.github.io/EasyUOReforged/variables/ltargetkind/) `1`, then run [`event Macro 22`](https://ilpersi.github.io/EasyUOReforged/commands/event/macro/) (*Last Target*). The value lives in the client, not in the script: setting it changes it for every script attached to that client, and the client changes it too as you play. Save the old value and put it back if other scripts may rely on it. ## Example ```euo ; carve a corpse with a dagger finditem TSF C_ , #BackpackID ; a dagger set %dagger #FindID finditem YFM G_2 ; a corpse next to you set %corpse #FindID set #LObjectID %dagger event Macro 17 0 target 5s set #LTargetID %corpse set #LTargetKind 1 event Macro 22 0 halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #LTargetKind > What the last target was: 1 object, 2 ground, 3 resource such as a tree or water. - **Access:** read / write - **Type:** number - **Needs a client:** yes - **Related:** #LTargetID, #LTargetX, #LTargetTile, event Macro - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/ltargetkind/ `#LTargetKind` is what kind of thing was targeted last, and what [`event Macro 22`](https://ilpersi.github.io/EasyUOReforged/commands/event/macro/) (*Last Target*) will target: | Value | Target | Uses | |---|---|---| | `1` | An object | [`#LTargetID`](https://ilpersi.github.io/EasyUOReforged/variables/ltargetid/) | | `2` | The ground, mountains, caves | [`#LTargetX`](https://ilpersi.github.io/EasyUOReforged/variables/ltargetx/), [`#LTargetY`](https://ilpersi.github.io/EasyUOReforged/variables/ltargety/), [`#LTargetZ`](https://ilpersi.github.io/EasyUOReforged/variables/ltargetz/) | | `3` | A resource on the map: tree, water | The position, and [`#LTargetTile`](https://ilpersi.github.io/EasyUOReforged/variables/ltargettile/) | **Set it every time before `event Macro 22`.** Leaving it as it was is one of the most common causes of targeting going wrong now and then. The value lives in the client, not in the script: setting it changes it for every script attached to that client, and the client changes it too as you play. Save the old value and put it back if other scripts may rely on it. ## Example ```euo ; teleport to a spot on the ground event Macro 15 21 ; cast Teleport target 5s set #LTargetX 1000 set #LTargetY 1000 set #LTargetZ 0 set #LTargetKind 2 event Macro 22 0 halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #LTargetTile > Map graphic of the tile last targeted; used for resources such as trees. - **Access:** read / write - **Type:** number - **Needs a client:** yes - **Related:** #LTargetKind, #LTargetX, Tile - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/ltargettile/ `#LTargetTile` is the graphic number of the map tile you targeted last, for example the tree you chopped. With [`#LTargetKind`](https://ilpersi.github.io/EasyUOReforged/variables/ltargetkind/) `3`, [`event Macro 22`](https://ilpersi.github.io/EasyUOReforged/commands/event/macro/) targets that tile at [`#LTargetX`](https://ilpersi.github.io/EasyUOReforged/variables/ltargetx/), [`#LTargetY`](https://ilpersi.github.io/EasyUOReforged/variables/ltargety/), [`#LTargetZ`](https://ilpersi.github.io/EasyUOReforged/variables/ltargetz/). [`tile`](https://ilpersi.github.io/EasyUOReforged/commands/tile/) reads tile graphics from the map. The value lives in the client, not in the script: setting it changes it for every script attached to that client, and the client changes it too as you play. Save the old value and put it back if other scripts may rely on it. *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #LTargetX > World X position of the last target; used when targeting the ground or a resource. - **Access:** read / write - **Type:** number - **Needs a client:** yes - **Related:** #LTargetKind, #LTargetY, #LTargetTile - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/ltargetx/ `#LTargetX` is the world X position of the spot you targeted last. With [`#LTargetKind`](https://ilpersi.github.io/EasyUOReforged/variables/ltargetkind/) `2` or `3`, [`event Macro 22`](https://ilpersi.github.io/EasyUOReforged/commands/event/macro/) targets the position in `#LTargetX`, `#LTargetY` and `#LTargetZ`. See `#LTargetKind` for an example. The value lives in the client, not in the script: setting it changes it for every script attached to that client, and the client changes it too as you play. Save the old value and put it back if other scripts may rely on it. *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #LTargetY > World Y position of the last target; used when targeting the ground or a resource. - **Access:** read / write - **Type:** number - **Needs a client:** yes - **Related:** #LTargetKind, #LTargetX, #LTargetTile - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/ltargety/ `#LTargetY` is the world Y position of the spot you targeted last. With [`#LTargetKind`](https://ilpersi.github.io/EasyUOReforged/variables/ltargetkind/) `2` or `3`, [`event Macro 22`](https://ilpersi.github.io/EasyUOReforged/commands/event/macro/) targets the position in `#LTargetX`, `#LTargetY` and `#LTargetZ`. See `#LTargetKind` for an example. The value lives in the client, not in the script: setting it changes it for every script attached to that client, and the client changes it too as you play. Save the old value and put it back if other scripts may rely on it. *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #LTargetZ > World height of the last target; used when targeting the ground or a resource. - **Access:** read / write - **Type:** number - **Needs a client:** yes - **Related:** #LTargetKind, #LTargetX, #LTargetTile - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/ltargetz/ `#LTargetZ` is the world height of the spot you targeted last. With [`#LTargetKind`](https://ilpersi.github.io/EasyUOReforged/variables/ltargetkind/) `2` or `3`, [`event Macro 22`](https://ilpersi.github.io/EasyUOReforged/commands/event/macro/) targets the position in `#LTargetX`, `#LTargetY` and `#LTargetZ`. See `#LTargetKind` for an example. The value lives in the client, not in the script: setting it changes it for every script attached to that client, and the client changes it too as you play. Save the old value and put it back if other scripts may rely on it. *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #Luck > Your character’s luck. - **Access:** read-only - **Type:** number - **Needs a client:** yes - **Related:** #Str - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/luck/ `#Luck` is your character's luck. It is read from your character's status, which the client only has once the status window has been opened. If it reads `N/A`, open the status window once, by hand or with `event Macro 8 2`. It also needs a client with the extended status of Age of Shadows and later; on older clients it reads `N/A`. ## Example ```euo display ok My luck is #Luck halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #Mana > Your character’s current mana. - **Access:** read-only - **Type:** number - **Needs a client:** yes - **Related:** #MaxMana, #Hits - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/mana/ `#Mana` is your character's current mana; [`#MaxMana`](https://ilpersi.github.io/EasyUOReforged/variables/maxmana/) is the most it can have. It is read from your character's status, which the client only has once the status window has been opened. If it reads `N/A`, open the status window once, by hand or with `event Macro 8 2`. ## Example ```euo if #Mana < 20 display ok Low on mana: meditate. halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #MaxDmg > Most damage of the weapon in your hands. - **Access:** read-only - **Type:** number - **Needs a client:** yes - **Related:** #MinDmg - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/maxdmg/ `#MaxDmg` is the most damage of the weapon you are holding, as the status window shows it; [`#MinDmg`](https://ilpersi.github.io/EasyUOReforged/variables/mindmg/) is the least. It is read from your character's status, which the client only has once the status window has been opened. If it reads `N/A`, open the status window once, by hand or with `event Macro 8 2`. It also needs a client with the extended status of Age of Shadows and later; on older clients it reads `N/A`. ## Example ```euo display ok Damage #MinDmg - #MaxDmg halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #MaxFol > How many follower slots your character has. - **Access:** read-only - **Type:** number - **Needs a client:** yes - **Related:** #Followers - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/maxfol/ `#MaxFol` is how many follower slots your character has. It is read from your character's status, which the client only has once the status window has been opened. If it reads `N/A`, open the status window once, by hand or with `event Macro 8 2`. It also needs a client with the extended status of Age of Shadows and later; on older clients it reads `N/A`. ## Example ```euo set %free #MaxFol - #Followers display ok Free slots: %free halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #MaxHits > The most hit points your character can have. - **Access:** read-only - **Type:** number - **Needs a client:** yes - **Related:** #Hits - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/maxhits/ `#MaxHits` is the most hit points your character can have. It is read from your character's status, which the client only has once the status window has been opened. If it reads `N/A`, open the status window once, by hand or with `event Macro 8 2`. ## Example ```euo if #Hits < #MaxHits display ok Hurt: #Hits of #MaxHits hit points. halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #MaxMana > The most mana your character can have. - **Access:** read-only - **Type:** number - **Needs a client:** yes - **Related:** #Mana - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/maxmana/ `#MaxMana` is the most mana your character can have. It is read from your character's status, which the client only has once the status window has been opened. If it reads `N/A`, open the status window once, by hand or with `event Macro 8 2`. ## Example ```euo while #Mana < #MaxMana wait 1s display ok Mana is full. halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #MaxStam > The most stamina your character can have. - **Access:** read-only - **Type:** number - **Needs a client:** yes - **Related:** #Stamina - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/maxstam/ `#MaxStam` is the most stamina your character can have. It is read from your character's status, which the client only has once the status window has been opened. If it reads `N/A`, open the status window once, by hand or with `event Macro 8 2`. ## Example ```euo if #Stamina = #MaxStam display ok Rested: ready to run. halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #MaxStats > Your character’s stat cap: the most strength, dexterity and intelligence together. - **Access:** read-only - **Type:** number - **Needs a client:** yes - **Related:** #Str, #Dex, #Int, exevent StatLock - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/maxstats/ `#MaxStats` is your character's stat cap: the most that strength, dexterity and intelligence can add up to. It is read from your character's status, which the client only has once the status window has been opened. If it reads `N/A`, open the status window once, by hand or with `event Macro 8 2`. It also needs a client with the extended status of Age of Shadows and later; on older clients it reads `N/A`. ## Example ```euo set %total #Str + #Dex + #Int if %total >= #MaxStats display ok Stats are capped. halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #MaxWeight > Most weight your character can carry, calculated from strength: 3.5 × Str + 40. - **Access:** read-only - **Type:** number - **Needs a client:** yes - **Related:** #Weight, #Str - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/maxweight/ `#MaxWeight` is the most weight your character can carry, in stones. EasyUO calculates it from your strength with the classic formula, 3.5 × [`#Str`](https://ilpersi.github.io/EasyUOReforged/variables/str/) + 40. Shards that use another rule (racial bonuses, for example) show a different maximum in the status window. It is read from your character's status, which the client only has once the status window has been opened. If it reads `N/A`, open the status window once, by hand or with `event Macro 8 2`. ## Example ```euo if #Weight > #MaxWeight display ok You are overweight! halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #MenuButton > Name of the last menu button clicked, in capitals; CLOSED when the menu window was closed. - **Access:** read / write - **Type:** string - **Needs a client:** no - **Related:** menu Button, menu Hide, #MenuRes - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/menubutton/ `#MenuButton` is the name of the last [`menu`](https://ilpersi.github.io/EasyUOReforged/commands/menu/) button clicked, in capital letters. When the menu window is closed, with its × or with [`menu Hide`](https://ilpersi.github.io/EasyUOReforged/commands/menu/hide/), it becomes `CLOSED`. It keeps the last value until the next click, so set it to something else before waiting for a click. Comparisons ignore case. ## Example ```euo menu Clear menu Window Size 160 45 menu Button ok 10 10 60 25 OK menu Show set #MenuButton N/A while #MenuButton = N/A wait 1 if #MenuButton = closed display ok You closed the window. else display ok You clicked #MenuButton halt ``` ## 1.5 and 1.6 | | 1.5 | 1.6 | |---|---|---| | A button click | the name in capitals | the name in lower case | | The window's × | `CLOSED` | `CLOSED` for the main window; another [`menu Form`](https://ilpersi.github.io/EasyUOReforged/commands/menu/form/) gives its own name | | [`menu Hide`](https://ilpersi.github.io/EasyUOReforged/commands/menu/hide/) | `CLOSED` | unchanged | | [`menu Clear`](https://ilpersi.github.io/EasyUOReforged/commands/menu/clear/) | unchanged | emptied | | A script starting | unchanged | emptied | In 1.6, setting it to `form0` reads back as `CLOSED`. See [MENU: EasyUO 1.5 and 1.6](https://ilpersi.github.io/EasyUOReforged/commands/menu/versions/). *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* *The EasyUO 1.6 behaviour on this page was researched with help from the [ScriptUO](https://www.scriptuo.com/) community: Gaderian's tutorial [New Menu Code and how to adapt old scripts](https://www.scriptuo.com/index.php?topic=15596.0) and the scripts its members share at scriptuo.com.* --- # #MenuRes > Value read by the last menu Get or menu GetNum. - **Access:** read / write - **Type:** string - **Needs a client:** no - **Set by:** menu Get, menu GetDef, menu GetNum, menu GetProp - **Related:** menu Get, menu GetNum, #MenuButton - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/menures/ `#MenuRes` is the value read from a menu control by the last [`menu Get`](https://ilpersi.github.io/EasyUOReforged/commands/menu/get/) or [`menu GetNum`](https://ilpersi.github.io/EasyUOReforged/commands/menu/getnum/). See `menu Get` for what each kind of control gives. ## Example ```euo menu Clear menu Window Size 180 80 menu Edit name 10 10 150 Bob menu Button ok 10 45 60 25 OK menu Show set #MenuButton N/A while #MenuButton = N/A wait 1 menu Get name display ok The field says #MenuRes halt ``` ## 1.5 and 1.6 - **1.5:** keeps its value from one run to the next. - **1.6:** is emptied when a script starts, and is also set by [`menu GetProp`](https://ilpersi.github.io/EasyUOReforged/commands/menu/getprop/) and [`menu GetDef`](https://ilpersi.github.io/EasyUOReforged/commands/menu/getdef/). *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* *The EasyUO 1.6 behaviour on this page was researched with help from the [ScriptUO](https://www.scriptuo.com/) community: Gaderian's tutorial [New Menu Code and how to adapt old scripts](https://www.scriptuo.com/index.php?topic=15596.0) and the scripts its members share at scriptuo.com.* --- # #MinDmg > Least damage of the weapon in your hands. - **Access:** read-only - **Type:** number - **Needs a client:** yes - **Related:** #MaxDmg, #LHandID, #RHandID - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/mindmg/ `#MinDmg` is the least damage of the weapon you are holding, as the status window shows it; [`#MaxDmg`](https://ilpersi.github.io/EasyUOReforged/variables/maxdmg/) is the most. It is read from your character's status, which the client only has once the status window has been opened. If it reads `N/A`, open the status window once, by hand or with `event Macro 8 2`. It also needs a client with the extended status of Age of Shadows and later; on older clients it reads `N/A`. ## Example ```euo display ok Damage #MinDmg - #MaxDmg halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #MountID > ID of the mount item your character rides, or N/A while it is on foot. - **Access:** read-only - **Type:** id - **Needs a client:** yes - **New in Reforged:** EasyUO 1.5 does not have it. - **Related:** #MountType, #FindID, #FindLayer - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/mountid/ `#MountID` is the ID of the mount item your character wears while it rides, in the same letter format as [`#FindID`](https://ilpersi.github.io/EasyUOReforged/variables/findid/). It reads `N/A` while your character is on foot, and without a client, so `#MountID <> N/A` tells whether you ride. While you ride, the client keeps the mount as an item your character wears in the mount layer (25, see [`#FindLayer`](https://ilpersi.github.io/EasyUOReforged/variables/findlayer/)). The shard puts that item on your character for the ride. On the usual shards it has an ID of its own, so `#MountID` is not the ID the creature had while it stood next to you. [`#MountType`](https://ilpersi.github.io/EasyUOReforged/variables/mounttype/) is its type. ## Example ```euo if #MountID <> N/A display ok You ride the mount item #MountID of type #MountType else display ok You are on foot. halt ``` --- # #MountType > Type of the mount item your character rides, or N/A while it is on foot. - **Access:** read-only - **Type:** id - **Needs a client:** yes - **New in Reforged:** EasyUO 1.5 does not have it. - **Related:** #MountID, #FindType, #FindLayer - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/mounttype/ `#MountType` is the type of the mount item your character wears while it rides, in the same letter format as [`#FindType`](https://ilpersi.github.io/EasyUOReforged/variables/findtype/): for example `OVX` (graphic `0x3EA0`) for a horse. It reads `N/A` while your character is on foot, and without a client. It is the type of the item, not the creature's body type that [`FindItem`](https://ilpersi.github.io/EasyUOReforged/commands/finditem/) shows while the creature stands next to you. Each kind of mount has its own item type. [`#MountID`](https://ilpersi.github.io/EasyUOReforged/variables/mountid/) is the item's ID. ## Example ```euo if #MountType = OVX display ok You ride a horse. halt ``` --- # #MoveRes > How the last moveitem ended: ok, left, refused, nolift, noitem, nodest, held or error. - **Access:** read-only - **Type:** string - **Needs a client:** no - **New in Reforged:** EasyUO 1.5 does not have it. - **Set by:** MoveItem - **Related:** MoveItem, #Result - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/moveres/ `#MoveRes` says how the last [`moveitem`](https://ilpersi.github.io/EasyUOReforged/commands/moveitem/) ended: | Value | Meaning | |---|---| | `ok` | The item is in the destination. | | `left` | It was moved, but the client can't see it in the destination (often a container you haven't opened). | | `refused` | The server refused every drop; the item went back. | | `nolift` | The server never let it be picked up. | | `noitem` | The client doesn't know the item. | | `nodest` | The client doesn't know the destination. | | `held` | Something hung on the cursor. | | `error` | A parameter was missing or wrong. | | `N/A` | No `moveitem` has finished yet in this run. | The [`moveitem`](https://ilpersi.github.io/EasyUOReforged/commands/moveitem/#results) page says where the item is after each of them. Only `left`, `refused` and `ok` sent a drop; `nolift` sent pick-ups but no drop, and the rest sent nothing. Pressing Stop during a `moveitem` leaves it as it was. `#MoveRes` has its own variable so that a `moveitem` doesn't overwrite [`#Result`](https://ilpersi.github.io/EasyUOReforged/variables/result/), which holds what a sub returned. ## Example ```euo set %bag ABCDEFG ; the ID of a bag in your backpack finditem ZLK C_ , #BackpackID ; logs if #FindCnt > 0 { moveitem #FindID %bag if #MoveRes = left event sysmessage Moved, but open the bag to see it. if #MoveRes = nolift || #MoveRes = refused event sysmessage The logs did not move. } halt ``` --- # #NextCPosX > X position where the next container will open. - **Access:** read / write - **Type:** number - **Needs a client:** yes - **Related:** #NextCPosY, NextCPos - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/nextcposx/ `#NextCPosX` is the X position, in the client window, where the next container opens: the backpack, a bag, a chest, the bank box. Set it, together with [`#NextCPosY`](https://ilpersi.github.io/EasyUOReforged/variables/nextcposy/), before opening a container; [`nextcpos`](https://ilpersi.github.io/EasyUOReforged/commands/nextcpos/) sets both at once. > **Note** > > It only works when the client option *Offset interface windows rather than perfectly stacking them* is on. > With the option off, every container opens at the top right of the game window, and `#NextCPosX` and > `#NextCPosY` don't change. ## How the client uses it - A container opens at `#NextCPosX`, `#NextCPosY`. Then the client adds 16 to both, so the next container opens a little lower and to the right of it. - When the container would come within 16 pixels of the right edge of the game window, it opens at X 16 instead, and `#NextCPosX` then reads 32. - A container that is already open normally just comes to the front, where it is. - The paperdoll and the other gumps don't use it. The values only change when the option is on, so a script can tell whether it is: read them before and after opening a container (the [`nextcpos`](https://ilpersi.github.io/EasyUOReforged/commands/nextcpos/) page has an example). ## Example ```euo set #NextCPosX 10 set #NextCPosY 10 msg bank$ ; the bank box opens at 10,10 halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #NextCPosY > Y position where the next container will open. - **Access:** read / write - **Type:** number - **Needs a client:** yes - **Related:** #NextCPosX, NextCPos - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/nextcposy/ `#NextCPosY` is the Y position, in the client window, where the next container opens: the backpack, a bag, a chest, the bank box. Set it, together with [`#NextCPosX`](https://ilpersi.github.io/EasyUOReforged/variables/nextcposx/), before opening a container; [`nextcpos`](https://ilpersi.github.io/EasyUOReforged/commands/nextcpos/) sets both at once. > **Note** > > It only works when the client option *Offset interface windows rather than perfectly stacking them* is on. > With the option off, every container opens at the top right of the game window, and `#NextCPosX` and > `#NextCPosY` don't change. ## How the client uses it - A container opens at `#NextCPosX`, `#NextCPosY`. Then the client adds 16 to both, so the next container opens a little lower and to the right of it. - When the container would come within 16 pixels of the bottom edge of the game window, it opens at Y 16 instead, and `#NextCPosY` then reads 32. - A container that is already open normally just comes to the front, where it is. - The paperdoll and the other gumps don't use it. The values only change when the option is on, so a script can tell whether it is: read them before and after opening a container (the [`nextcpos`](https://ilpersi.github.io/EasyUOReforged/commands/nextcpos/) page has an example). ## Example ```euo set #NextCPosX 10 set #NextCPosY 10 msg bank$ ; the bank box opens at 10,10 halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #NSName > Name of the current namespace; std when the script starts. - **Access:** read-only - **Type:** string - **Needs a client:** no - **Related:** #NSType, Namespace - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/nsname/ `#NSName` is the name of the current [namespace](https://ilpersi.github.io/EasyUOReforged/commands/namespace/), the one `!` variables belong to. A script starts in `std`. [`#NSType`](https://ilpersi.github.io/EasyUOReforged/variables/nstype/) says whether it is local or global. ## Example ```euo if #NSName <> test { namespace push namespace local test } display ok Now in #NSName namespace pop halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #NSType > Whether the current namespace is local or global. - **Access:** read-only - **Type:** string - **Needs a client:** no - **Related:** #NSName, namespace local, namespace global - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/nstype/ `#NSType` is `local` when the current [namespace](https://ilpersi.github.io/EasyUOReforged/commands/namespace/) is private to this script, and `global` when it is shared with every running script. ## Example ```euo namespace global shared if #NSType = global display ok Writing to a shared namespace. halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #Opts > Active options: always SYS, EXEC and SEND, plus DMC when Don’t Move Cursor is on. - **Access:** read-only - **Type:** string - **Needs a client:** no - **Related:** Click, Execute, Send - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/opts/ `#Opts` lists the active EasyUO options, separated by `_`: | Option | Meaning | |---|---| | `SYS` | [`event SysMessage`](https://ilpersi.github.io/EasyUOReforged/commands/event/sysmessage/) is allowed. | | `DMC` | *Tools → Don't Move Cursor* is on: [`click`](https://ilpersi.github.io/EasyUOReforged/commands/click/) does not move the real cursor. | | `EXEC` | [`execute`](https://ilpersi.github.io/EasyUOReforged/commands/execute/) is allowed. | | `SEND` | [`send`](https://ilpersi.github.io/EasyUOReforged/commands/send/) is allowed. | In EasyUO Reforged `SYS`, `EXEC` and `SEND` are always on, so `#Opts` is `SYS_DMC_EXEC_SEND` with *Don't Move Cursor* on (the default) and `SYS_EXEC_SEND` with it off. ## Example ```euo if DMC notin #Opts display ok This script works best with Don't Move Cursor turned on. halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #OSVer > Windows version, as platform_major_minor. - **Access:** read-only - **Type:** string - **Needs a client:** no - **Related:** #ReforgedVer - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/osver/ `#OSVer` is the version of Windows, written `platform_major_minor`, for example `2_6_2`. `2` is the Windows NT family. Windows may report an older version number than the one installed, for compatibility. *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #PathCnt > Number of steps of the route the last path find planned. - **Access:** read-only - **Type:** number - **Needs a client:** no - **New in Reforged:** EasyUO 1.5 does not have it. - **Set by:** path Find, path Go, Path, path Step, path Walk - **Related:** path find, path get, #PathState - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/pathcnt/ `#PathCnt` is the number of steps of the route the last [`path find`](https://ilpersi.github.io/EasyUOReforged/commands/path/find/) planned: the steps [`path get`](https://ilpersi.github.io/EasyUOReforged/commands/path/get/) can load, from `1` to `#PathCnt`. It is `0` when no route was found (see [`#PathState`](https://ilpersi.github.io/EasyUOReforged/variables/pathstate/)) and when you are already at the goal. ## Example ```euo path find 1823 2821 display ok Trinsic is #PathCnt steps away halt ``` --- # #PathDir > Direction of a step of the planned route, 0 (north) to 7, or 8 for a link. - **Access:** read-only - **Type:** number - **Needs a client:** no - **New in Reforged:** EasyUO 1.5 does not have it. - **Set by:** path Check, path Find, path Get, path Go, Path, path Step, path Walk - **Related:** #PathX, path get, path link, #CharDir - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/pathdir/ `#PathDir` is the direction of a step of the planned route, numbered as [`#CharDir`](https://ilpersi.github.io/EasyUOReforged/variables/chardir/): | Value | Direction | Value | Direction | |---|---|---|---| | 0 | North | 4 | South | | 1 | North-east | 5 | South-west | | 2 | East | 6 | West | | 3 | South-east | 7 | North-west | `8` marks a step through a [`path link`](https://ilpersi.github.io/EasyUOReforged/commands/path/link/) (a teleporter, a gate). `-1` means there is no step: before any route, when the route has no steps, or after [`path can`](https://ilpersi.github.io/EasyUOReforged/commands/path/can/). See [`#PathX`](https://ilpersi.github.io/EasyUOReforged/variables/pathx/) for which step it is after each `path` command. > **Note** > > [`event Macro 5`](https://ilpersi.github.io/EasyUOReforged/commands/event/macro/) (walk) numbers directions differently: its `0` is north-west. Add > 1 to `#PathDir`, and take 8 back to 0, to get the macro's number. ## Example ```euo path find 1823 2821 path get 1 display ok The first step goes #PathDir halt ``` --- # #PathState > How the last path command went: ok, how a walk ended, a reason no route was found, or the error. - **Access:** read-only - **Type:** string - **Needs a client:** no - **New in Reforged:** EasyUO 1.5 does not have it. - **Set by:** path Avoid, path Block, path Can, path Check, path Clear, path Find, path From, path Get, path Go, Path, path Link, path Set, path Step, path Stop, path Unblock, path Walk - **Related:** Path, path find, path go, path step, #PathCnt - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/pathstate/ `#PathState` says how the last [`path`](https://ilpersi.github.io/EasyUOReforged/commands/path/) command went: | Value | Meaning | |---|---| | `ok` | It worked. After [`path find`](https://ilpersi.github.io/EasyUOReforged/commands/path/find/): a route was found. | | `nopath` | There is no way to the goal. | | `budget` | The search looked at `maxnodes` places without finding a way (see [`path set`](https://ilpersi.github.io/EasyUOReforged/commands/path/set/)). | | `timeout` | The search took longer than `timeout`, or a walk ran out of its timeout. | | `stopped` | You pressed Stop during the search or the walk, or [`path stop`](https://ilpersi.github.io/EasyUOReforged/commands/path/stop/) ended the walk. | | `blocked` | [`path can`](https://ilpersi.github.io/EasyUOReforged/commands/path/can/): nothing to stand on there. A walk: the way was cut, and no other route was found. | | `walking` | [`path step`](https://ilpersi.github.io/EasyUOReforged/commands/path/step/): the walk goes on. | | `arrived` | A walk got there. | | `failed` | A walk couldn't get on: the character stood still for 15 seconds, got no closer to the goal for 30, or every step was refused. | | `link` | A walk stopped on the start of a link it can't use by itself, a gate or a ladder. | | `noclient` | No client is attached, and no [`path from`](https://ilpersi.github.io/EasyUOReforged/commands/path/from/) is set. | | `nomap` | The client's folder lacks the map files of this facet. | | `error: …` | The arguments are wrong; the rest says what. | It reads `N/A` until the script runs its first `path` command. A `path` line never stops the script, so check `#PathState` after the commands that matter. ## Example ```euo path find 1434 1699 if #PathState <> ok display ok No route: #PathState halt ``` --- # #PathX > X position of a step of the planned route: the last one after path find, step n after path get. - **Access:** read-only - **Type:** number - **Needs a client:** no - **New in Reforged:** EasyUO 1.5 does not have it. - **Set by:** path Can, path Check, path Find, path Get, path Go, Path, path Step, path Walk - **Related:** #PathY, #PathZ, #PathDir, path get - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/pathx/ `#PathX` is the X position of a step of the planned route, with [`#PathY`](https://ilpersi.github.io/EasyUOReforged/variables/pathy/), [`#PathZ`](https://ilpersi.github.io/EasyUOReforged/variables/pathz/) and [`#PathDir`](https://ilpersi.github.io/EasyUOReforged/variables/pathdir/): - after [`path find`](https://ilpersi.github.io/EasyUOReforged/commands/path/find/), the last step: where the route ends; - after [`path get`](https://ilpersi.github.io/EasyUOReforged/commands/path/get/) `n`, step `n`; - after [`path can`](https://ilpersi.github.io/EasyUOReforged/commands/path/can/), the place checked. ## Example ```euo path set accuracy 2 path find 1434 1699 display ok The route ends at #PathX #PathY halt ``` --- # #PathY > Y position of a step of the planned route: the last one after path find, step n after path get. - **Access:** read-only - **Type:** number - **Needs a client:** no - **New in Reforged:** EasyUO 1.5 does not have it. - **Set by:** path Can, path Check, path Find, path Get, path Go, Path, path Step, path Walk - **Related:** #PathX, #PathZ, #PathDir, path get - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/pathy/ `#PathY` is the Y position of a step of the planned route. See [`#PathX`](https://ilpersi.github.io/EasyUOReforged/variables/pathx/) for which step it is after each `path` command. ## Example ```euo path find 1434 1699 path get 1 display ok First step: #PathX #PathY halt ``` --- # #PathZ > Height of a step of the planned route, or where path can found a place to stand. - **Access:** read-only - **Type:** number - **Needs a client:** no - **New in Reforged:** EasyUO 1.5 does not have it. - **Set by:** path Can, path Check, path Find, path Get, path Go, Path, path Step, path Walk - **Related:** #PathX, #PathY, path can, #CharPosZ - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/pathz/ `#PathZ` is the height a character stands at after a step of the planned route, as [`#CharPosZ`](https://ilpersi.github.io/EasyUOReforged/variables/charposz/) would show it there. See [`#PathX`](https://ilpersi.github.io/EasyUOReforged/variables/pathx/) for which step it is after each `path` command. After [`path can`](https://ilpersi.github.io/EasyUOReforged/commands/path/can/) it is the height of the place to stand that was found, `0` when there is none. Give it to [`event PathFind`](https://ilpersi.github.io/EasyUOReforged/commands/event/pathfind/), which needs the right height to walk upstairs. ## Example ```euo path find 1434 1699 path get 10 event PathFind #PathX #PathY #PathZ halt ``` --- # #PixCol > Colour of the pixel last read by savepix, a $BBGGRR number. - **Access:** read-only - **Type:** number - **Needs a client:** yes - **Set by:** SavePix - **Related:** SavePix, CmpPix - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/pixcol/ `#PixCol` is the colour of the pixel last read by [`savepix`](https://ilpersi.github.io/EasyUOReforged/commands/savepix/). The colour is a number in Windows' `$BBGGRR` order: blue, green, red, each from `$00` to `$FF`. It reads as an ordinary number, so compare it with `$` numbers: `#PixCol = $0000FF` is pure red. Pixels are read from the screen, so the client window has to be visible, and the same spot can give slightly different values on different computers. ## Example ```euo savepix 100 100 1 if #PixCol = $000000 display ok Black. halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #PR > Your character’s poison resistance. - **Access:** read-only - **Type:** number - **Needs a client:** yes - **Related:** #AR, #FR, #CR, #ER - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/pr/ `#PR` is your character's poison resistance. It is read from your character's status, which the client only has once the status window has been opened. If it reads `N/A`, open the status window once, by hand or with `event Macro 8 2`. It also needs a client with the extended status of Age of Shadows and later; on older clients it reads `N/A`. ## Example ```euo display ok My poison resist is #PR halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #Property > Property tooltip read by the last event Property; lines end with $. - **Access:** read-only - **Type:** string - **Needs a client:** yes - **Set by:** event Property - **Related:** event Property - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/property/ `#Property` is the property tooltip read by the last [`event Property`](https://ilpersi.github.io/EasyUOReforged/commands/event/property/): the item's name first, then its properties, each line ending with `$`. For a blessed runebook, for example, it reads `Runebook$Blessed$`. Spaces in it are real spaces, not `_` as in [`#Journal`](https://ilpersi.github.io/EasyUOReforged/variables/journal/), so write [`#SPC`](https://ilpersi.github.io/EasyUOReforged/variables/spc/) for them; [`str`](https://ilpersi.github.io/EasyUOReforged/commands/str/#spaces-and-_) shows how to take it apart. ## Example ```euo finditem ZBN C_ , #BackpackID ; a runebook event Property #FindID if Blessed in #Property display ok It is blessed. halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #Random > A new random number from 0 to 999 each time it is read. - **Access:** read-only - **Type:** number - **Needs a client:** no - **Related:** wait - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/random/ `#Random` is a random whole number from `0` to `999`, different each time you read it. Use `%` (remainder) to bring it into a range. ## Example ```euo set %a #Random % 100 ; 0 to 99 set %b #Random % 8 + 3 ; 3 to 10 display ok %a and %b halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #ReforgedVer > Build version of EasyUO Reforged, such as 26.10.22.3c144de. - **Access:** read-only - **Type:** string - **Needs a client:** no - **New in Reforged:** EasyUO 1.5 does not have it. - **Related:** #EUOVer - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/reforgedver/ `#ReforgedVer` is the version of the EasyUO Reforged build running the script: the build date and the git commit it was built from, `YY.MM.DD.`, for example `26.10.22.3c144de`. The window title and **Help → About** show the same value. [`#EUOVer`](https://ilpersi.github.io/EasyUOReforged/variables/euover/) still returns the original `1_50_00`, so existing version checks keep working. Use `#ReforgedVer` when a script needs to know it runs on Reforged, or which build. ## Example ```euo if #ReforgedVer = N/A display ok This script needs EasyUO Reforged. halt ``` --- # #Result > Value given to the last return; N/A when it had none. - **Access:** read / write - **Type:** string - **Needs a client:** no - **Related:** Return, Gosub - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/result/ `#Result` is the value the last [`return`](https://ilpersi.github.io/EasyUOReforged/commands/return/) gave back from a sub, or `N/A` when that `return` had no value. A `return` outside a sub leaves it as it was. ## Example ```euo gosub double 21 display ok #Result ; 42 halt sub double return %1 * 2 ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #RHandID > ID of the item for the right hand; set it, then event Macro 24 2 arms it. - **Access:** read / write - **Type:** id - **Needs a client:** yes - **Related:** #LHandID, event Macro, exevent Equip - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/rhandid/ `#RHandID` is the ID of the item the client arms in your right hand (a one-handed weapon) with the *Arm/Disarm* macro, [`event Macro 24 2`](https://ilpersi.github.io/EasyUOReforged/commands/event/macro/). With your right hand empty, the macro equips the item with this ID. With something in your right hand, the macro saves that item's ID here and takes it off, so running the macro again puts it back. To arm a given item, set `#RHandID` to it and run the macro with your right hand empty. With the hand empty and no ID set, the client says "You must first disarm a weapon in order to arm one." The value lives in the client: setting it changes it for every script attached to that client. ## Example ```euo set %sword ABCDEFG ; your sword's ID set #RHandID %sword event Macro 24 2 halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #SCnt > A seconds counter; set it to start counting from that value. - **Access:** read / write - **Type:** number - **Needs a client:** no - **Related:** #SCnt2, #SysTime - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/scnt/ `#SCnt` counts seconds. Read alone it is the time since Windows started, but setting it makes it count on from the value you set, which turns it into a stopwatch. [`#SCnt2`](https://ilpersi.github.io/EasyUOReforged/variables/scnt2/) counts tenths of seconds. ## Example ```euo set #SCnt 0 wait 3s display ok That took #SCnt seconds halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #SCnt2 > A tenths-of-a-second counter; set it to start counting from that value. - **Access:** read / write - **Type:** number - **Needs a client:** no - **Related:** #SCnt, #SysTime - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/scnt2/ `#SCnt2` counts tenths of seconds. Like [`#SCnt`](https://ilpersi.github.io/EasyUOReforged/variables/scnt/), it counts from Windows' start until you set it, then on from the value you set. ## Example ```euo set #SCnt2 0 wait 3s display ok That took #SCnt2 tenths of a second halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #SendHeader > Extra HTTP header lines for send; end each line with $. - **Access:** read / write - **Type:** string - **Needs a client:** no - **Related:** Send - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/sendheader/ `#SendHeader` adds lines to the header of the HTTP request [`send`](https://ilpersi.github.io/EasyUOReforged/commands/send/) makes. End each line with `$`. Without any `$`, nothing is added. Use `debughttppost` with `send` to see the request that goes out. ## Example ```euo set %name Bob set #SendHeader User-Agent: , #spc , EasyUO$ send httppost www.example.com /euo/action.php name=%name halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #Sex > Your character’s sex: 0 male, 1 female. - **Access:** read-only - **Type:** number - **Needs a client:** yes - **Related:** #CharStatus, #CharType - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/sex/ `#Sex` is `0` when your character is male and `1` when female. It is read from your character's status, which the client only has once the status window has been opened. If it reads `N/A`, open the status window once, by hand or with `event Macro 8 2`. ## Example ```euo if #Sex = 1 display ok Lady #CharName halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #Shard > Name of the shard the client is logged in to. - **Access:** read-only - **Type:** string - **Needs a client:** yes - **Related:** #LShard, #CharName - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/shard/ `#Shard` is the name of the shard the client is logged in to. Spaces in the name stay spaces. ## Example ```euo if Atlantic in #Shard display ok Welcome to Atlantic. halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #ShopCnt > Number of entries in the shop gump. - **Access:** read-only - **Type:** number - **Needs a client:** yes - **Set by:** GetShopInfo - **Related:** #ShopCurPos, GetShopInfo - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/shopcnt/ `#ShopCnt` is the number of entries in the shop gump. It is filled by [`getshopinfo`](https://ilpersi.github.io/EasyUOReforged/commands/getshopinfo/) from the entry shown at the top of the shop gump, and does not follow the gump: after scrolling, run `getshopinfo` again. *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #ShopCurPos > Position of the shop entry shown at the top, counting from 1. - **Access:** read-only - **Type:** number - **Needs a client:** yes - **Set by:** GetShopInfo - **Related:** #ShopCnt, GetShopInfo - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/shopcurpos/ `#ShopCurPos` is the position of the entry shown at the top of the shop gump, from `1` to [`#ShopCnt`](https://ilpersi.github.io/EasyUOReforged/variables/shopcnt/). It is filled by [`getshopinfo`](https://ilpersi.github.io/EasyUOReforged/commands/getshopinfo/) from the entry shown at the top of the shop gump, and does not follow the gump: after scrolling, run `getshopinfo` again. *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #ShopItemID > ID of the shop entry’s item, for setshopitem. - **Access:** read-only - **Type:** id - **Needs a client:** yes - **Set by:** GetShopInfo - **Related:** GetShopInfo, SetShopItem, #ShopItemType - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/shopitemid/ `#ShopItemID` is the ID of the item in the shop entry: what [`setshopitem`](https://ilpersi.github.io/EasyUOReforged/commands/setshopitem/) needs. It is filled by [`getshopinfo`](https://ilpersi.github.io/EasyUOReforged/commands/getshopinfo/) from the entry shown at the top of the shop gump, and does not follow the gump: after scrolling, run `getshopinfo` again. ## Example ```euo getshopinfo setshopitem #ShopItemID 10 halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #ShopItemMax > How many of the shop entry’s item the vendor has. - **Access:** read-only - **Type:** number - **Needs a client:** yes - **Set by:** GetShopInfo - **Related:** GetShopInfo, SetShopItem - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/shopitemmax/ `#ShopItemMax` is how many of the item the vendor has, the most you can buy. It is filled by [`getshopinfo`](https://ilpersi.github.io/EasyUOReforged/commands/getshopinfo/) from the entry shown at the top of the shop gump, and does not follow the gump: after scrolling, run `getshopinfo` again. ## Example ```euo getshopinfo setshopitem #ShopItemID #ShopItemMax ; buy them all halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #ShopItemName > Name of the shop entry shown at the top of the shop gump. - **Access:** read-only - **Type:** string - **Needs a client:** yes - **Set by:** GetShopInfo - **Related:** GetShopInfo, #ShopItemPrice, #ShopItemID - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/shopitemname/ `#ShopItemName` is the name of the item in the shop entry. Spaces read as `_`. It is filled by [`getshopinfo`](https://ilpersi.github.io/EasyUOReforged/commands/getshopinfo/) from the entry shown at the top of the shop gump, and does not follow the gump: after scrolling, run `getshopinfo` again. ## Example ```euo getshopinfo display ok #ShopItemName costs #ShopItemPrice gold - #ShopItemMax available halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #ShopItemPrice > Price of the shop entry shown at the top of the shop gump. - **Access:** read-only - **Type:** number - **Needs a client:** yes - **Set by:** GetShopInfo - **Related:** GetShopInfo, #ShopItemName - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/shopitemprice/ `#ShopItemPrice` is the price of one item of the shop entry, in gold. It is filled by [`getshopinfo`](https://ilpersi.github.io/EasyUOReforged/commands/getshopinfo/) from the entry shown at the top of the shop gump, and does not follow the gump: after scrolling, run `getshopinfo` again. ## Example ```euo getshopinfo display ok #ShopItemName costs #ShopItemPrice gold - #ShopItemMax available halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #ShopItemType > Type of the shop entry’s item. - **Access:** read-only - **Type:** id - **Needs a client:** yes - **Set by:** GetShopInfo - **Related:** GetShopInfo, #ShopItemID, #FindType - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/shopitemtype/ `#ShopItemType` is the item type of the shop entry, in the same form as [`#FindType`](https://ilpersi.github.io/EasyUOReforged/variables/findtype/), so you can recognise an item whatever its name. It is filled by [`getshopinfo`](https://ilpersi.github.io/EasyUOReforged/commands/getshopinfo/) from the entry shown at the top of the shop gump, and does not follow the gump: after scrolling, run `getshopinfo` again. ## Example ```euo getshopinfo if #ShopItemType = ZLF ; bandages setshopitem #ShopItemID 50 halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #Skill > Value of the skill chosen with chooseskill, in tenths (700 = 70.0). - **Access:** read-only - **Type:** number - **Needs a client:** yes - **Set by:** ChooseSkill - **Related:** ChooseSkill, #SkillCap, #SkillLock - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/skill/ `#Skill` is the value of the skill, in tenths: `700` is 70.0. It describes the skill selected with [`chooseskill`](https://ilpersi.github.io/EasyUOReforged/commands/chooseskill/), and is read from the client each time you use it. With `chooseskill … real` it is the base value, without bonuses. ## Example ```euo chooseskill anim if #Skill < 1000 display ok Tame bulls. else display ok Tame ridgebacks. halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #SkillCap > Cap of the skill chosen with chooseskill, in tenths. - **Access:** read-only - **Type:** number - **Needs a client:** yes - **Set by:** ChooseSkill - **Related:** ChooseSkill, #Skill - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/skillcap/ `#SkillCap` is the most the skill can reach, in tenths: `1000` is 100.0. It describes the skill selected with [`chooseskill`](https://ilpersi.github.io/EasyUOReforged/commands/chooseskill/), and is read from the client each time you use it. ## Example ```euo chooseskill mage if #Skill >= #SkillCap halt ; nothing left to train display ok Magery #Skill of #SkillCap - keep training. halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #SkillLock > Lock of the skill chosen with chooseskill: up, down or locked. - **Access:** read-only - **Type:** string - **Needs a client:** yes - **Set by:** ChooseSkill - **Related:** ChooseSkill, exevent SkillLock - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/skilllock/ `#SkillLock` is the lock of the skill: `up`, `down` or `locked`. It describes the skill selected with [`chooseskill`](https://ilpersi.github.io/EasyUOReforged/commands/chooseskill/), and is read from the client each time you use it. Change it with [`exevent SkillLock`](https://ilpersi.github.io/EasyUOReforged/commands/exevent/skilllock/). ## Example ```euo chooseskill taming if #SkillLock = locked exevent SkillLock taming up halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #SMC > A semicolon, which could not be typed directly because ; starts a comment. - **Access:** read-only - **Type:** string - **Needs a client:** no - **Related:** #SPC, #DOT - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/smc/ `#SMC` is a semicolon (`;`). A `;` typed in a line starts a comment, so use `#SMC` when the text needs one. ## Example ```euo set %text one , #SMC , two ; one;two display ok %text halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #SPC > A space; glue it between words with commas. - **Access:** read-only - **Type:** string - **Needs a client:** no - **Related:** #SMC, #DOT, Set - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/spc/ `#SPC` is a single space. Values are one word each, so glue words together with commas and `#SPC`: ## Example ```euo set %name Sir , #SPC , Robin display ok Hello , #SPC , %name halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #SqlChanges > Rows changed by the last sql exec or query, or variables handled by save / load / delete. - **Access:** read-only - **Type:** number - **Needs a client:** no - **New in Reforged:** EasyUO 1.5 does not have it. - **Set by:** sql Delete, sql Exec, SQL, sql Load, sql Query, sql Save - **Related:** sql exec, #SqlRes, #SqlLastID - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/sqlchanges/ `#SqlChanges` is the number of rows inserted, updated or deleted by the last [`sql exec`](https://ilpersi.github.io/EasyUOReforged/commands/sql/exec/) or [`sql query`](https://ilpersi.github.io/EasyUOReforged/commands/sql/query/). After [`sql save`](https://ilpersi.github.io/EasyUOReforged/commands/sql/save/), [`sql load`](https://ilpersi.github.io/EasyUOReforged/commands/sql/load/) or [`sql delete`](https://ilpersi.github.io/EasyUOReforged/commands/sql/delete/) it is the number of variables saved, found or removed. ## Example ```euo sql open :memory: sql exec CREATE TABLE loot(item TEXT, at INTEGER) sql exec INSERT INTO loot VALUES('gold', 100), ('gem', 200), ('arrow', 300) set %cutoff 250 sql exec DELETE FROM loot WHERE at < %cutoff display ok Removed #SqlChanges old entries. halt ``` --- # #SqlCnt > Number of rows the last sql query returned. - **Access:** read-only - **Type:** number - **Needs a client:** no - **New in Reforged:** EasyUO 1.5 does not have it. - **Set by:** sql Close, SQL, sql Open, sql Query - **Related:** sql query, sql row, #SqlRes - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/sqlcnt/ `#SqlCnt` is the number of rows kept by the last [`sql query`](https://ilpersi.github.io/EasyUOReforged/commands/sql/query/). Load any of them with [`sql row`](https://ilpersi.github.io/EasyUOReforged/commands/sql/row/) `1` … `#SqlCnt`. Only `sql query`, `sql open` and `sql close` change it, so you can run `sql exec` inside a loop over the rows. ## Example ```euo sql open :memory: sql exec CREATE TABLE pets(name TEXT, hp INTEGER) sql exec INSERT INTO pets VALUES('Rex', 80), ('Buttercup', 45) sql query SELECT name, hp FROM pets ORDER BY hp for %i 1 #SqlCnt { sql row %i display ok %name has %hp hp } halt ``` --- # #SqlLastID > Rowid of the last row inserted on this connection. - **Access:** read-only - **Type:** number - **Needs a client:** no - **New in Reforged:** EasyUO 1.5 does not have it. - **Set by:** sql Exec, SQL - **Related:** sql exec, #SqlChanges - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/sqllastid/ `#SqlLastID` is the rowid of the last row inserted through the script tab's database connection. Use it to link a new row to others, for example in a second table. ## Example ```euo sql open :memory: sql exec CREATE TABLE trips(started INTEGER) sql exec CREATE TABLE loot(trip INTEGER, item TEXT) sql exec INSERT INTO trips(started) VALUES(#SysTime) set %trip #SqlLastID set %item gold sql exec INSERT INTO loot(trip, item) VALUES(%trip, %item) display ok Trip %trip found %item halt ``` --- # #SqlRes > OK after a successful sql command, otherwise the error text. - **Access:** read-only - **Type:** string - **Needs a client:** no - **New in Reforged:** EasyUO 1.5 does not have it. - **Set by:** sql Close, sql Delete, sql Exec, SQL, sql Load, sql Open, sql Query, sql Row, sql Save - **Related:** SQL, #SqlCnt, #SqlChanges - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/sqlres/ `#SqlRes` is `OK` after a successful [`sql`](https://ilpersi.github.io/EasyUOReforged/commands/sql/) command. Otherwise it holds the error: `no database open`, `SQLite library not available`, `interrupted` (the script was stopped during a query), `database is locked`, or SQLite's own message such as `no such table: pets`. It reads `N/A` until the script runs its first `sql` command. An `sql` line never stops the script. When something goes wrong, `#SqlRes` says what, and the script goes on with the next line, so check it after any command that matters. ## Example ```euo sql open mychar.db sql exec CREATE TABLE IF NOT EXISTS pets(id TEXT PRIMARY KEY, name TEXT) if #SqlRes <> OK display ok SQL error: #SqlRes halt ``` --- # #Stamina > Your character’s current stamina. - **Access:** read-only - **Type:** number - **Needs a client:** yes - **Related:** #MaxStam, #Hits - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/stamina/ `#Stamina` is your character's current stamina; [`#MaxStam`](https://ilpersi.github.io/EasyUOReforged/variables/maxstam/) is the most it can have. It is read from your character's status, which the client only has once the status window has been opened. If it reads `N/A`, open the status window once, by hand or with `event Macro 8 2`. ## Example ```euo if #Stamina < 10 wait 5s display ok Stamina: #Stamina halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #Str > Your character’s strength. - **Access:** read-only - **Type:** number - **Needs a client:** yes - **Related:** #Dex, #Int, #MaxStats - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/str/ `#Str` is your character's strength. It is read from your character's status, which the client only has once the status window has been opened. If it reads `N/A`, open the status window once, by hand or with `event Macro 8 2`. ## Example ```euo display ok My strength is #Str halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #StrRes > Result of the last str command; also set by getuotitle. - **Access:** read / write - **Type:** string - **Needs a client:** no - **Set by:** GetUOTitle, Str - **Related:** Str, GetUOTitle - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/strres/ `#StrRes` is the result of the last [`str`](https://ilpersi.github.io/EasyUOReforged/commands/str/) command, or `N/A` when that command was missing parameters. [`getuotitle`](https://ilpersi.github.io/EasyUOReforged/commands/getuotitle/) also puts the client window's title here. ## Example ```euo str len #CharName display ok My name has #StrRes letters halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #SysMsg > The last system message the client showed. - **Access:** read-only - **Type:** string - **Needs a client:** yes - **Related:** #Journal, ScanJournal - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/sysmsg/ `#SysMsg` is the last system message the client showed, the text at the bottom left of the game window. Spaces read as `_`. For a full history, use the journal with [`scanjournal`](https://ilpersi.github.io/EasyUOReforged/commands/scanjournal/). ## Example ```euo if too_far_away in #SysMsg display ok Move closer. halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #SysMsgCol > Colour that event SysMessage writes in. - **Access:** read / write - **Type:** number - **Needs a client:** no - **Related:** event SysMessage - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/sysmsgcol/ `#SysMsgCol` is the colour (hue) [`event SysMessage`](https://ilpersi.github.io/EasyUOReforged/commands/event/sysmessage/) writes in. It is a script setting, not a client value: change it before `event SysMessage` to colour the message. `0` is the default. ## Example ```euo set #SysMsgCol 33 event SysMessage Low on reagents! set #SysMsgCol 0 halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #SysTime > Milliseconds since 1 January 1980 UTC; for timing. - **Access:** read-only - **Type:** number - **Needs a client:** no - **Related:** #SCnt, #SCnt2, #Time - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/systime/ `#SysTime` is the number of milliseconds since 1 January 1980, in UTC. It does not depend on the time zone, so it is the most precise way to time something: read it before and after, and subtract. ## Example ```euo set %start #SysTime wait 2s set %took #SysTime - %start display ok That took %took ms halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #TargCurs > 1 while a target cursor is showing; set it to 1 to let the user pick a target. - **Access:** read / write - **Type:** boolean - **Needs a client:** yes - **Related:** Target, #LTargetID, #LTargetKind - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/targcurs/ `#TargCurs` is `1` while the client shows a target cursor and `0` otherwise. [`target`](https://ilpersi.github.io/EasyUOReforged/commands/target/) waits for it to become `1`. Setting it to `1` shows a target cursor yourself. Whatever the user then clicks lands in [`#LTargetID`](https://ilpersi.github.io/EasyUOReforged/variables/ltargetid/) (and [`#LTargetKind`](https://ilpersi.github.io/EasyUOReforged/variables/ltargetkind/)), without targeting anything in the game: a simple way for a script to ask "which item?". ## Example ```euo event SysMessage Click the item to use. set #TargCurs 1 while #TargCurs = 1 wait 1 set %item #LTargetID display ok You chose %item halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #TileCnt > Number of tiles at a map position, from tile cnt. - **Access:** read-only - **Type:** number - **Needs a client:** yes - **Set by:** Tile - **Related:** Tile, #TileType - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/tilecnt/ `#TileCnt` is the number of tiles at the position asked with [`tile cnt`](https://ilpersi.github.io/EasyUOReforged/commands/tile/): the ground and every static on it. `tile get` reads them one by one, from `1` to `#TileCnt`. It is `0` before `tile init`. *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #TileFlags > Properties of the tile read by tile get, as names joined by _. - **Access:** read-only - **Type:** string - **Needs a client:** yes - **Set by:** Tile - **Related:** Tile, #TileName - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/tileflags/ `#TileFlags` lists the properties of the tile as names joined by `_`, for example `Impassable_Surface`. It is filled by [`tile get`](https://ilpersi.github.io/EasyUOReforged/commands/tile/) for the tile asked for. Test a property with `in`. The possible names are: `Background`, `Weapon`, `Transparent`, `Translucent`, `Wall`, `Damaging`, `Impassable`, `Wet`, `Unknown`, `Surface`, `Bridge`, `GenericStackable`, `Window`, `NoShoot`, `PrefixA`, `PrefixAn`, `Internal`, `Foliage`, `PartialHue`, `Unknown1`, `Map`, `Container`, `Wearable`, `LightSource`, `Animated`, `NoDiagonal`, `Unknown2`, `Armor`, `Roof`, `Door`, `StairBack`, `StairRight`. ## Example ```euo set %x #CharPosX set %y #CharPosY - 1 ; the tile north of you tile init tile get %x %y 1 if Impassable in #TileFlags display ok Cannot walk there. halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #TileName > Name of the tile read by tile get, such as tree or water. - **Access:** read-only - **Type:** string - **Needs a client:** yes - **Set by:** Tile - **Related:** Tile, #TileType, #TileFlags - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/tilename/ `#TileName` is the name the client's data gives the tile, such as `tree` or `water`. Spaces read as `_`. It is filled by [`tile get`](https://ilpersi.github.io/EasyUOReforged/commands/tile/) for the tile asked for. ## Example ```euo tile init tile cnt #CharPosX #CharPosY tile get #CharPosX #CharPosY 1 display ok You stand on #TileName halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #TileType > Graphic number of the tile read by tile get. - **Access:** read-only - **Type:** number - **Needs a client:** yes - **Set by:** Tile - **Related:** Tile, #TileName, #LTargetTile - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/tiletype/ `#TileType` is the graphic number of the tile. It is filled by [`tile get`](https://ilpersi.github.io/EasyUOReforged/commands/tile/) for the tile asked for. It is the same number [`#LTargetTile`](https://ilpersi.github.io/EasyUOReforged/variables/ltargettile/) uses, so it identifies trees, rocks and water for resource gathering. *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #TileZ > Height of the tile read by tile get. - **Access:** read-only - **Type:** number - **Needs a client:** yes - **Set by:** Tile - **Related:** Tile, #TileType - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/tilez/ `#TileZ` is the height (Z) of the tile. It is filled by [`tile get`](https://ilpersi.github.io/EasyUOReforged/commands/tile/) for the tile asked for. *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #Time > Local time of the computer as hhmmss, 24-hour clock. - **Access:** read-only - **Type:** string - **Needs a client:** no - **Related:** #Date, #SysTime - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/time/ `#Time` is the computer's local time, written `hhmmss` on a 24-hour clock: `143005` is 14:30:05. [`#Date`](https://ilpersi.github.io/EasyUOReforged/variables/date/) is the date; [`#SysTime`](https://ilpersi.github.io/EasyUOReforged/variables/systime/) is better for measuring durations. ## Example ```euo if #Time >= 120000 && #Time < 130000 display ok Lunch time. halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #TP > Your character’s tithing points. - **Access:** read-only - **Type:** number - **Needs a client:** yes - **Related:** #Mana - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/tp/ `#TP` is your character's tithing points, used by Chivalry spells. It is read from your character's status, which the client only has once the status window has been opened. If it reads `N/A`, open the status window once, by hand or with `event Macro 8 2`. It also needs a client with the extended status of Age of Shadows and later; on older clients it reads `N/A`. ## Example ```euo display ok I have #TP tithing points halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #True > The value true: -1. - **Access:** read-only - **Type:** boolean - **Needs a client:** no - **Related:** #False, If - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/true/ `#True` is `-1`, the value comparisons give when they are true, and the only value [`if`](https://ilpersi.github.io/EasyUOReforged/commands/if/) and [`while`](https://ilpersi.github.io/EasyUOReforged/commands/while/) treat as true. Use it for on/off flags. See [`#True` and `#False`](https://ilpersi.github.io/EasyUOReforged/guides/true-and-false/). ## Example ```euo set %usemagery #True if %usemagery display ok Healing with Magery. halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #WaitRes > How the last waitfor ended: #true if its condition was met, #false if the time ran out. - **Access:** read-only - **Type:** boolean - **Needs a client:** no - **New in Reforged:** EasyUO 1.5 does not have it. - **Set by:** WaitFor - **Related:** WaitFor, #Result - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/waitres/ `#WaitRes` says how the last [`waitfor`](https://ilpersi.github.io/EasyUOReforged/commands/waitfor/) ended: | Value | Meaning | |---|---| | `-1` (`#true`) | The condition was met. | | `0` (`#false`) | The time ran out. | | `N/A` | No `waitfor` has finished yet in this run. | Pressing Stop during a `waitfor` leaves it as it was. `#WaitRes` has its own variable so that a `waitfor` doesn't overwrite [`#Result`](https://ilpersi.github.io/EasyUOReforged/variables/result/), which holds what a sub returned. ## Example ```euo event macro 8 7 waitfor #ContName = container_gump 3s if #WaitRes event sysmessage The backpack is open. if ! #WaitRes event sysmessage The backpack did not open. halt ``` --- # #Weight > Weight your character carries, in stones. - **Access:** read-only - **Type:** number - **Needs a client:** yes - **Related:** #MaxWeight, #Gold - **Online:** https://ilpersi.github.io/EasyUOReforged/variables/weight/ `#Weight` is the weight your character carries, in stones, as shown in the status window. It is read from your character's status, which the client only has once the status window has been opened. If it reads `N/A`, open the status window once, by hand or with `event Macro 8 2`. ## Example ```euo if #Weight > #MaxWeight - 20 display ok Nearly full: time to unload. halt ``` *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # Beginner's tutorial > A first walk through writing and running EasyUO scripts: speaking, walking and opening your backpack. - **Online:** https://ilpersi.github.io/EasyUOReforged/guides/beginners-tutorial/ This tutorial writes three small scripts. Before you start: 1. [Install EasyUO Reforged](https://ilpersi.github.io/EasyUOReforged/guide/install/) and check that it supports your client version. 2. Start the Ultima Online client (the classic 2D client) and log in with a character. 3. Start EasyUO Reforged. ## Your first script Type or paste this into the editor: ```euo msg #SMC Hello there!$ halt ``` Press **F9**, or the Play button. Your character whispers "Hello there!": [`msg`](https://ilpersi.github.io/EasyUOReforged/commands/msg/) types the text into the client, [`#SMC`](https://ilpersi.github.io/EasyUOReforged/variables/smc/) is a `;` (a message starting with `;` is whispered) and `$` presses Enter. [`halt`](https://ilpersi.github.io/EasyUOReforged/commands/halt/) stops the script; without it, the script would start over from the top. ## Walking This script walks two steps south-east, using your position from [`#CharPosX`](https://ilpersi.github.io/EasyUOReforged/variables/charposx/) and [`#CharPosY`](https://ilpersi.github.io/EasyUOReforged/variables/charposy/): ```euo ; work out a spot 2 tiles away set %x #CharPosX + 2 set %y #CharPosY + 2 ; walk there, giving up after 10 seconds move %x %y 0 10s halt ``` [`move`](https://ilpersi.github.io/EasyUOReforged/commands/move/) walks in a straight line. For longer walks around obstacles, use [`event PathFind`](https://ilpersi.github.io/EasyUOReforged/commands/event/pathfind/). ## Opening your backpack The client remembers the last object you used in [`#LObjectID`](https://ilpersi.github.io/EasyUOReforged/variables/lobjectid/), and its *Last Object* macro uses it again. Put your backpack there and run the macro: ```euo set #LObjectID #BackpackID ; your backpack event Macro 17 0 ; use the last object: opens it halt ``` While a script runs, the variable inspector on the right shows the current values of the variables, which helps you see what your script sees. ## What next - Read about [variables](https://ilpersi.github.io/EasyUOReforged/language/variables/), [expressions](https://ilpersi.github.io/EasyUOReforged/language/expressions/) and [control structures](https://ilpersi.github.io/EasyUOReforged/language/control-structures/). - Learn to find things around you with [`finditem`](https://ilpersi.github.io/EasyUOReforged/commands/finditem/). - Browse the [commands](https://ilpersi.github.io/EasyUOReforged/commands/) and [variables](https://ilpersi.github.io/EasyUOReforged/variables/). *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # Containers and gumps > Gump names and the #ContName, #ContType and #ContSize values of the client's screens and containers. - **Online:** https://ilpersi.github.io/EasyUOReforged/guides/containers-and-gumps/ Screens of the client and the values the `#Cont…` variables show for them, with the positions of their buttons for [`click`](https://ilpersi.github.io/EasyUOReforged/commands/click/). Positions are in pixels inside the client window. > **Caution: Collected for clients of around 2006** > > These screens, their sizes and button positions come from the 640×480 login screens of clients of that time. > Newer clients look different: check the values on your own client with the variable inspector before relying on > them. The original table labelled the gump codes `#ContType`; they are [`#ContKind`](https://ilpersi.github.io/EasyUOReforged/variables/contkind/) values. ## Login Screen `#ContName` `MainMenu_gump` · `#ContKind` `KZTB` · `#ContSize` `640_480` **Logon Screen Buttons** | Button | x | y | |---|---|---| | Quit | 57 | 23 | | My UO | 43 | 175 | | Account | 43 | 229 | | Movie | 43 | 317 | | Credits | 43 | 340 | | Help | 43 | 368 | | Account Name | 529 | 359 | | Password | 529 | 398 | | Green Arrow | 617 | 456 | ## Shard Selection Screen `#ContName` `Normal_gump` · `#ContKind` `QQL` · `#ContSize` `640_480` **Shard Selection Buttons** | Button | x | y | |---|---|---| | Quit | 57 | 23 | | My UO | 43 | 175 | | Account | 43 | 229 | | Credits | 43 | 340 | | Help | 43 | 368 | | Timezone | 271 | 377 | | %Full | 376 | 377 | | Connection | 484 | 377 | | World | 187 | 431 | | Red Arrow | 596 | 455 | | Green Arrow | 619 | 455 | ## Character Selection Screen `#ContName` `Login_gump` · `#ContKind` `STFD` · `#ContSize` `640_480` **Character Selection Buttons** | Button | x | y | |---|---|---| | Quit | 57 | 23 | | My UO | 43 | 175 | | Account | 43 | 229 | | Credits | 43 | 340 | | Help | 43 | 368 | | Red Arrow | 596 | 455 | | Green Arrow | 619 | 455 | | New | 254 | 408 | | Delete | 471 | 408 | | Character 1 | 355 | 160 | | Character 2 | 355 | 200 | | Character 3 | 355 | 240 | | Character 4 | 355 | 280 | | Character 5 | 355 | 220 | | Character 6 | 355 | 360 | ## Paper Doll Gump `#ContName` `Paperdoll_gump` · `#ContKind` `KX` · `#ContSize` `262_324` **Paperdoll Buttons** | Button | x | y | |---|---|---| | Virtue | 95 | 19 | | Help | 216 | 55 | | Options | 216 | 83 | | Log Out | 216 | 109 | | Journal | 216 | 134 | | Skills | 216 | 160 | | Guild | 216 | 190 | | Peace/War | 216 | 216 | | Status | 216 | 239 | | Minimize | 233 | 269 | | Chivalry Book | 163 | 221 | | Backpack | 139 | 218 | | Party Manifest | 45 | 223 | | Character Profile | 32 | 223 | ## Party Manifest Gump `#ContName` `PartyGump` · `#ContKind` `CBRD` · `#ContSize` `543_480` **Party Manifest Buttons** | Button | x | y | |---|---|---| | Tell Button 1 | 47 | 60 | | Kick Button 1 | 92 | 60 | | Tell Button 2 | 47 | 86 | | Kick Button 2 | 92 | 86 | | Tell Button 3 | 47 | 111 | | Kick Button 3 | 92 | 111 | | Tell Button 4 | 47 | 132 | | Kick Button 4 | 92 | 132 | | Tell Button 5 | 47 | 161 | | Kick Button 5 | 92 | 161 | | Tell Button 6 | 47 | 186 | | Kick Button 6 | 92 | 186 | | Tell Button 7 | 47 | 210 | | Kick Button 7 | 92 | 210 | | Tell Button 8 | 47 | 232 | | Kick Button 8 | 92 | 232 | | Tell Button 9 | 47 | 260 | | Kick Button 9 | 92 | 260 | | Tell Button 10 | 47 | 286 | | Kick Button 10 | 92 | 286 | | Send Party Message | 82 | 321 | | Party Can Loot | 82 | 345 | | Disband Party | 82 | 370 | | Add New Member | 82 | 395 | | Okay | 217 | 432 | *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # Script speed and #LPC > How fast a script runs: cycles of #LPC lines, why GOTO is not faster than GOSUB, and how to speed scripts up. - **Online:** https://ilpersi.github.io/EasyUOReforged/guides/execution-speed/ "Is `goto` faster than `gosub`?" comes up often. The answer lies in how EasyUO runs a script. ## Cycles A script runs in **cycles**. In each cycle it runs [`#LPC`](https://ilpersi.github.io/EasyUOReforged/variables/lpc/) lines (10 by default) and then pauses 50 ms, which leaves the computer to the UO client and everything else. That makes about 20 cycles, or 200 lines, a second. ```euo ; what EasyUO does, in pseudo-code start: run #LPC lines of the script pause 50 ms goto start ``` A comment, a `goto` and a `gosub` each count as one line. Running a line takes almost no time compared with the 50 ms pause, so **which command a line holds hardly matters**: `goto` is not faster than `gosub`, and removing comments only saves lines, not real work. Some commands, such as [`key`](https://ilpersi.github.io/EasyUOReforged/commands/key/), [`click`](https://ilpersi.github.io/EasyUOReforged/commands/click/), [`target`](https://ilpersi.github.io/EasyUOReforged/commands/target/) and [`wait`](https://ilpersi.github.io/EasyUOReforged/commands/wait/), wait on purpose and take as long as they take. ## Making scripts faster Raise `#LPC` where a script does a lot of quick work, and lower it again afterwards: ```euo set #LPC 1000 set %sum 0 for %i 1 1000 ; a lot of quick lines set %sum %sum + %i set #LPC 10 display ok The sum is %sum halt ``` A high `#LPC` lets the script take more of the computer's time. That is fine for bursts of calculation, menu building or text work. For commands that make the client do work, such as [`finditem`](https://ilpersi.github.io/EasyUOReforged/commands/finditem/), a high value only uses more CPU without making the game respond faster. ## Measuring To compare commands, take the 50 ms pause out of the measurement by setting a very high `#LPC`, and time many repetitions with [`#SysTime`](https://ilpersi.github.io/EasyUOReforged/variables/systime/): ```euo set #LPC 100000000 set %start #SysTime for %i 1 100000 set %x 3 set %took #SysTime - %start set #LPC 10 display ok 100000 sets took %took ms halt ``` In the original EasyUO, a huge `#LPC` froze the EasyUO window until the loop ended. In EasyUO Reforged each script runs on its own thread and gives way briefly every 1024 lines, so the window stays usable and **Stop** still works. *Based on Cheffe's tutorial on execution speed from the EasyUO wiki.* *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # Introduction > What EasyUO is, what scripts can do with it, and where to start. - **Online:** https://ilpersi.github.io/EasyUOReforged/guides/introduction/ EasyUO is a free tool for writing scripts that play Ultima Online for you: small programs that read what the client knows (your hit points, the items around you, the journal) and act on it, by clicking, typing, using items and running the client's own macros. EasyUO Reforged is EasyUO rebuilt for modern 64-bit Windows; it runs the same scripts. The simplest script: ```euo msg #SMC Hello Sosaria$ halt ``` It types `;Hello Sosaria` and presses Enter, which makes your character whisper "Hello Sosaria", then stops. ## What scripts can do - Train skills while you are away from the keyboard. - Craft, sort and move items. - Buy from vendors, bank, restock. - Keep your character alive: heal, cure, flee. - Anything else you can describe as "when this happens, do that". Check your shard's rules first: many shards limit or forbid unattended scripting. ## Where to go next 1. [Install EasyUO Reforged](https://ilpersi.github.io/EasyUOReforged/guide/install/) and [run your first script](https://ilpersi.github.io/EasyUOReforged/guide/first-script/). 2. Follow the [beginner's tutorial](https://ilpersi.github.io/EasyUOReforged/guides/beginners-tutorial/), then build on the [common patterns](https://ilpersi.github.io/EasyUOReforged/guides/patterns/). [Finding IDs and types](https://ilpersi.github.io/EasyUOReforged/guides/finding-ids/) shows how to read the values a script needs from your own game. 3. Learn the language: [variables](https://ilpersi.github.io/EasyUOReforged/language/variables/), [expressions](https://ilpersi.github.io/EasyUOReforged/language/expressions/), [operators](https://ilpersi.github.io/EasyUOReforged/language/operators/) and [control structures](https://ilpersi.github.io/EasyUOReforged/language/control-structures/). When a script runs but does the wrong thing, check it against the [common mistakes](https://ilpersi.github.io/EasyUOReforged/language/common-mistakes/). 4. Look up anything in the [command](https://ilpersi.github.io/EasyUOReforged/commands/) and [variable](https://ilpersi.github.io/EasyUOReforged/variables/) lists. *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # SQL or * variables? > Two ways to keep data between runs: when * variables are all you need, and when the SQL command is worth it, with examples. - **Online:** https://ilpersi.github.io/EasyUOReforged/guides/sql-or-persistent-variables/ A script has two ways to keep data after it stops: [`*` variables](https://ilpersi.github.io/EasyUOReforged/language/variables/#persistent-variables-), saved in the Windows registry, and the [`SQL`](https://ilpersi.github.io/EasyUOReforged/commands/sql/) command, which keeps data in an SQLite database file. **`SQL` does not replace `*` variables.** They work exactly as before, and for a few values they are still the simplest choice. Choose by the shape of the data: - **A few named values** (a counter, a setting, an ID): `*` variables. - **Rows of data**: a log, a list, several fields per entry, totals, or data that several scripts change at the same time. Use `SQL`. ## At a glance | | `*` variables | `SQL` | |---|---|---| | Where the data is | The registry, under `HKCU\Software\EasyUO`. | A file you name in [`sql open`](https://ilpersi.github.io/EasyUOReforged/commands/sql/open/). | | Setting up | Nothing: `set *runs 1`. | `sql open` in each script, and a `CREATE TABLE` for your own tables. | | Shape | One value per name. | Tables with as many rows and columns as you need. | | Listing, searching, removing | Not from a script: you have to know the name, and no command deletes one. | `SELECT … WHERE`, `DELETE`, [`sql delete`](https://ilpersi.github.io/EasyUOReforged/commands/sql/delete/). | | Totals, sorting, "in the last hour" | By hand, in a loop over numbered names. | `SUM`, `COUNT`, `GROUP BY`, `ORDER BY`, `LIMIT`. | | Two scripts changing one value | A change can be lost (see [below](#several-scripts-adding-to-one-counter)). | One statement is never interrupted by another. | | Who sees it | Every script of your Windows user, in EasyUO Reforged and the original EasyUO. | Every script that opens the same file. | | Original EasyUO | Works there too. | `SQL` is new in EasyUO Reforged. | | Back up, move to another PC | `reg export` of the key (it holds EasyUO's own settings too). | Copy the file. | | Looking at the data | `regedit`. | Any SQLite tool, such as DB Browser for SQLite, or Python. | | Needs | Nothing. | The SQLite that ships with Windows 10 and 11 (see [Using SQL](https://ilpersi.github.io/EasyUOReforged/guides/sql/#requirements)). | ## When `*` variables are enough - You keep a handful of values: a run counter, the ID of your loot bag, a chosen option. - The script must also run in the original EasyUO. - Older scripts already read or write the same `*` variables. ## When SQL is worth it - The data grows over time: every kill, every pickup, every skill gain. - An entry has several fields (an ID, a name, a place, a time) and you want to find entries by any of them. - You want totals, averages, the five best, or only what happened in the last hour. - Several scripts, or several clients, write the same data at once. - You want to look at the data, back it up or clear it without opening the registry. ## Examples ### Counting runs A counter is the classic `*` variable, and it needs nothing else: ```euo set *runs *runs + 1 ; N/A counts as 0, so the first run gives 1 display ok This script has run *runs times. halt ``` The same with `SQL` takes two more lines: [`sql open`](https://ilpersi.github.io/EasyUOReforged/commands/sql/open/), then [`sql load`](https://ilpersi.github.io/EasyUOReforged/commands/sql/load/) and [`sql save`](https://ilpersi.github.io/EasyUOReforged/commands/sql/save/) around the change. ```euo sql open mydata.db sql load %runs ; the value saved last time set %runs %runs + 1 sql save %runs ; keep it for next time display ok This script has run %runs times. halt ``` For a single value like this, `*` variables are fine. `SQL` only adds the choice of file. ### One setting per character Several characters on one computer each need their own loot bag. With `*` variables, glue the character's ID to the name with [`.`](https://ilpersi.github.io/EasyUOReforged/language/operators/#building-variable-names-with-): ```euo set %bag *lootbag . #CharID ; *lootbag followed by this character's ID if %bag = N/A { set %bag ABCDEFG ; your loot bag's ID set *lootbag . #CharID %bag } display ok #CharName keeps loot in %bag halt ``` That works, but every character leaves a registry entry behind, and no script can list them. With `SQL`, the characters are rows of one table, so a script can list them all: ```euo sql open mydata.db sql exec CREATE TABLE IF NOT EXISTS chars(id TEXT PRIMARY KEY, name TEXT, lootbag TEXT) sql query SELECT lootbag FROM chars WHERE id = #CharID if #SqlCnt = 0 { set %lootbag ABCDEFG ; your loot bag's ID sql exec INSERT INTO chars VALUES(#CharID, #CharName, %lootbag) } sql query SELECT name, lootbag FROM chars ORDER BY name for %i 1 #SqlCnt { sql row %i ; sets %name and %lootbag display ok %name keeps loot in %lootbag } halt ``` To forget a character, `sql exec DELETE FROM chars WHERE id = #CharID` removes its row. ### A loot log you can add up Here `SQL` does something `*` variables can't do. Each pickup becomes a row with the time ([`#SysTime`](https://ilpersi.github.io/EasyUOReforged/variables/systime/)), and one query adds up the last hour: ```euo sql open mydata.db sql exec CREATE TABLE IF NOT EXISTS loot(at INTEGER, item TEXT, amount INTEGER) set %item gold ; in a real script: after each pickup set %amount 250 sql exec INSERT INTO loot(at, item, amount) VALUES(#SysTime, %item, %amount) set %since #SysTime - 3600000 ; one hour ago sql query SELECT item, SUM(amount) AS total FROM loot WHERE at > %since + GROUP BY item ORDER BY total DESC LIMIT 5 for %i 1 #SqlCnt { sql row %i ; sets %item and %total display ok %item : %total in the last hour } halt ``` The same table answers other questions with one line each. For example, `SELECT COUNT(*) AS n FROM loot WHERE item = 'gold'` counts the pickups of gold, and `SELECT item, MAX(amount) AS best FROM loot GROUP BY item` gives the best pickup of each item. With `*` variables, you would need a numbered variable for each pickup (`*loot1`, `*loot2`, …), another one for the next number, and a loop over all of them for every total. The old entries would stay in the registry for good. ### Several scripts adding to one counter Several scripts, one per client, count kills in one shared total. With a `*` variable: ```euo set *kills *kills + 1 ; reads the value, adds one, writes it back display ok Kills counted by every script: *kills halt ``` Reading and writing are two separate steps. If two scripts read `41` at the same moment, both write `42` and a kill is lost. It is rare, but it happens more often as the number of scripts grows. With `SQL`, the database adds one in a single statement, so no other script can change the value in the middle. A script that finds the file busy waits for its turn (up to 5 seconds): ```euo sql open shared.db sql exec CREATE TABLE IF NOT EXISTS counters(name TEXT PRIMARY KEY, n INTEGER) sql exec INSERT OR IGNORE INTO counters VALUES('kills', 0) sql exec UPDATE counters SET n = n + 1 WHERE name = 'kills' sql query SELECT n AS kills FROM counters WHERE name = 'kills' display ok Kills counted by every script: %kills halt ``` Every script has to open the same file. A file name without a folder starts from [`#CurPath`](https://ilpersi.github.io/EasyUOReforged/variables/curpath/), the folder of EasyUO Reforged, so `shared.db` is the same file for all scripts. ## Moving `*` variables into a database Copy each value into a `%` variable and save it: ```euo sql open mydata.db set %runs *runs ; one line for each value you want to keep set %kills *kills sql save %runs %kills if #SqlRes = OK display ok Copied to mydata.db halt ``` From then on, the script uses `sql load` and `sql save` instead of the `*` variables. The `*` variables stay in the registry, because no script command deletes one. To remove them, open `regedit`, go to `HKEY_CURRENT_USER\Software\EasyUO` and delete the values whose names start with `*` (`set` writes the names in capitals, such as `*RUNS`). Leave the key and its other values alone: EasyUO keeps its own settings there. --- # Using SQL > How sql statements are written, how variables go in and come back out, saving variables, several scripts at once, and what SQLite build is used. - **Online:** https://ilpersi.github.io/EasyUOReforged/guides/sql/ The [`SQL`](https://ilpersi.github.io/EasyUOReforged/commands/sql/) command keeps data in an SQLite database file. This page explains the rules that apply to all its sub-commands. Each sub-command has its own reference page: [`open`](https://ilpersi.github.io/EasyUOReforged/commands/sql/open/), [`close`](https://ilpersi.github.io/EasyUOReforged/commands/sql/close/), [`exec`](https://ilpersi.github.io/EasyUOReforged/commands/sql/exec/), [`query`](https://ilpersi.github.io/EasyUOReforged/commands/sql/query/), [`row`](https://ilpersi.github.io/EasyUOReforged/commands/sql/row/), [`save`](https://ilpersi.github.io/EasyUOReforged/commands/sql/save/), [`load`](https://ilpersi.github.io/EasyUOReforged/commands/sql/load/) and [`delete`](https://ilpersi.github.io/EasyUOReforged/commands/sql/delete/). ## Writing statements The statement is **everything after the second word of the line, exactly as written**. Unlike other commands, nothing in it is substituted, merged or squeezed: quotes, commas, `.` and runs of spaces all stay as they are. - **Long statements** can continue on lines that start with `+`, like any EasyUO line. The pieces are joined *without* a space, so write `+ FROM pets` (with a space after the `+`) where SQL needs one. - **One statement per line.** Only the first statement runs; everything after its `;` is ignored. That is why a normal EasyUO comment at the end of the line works: `sql exec DELETE FROM log ; clear the log`. - **Table and column names cannot come from variables.** SQLite only accepts variables where a *value* goes, so `SELECT * FROM %table` is an error. ## Variables in a statement Write `%x`, `!x` (current namespace), `#x` or `*x` wherever a value goes. Each one is passed to SQLite as a separate value, never pasted into the statement text. A value containing `'`, `,` or `;` is therefore stored exactly as it is and cannot break the statement. ```euo sql open :memory: sql exec CREATE TABLE kills(mob TEXT, at INTEGER, who TEXT) set %mob orc set !owner Bob sql exec INSERT INTO kills(mob, at, who) VALUES(%mob, #SysTime, !owner) set %since #SysTime - 60000 sql query SELECT who FROM kills WHERE mob = %mob AND at > %since display ok %who killed an %mob in the last minute. halt ``` How the variables are found: - **Inside quotes nothing is replaced.** `'…'`, `"…"`, `[…]`, `` `…` `` and comments (`-- …`, `/* … */`) are copied unchanged, so `LIKE '%dog%'` is a plain pattern. This matches the rest of EasyUO, where `'%a'` is not substituted either. To use a pattern from a variable, put the whole pattern in it: `set %pat %dog%` … `WHERE name LIKE %pat`. - **A variable has to start a word.** It counts only when the character before `%`, `!`, `#` or `*` is not a letter, digit or `_`. So `a % b`, `a%b`, `price * qty`, `price*qty`, `SELECT *`, `count(*)` and `!=` are ordinary SQL operators. Only `a %b` or `a *b` (operator glued to the right-hand side) would be read as a variable, and that gives a syntax error in `#SqlRes`. Write `a % b`. - **How values are passed:** - A whole number written the normal way (`42`, `-7`) goes in as a number, so comparisons and `ORDER BY` sort numerically. `007`, `1.5` or `$1A` go in as text. - `N/A`, which is what an unset variable reads, goes in as SQL `NULL`. - Anything else goes in as text. ## Results [`sql query`](https://ilpersi.github.io/EasyUOReforged/commands/sql/query/) and [`sql row`](https://ilpersi.github.io/EasyUOReforged/commands/sql/row/) put each column of the row into a `%` variable named after the column: `SELECT name, hp FROM pets` sets `%name` and `%hp`. - Rename columns with `AS` to choose the variable name, or to avoid overwriting one you use for something else: `SELECT name AS petname …`. - Characters a variable name cannot have become `_`: `count(*)` lands in `%count___`, so prefer `SELECT count(*) AS n`. When two columns have the same name, the last one wins. - SQL `NULL` reads back as `N/A`, the same as an unset variable. - Numbers come back as text the usual way: `42`, `3.5`. A query keeps all its rows in memory until the next `sql query`. Add a `LIMIT` when a table can be large. ## Saving and loading variables [`sql save`](https://ilpersi.github.io/EasyUOReforged/commands/sql/save/), [`sql load`](https://ilpersi.github.io/EasyUOReforged/commands/sql/load/) and [`sql delete`](https://ilpersi.github.io/EasyUOReforged/commands/sql/delete/) keep variables in a table called `euo_vars` (it is created when first needed). It works like the `*` variables, but in a file of your choice instead of the registry. [SQL or * variables?](https://ilpersi.github.io/EasyUOReforged/guides/sql-or-persistent-variables/) helps you choose between the two. ```euo sql open mychar.db sql load %runs !lastloot ; what was saved last time set %runs %runs + 1 display ok Run %runs - last loot: !lastloot set !lastloot gold sql save %runs !lastloot ; save for next time halt ``` - Write the variables as you normally would (`%runs`, not its value). Only `%` and `!` variables can be saved. - Names do not depend on case. A `!` variable is saved under its plain name: `!x` saved in one namespace loads into `!x` of whatever namespace is current. - `sql save` writes all the listed variables or none of them. - `euo_vars` is an ordinary table. `sql query SELECT name, value FROM euo_vars` lists it. ## Several scripts and speed - Each script tab has **one** database connection. Scripts started with `call` share it. To use several files at once, `sql exec ATTACH 'C:\data\other.db' AS other` and write `other.table`. `ATTACH` paths are relative to the working directory of EasyUO Reforged, not to `#CurPath`, so give a full path. - Several tabs can use the same file. While one is writing, the others wait up to 5 seconds before giving up with `database is locked` in `#SqlRes`. - **Stop** interrupts a running query or a wait at once (`#SqlRes` reads `interrupted`). - Each `sql exec` that changes data is its own transaction, which is slow for many rows. Wrap a batch in `sql exec BEGIN` … `sql exec COMMIT`. - `sql exec PRAGMA journal_mode=WAL` lets readers and a writer work at the same time. It is a property of the file, so it stays on. SQLite then keeps two extra files (`-wal`, `-shm`) next to it. ## Requirements Nothing to install. EasyUO Reforged uses the SQLite that ships with Windows 10 and 11 (`System32\winsqlite3.dll`). To use another SQLite build, put a **64-bit** `sqlite3.dll` next to `EasyUOReforged.exe`; it is preferred when present. The library is only loaded when a script runs its first `sql` line. If neither DLL can be loaded, every `sql` command sets `#SqlRes` to `SQLite library not available`. Text is stored exactly as the script has it. The files are ordinary SQLite databases that any SQLite tool can open. --- # Stat and skill gains on RunUO shards > How stat and skill gains work on RunUO-based free shards, and what that means for training scripts. - **Online:** https://ilpersi.github.io/EasyUOReforged/guides/stat-and-skill-gains/ How fast a training script gains depends on the shard's rules. This page describes the gain system of **RunUO**, which many free shards were built on, as players read it from RunUO's source code in the 2000s. Shards based on newer code (ServUO, ModernUO) or with custom rules can behave differently. ## Stat gains - **There is no "8×8" on RunUO.** Whatever makes official shards seem to have lines of gain spots in 8×8 areas does not exist here. Moving slowly in one direction (on a boat, or walking) is enough; walking back and forth to "find the gain line" wastes time. - **There is anti-macro code**, for the same skills as on official shards, but it works differently: - It is either target-based or movement-based. For target-based skills, each object is one target. - For movement-based skills the map is divided into 5×5 tile areas, counted from tile 0,0 of each map, not from where your character stands. - You can gain up to three times per target or per 5×5 area in any five-minute period. When five minutes have passed since the first gain, the second one starts the next period. - Below 10 points in a skill, the anti-macro code is not checked. - It does not apply to pets. ## Skill gains Below 10 points, a gain adds 0.1 to 0.4 at random; from 10 points on, it always adds 0.1. Whether you gain on an attempt depends on three weighted factors: 1. **How hard the attempt is (50 %).** Each object or action has a minimum and a maximum skill for gaining: below the minimum it is too hard, above the maximum too easy. The closer your skill is to the minimum, the higher the chance; it drops towards zero near the maximum. A success counts half of this factor, a failure only a fifth. 2. **How far your total skills are from the total cap (25 %).** `(total cap − total skills) ÷ total cap`. At 697 out of 700 this is almost zero; at 400 out of 700 it is about half. 3. **How far the skill is from its own cap (25 %).** `(skill cap − base skill) ÷ skill cap`. At 99.8 out of 100 it is almost zero. What that means for training: - Lock every skill except the ones you are training, and stay below your total skill cap. - Train the hardest and most expensive skills first, while your total is low. - Raise a skill's cap with a power scroll if you can, even if you only want to reach 100: 99.7 out of a cap of 120 still has a large third factor. - Train well below an object's maximum skill, where you succeed about 20–40 % of the time, and move on to harder objects as soon as you can (bears instead of horses for taming, for example). *Based on a forum post by Roadkill, copied to the EasyUO wiki.* *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # #True and #False > How to use #True and #False as on/off flags, and why if %flag only works with #True. - **Online:** https://ilpersi.github.io/EasyUOReforged/guides/true-and-false/ [`#True`](https://ilpersi.github.io/EasyUOReforged/variables/true/) and [`#False`](https://ilpersi.github.io/EasyUOReforged/variables/false/) are on/off values: `#True` for yes, on, done, `#False` for no, off, not yet. They make conditions short and easy to read. Without them, a setting is usually written as text: ```euo set %usemagery yes if %usemagery = yes display ok Heal with Magery. if %usemagery = no display ok Heal with bandages. halt ``` With them, the condition reads like a sentence: ```euo set %usemagery #True if %usemagery display ok Heal with Magery. if ! %usemagery display ok Heal with bandages. halt ``` `if %usemagery` runs the next line when `%usemagery` is true; `if ! %usemagery` turns the test around and runs it when it is false. ## Why it has to be `#True` `#True` is the number `-1` and `#False` is `0`, the same values comparisons such as `%a = 1` give. [`if`](https://ilpersi.github.io/EasyUOReforged/commands/if/), [`while`](https://ilpersi.github.io/EasyUOReforged/commands/while/) and [`until`](https://ilpersi.github.io/EasyUOReforged/commands/repeat/) treat **only `-1`** as true. So: | `%flag` holds | `if %flag` | `if ! %flag` | |---|---|---| | `#True` (`-1`) | runs | skips | | `#False` (`0`) | skips | runs | | Text, such as `yes` | skips | runs: text counts as `0`, so `yes` behaves like `#False` | | `1` or any other number | skips | **also skips** | Set flags with `#True` and `#False`, never with `yes` or `1`, and `if %flag` / `if ! %flag` always do what they say. *Based on a quick guide by Una from the EasyUO wiki.* *Based on the [EasyUO wiki](https://github.com/ilpersi/easyuo-wiki-archive), edited for EasyUO Reforged. This text is available under the [GNU Free Documentation License 1.2](https://www.gnu.org/licenses/old-licenses/fdl-1.2.html) (`LICENSE-GFDL-1.2.txt` in this pack).* --- # Editing and debugging > Breakpoints, conditional breakpoints, stepping, run to cursor, the call stack, VarDump and the editor's autocomplete, code folding, Format Script, Ctrl+click to a sub or label and Find and Replace. - **Online:** https://ilpersi.github.io/EasyUOReforged/guide/debugging/ EasyUO Reforged adds IDE-style debugging to the classic Start / Pause / Stop controls. The shortcuts follow the Delphi and Lazarus conventions. ## Breakpoints and stepping | Key or menu | Action | |---|---| | **F5** | Toggle a breakpoint on the current line. | | **F4** | Run to the cursor. | | **F7** / **F8** / **F6** | Step into / step over / step out. | | *Control → Breakpoint Condition…* | Make the breakpoint conditional. | | *Control → Clear All Breakpoints* | Remove every breakpoint. | | *Control → Show Call Stack* | A live panel of the nested [`gosub`](https://ilpersi.github.io/EasyUOReforged/commands/gosub/) calls. | A **conditional breakpoint** only stops when its condition is true. The condition is a single comparison, ` `, for example `%i > 10` or `#FindCnt = 0`: - The variable can be any kind: `%`, `!`, `*` or `#`. - The operator is one of `=`, `<>`, `>`, `<`, `>=`, `<=`. - When both sides are whole numbers they are compared as numbers; otherwise as text, ignoring case. Put the value in double quotes to force a text comparison: `%code = "007"`. It is not a full EasyUO expression: there is no `&&`, `||` or arithmetic. ## Looking at variables While the script is paused, the variable inspector shows the live values. *Tools → VarDump* writes every variable to a text window you can copy, which is handy for bug reports. ## The Output panel [`log`](https://ilpersi.github.io/EasyUOReforged/commands/log/) writes a line to the Output panel without stopping the script: put it where you want to know what the script saw. ```euo finditem POF G_3 log finditem found #FindCnt stacks halt ``` The panel opens by itself, under the script, at the first line a script logs. Each line has the time, and the tab's name when more than one tab is open. *Control → Show Output* shows or hides it and *Control → Clear Output* empties it. It keeps the newest 5000 lines. When the call stack is shown too, the two share the space under the script: the call stack on the left, the Output panel on the right. Drag the bar between them to give one more room. ## Editor features - **Ctrl+Space** opens autocomplete with the script commands, the built-in `#variables` and the variables your script already uses. After a command that takes a sub-command, it lists only those: after `menu` it offers `BUTTON`, `WINDOW`, `FONT`…, after `menu font` it offers `NAME`, `SIZE`, `ALIGN`…, and the same for `sql`, `event`, `exevent`, `namespace`, `str`, `tile`, `display`, `uoxl`, `ignoreitem` and `ignorecont`. Where only one word can go (`tile init` → `NOOVERRIDES`, `ignoreitem` → `RESET`), it is filled in straight away. To get a variable there instead, type its first character (`%`, `#`, …) before pressing **Ctrl+Space**. - **Ctrl+F** / **Ctrl+H** open the Find and Replace window, described [below](#find-and-replace). - **Ctrl+Shift+R** / **Ctrl+Shift+P** record and play back a keystroke macro in the editor. It repeats typing, not game actions. - **Code folding**: click the **−** in the gutter to collapse a block, **+** to open it again. A `sub` folds from its `sub` line through its `return`, a `repeat` through its `until`, and a `{ }` block from its `{` line (the `if`, `else`, `for` or `while` line above it stays visible). *Edit → Fold All* (**Alt+Shift+1**) collapses everything, *Edit → Unfold All* (**Alt+Shift+0**) opens everything. - **Format Script** (*Edit* menu, toolbar or **Ctrl+Shift+F**) re-indents the whole script: two spaces per level, braces lined up with the line that owns them, `sub` and `return` at the left with the body indented, and the one line under a brace-less `if` indented. It only changes the spaces at the start and end of lines, so the script runs exactly as before, and one **Ctrl+Z** undoes it. It is not available while a script runs. - **Go to a sub or label**: hold **Ctrl** over the name after `gosub` or `goto`. When the script has that `sub` or label, the name is underlined; click it to jump there. *Edit → Go Back* (**Alt+Left**) returns to where you clicked, and pressed again goes further back. The jump goes where the script would go: to the last `sub` of that name when there are two, and to the nearest label, the one below first when two are as close. A name the script only knows when it runs, such as `gosub %next`, is not a link. ## Find and replace *Edit → Find…* (**Ctrl+F**), *Edit → Replace…* (**Ctrl+H**) and the *Find/Replace* toolbar button open one window for both; Ctrl+H puts the cursor in the *Replace* box. It starts with the selected text, or the word under the cursor, already filled in (`#FindID`, `%item`: the `#` or `%` is included). | Key | Action | |---|---| | **Enter** / **F3** | Find the next match. | | **Shift+Enter** / **Shift+F3** | Find the previous match. | | **Esc** | Close the window. | **F3** and **Shift+F3** also work in the editor with the window closed, with the last search. - **Match case**, **Whole word**: the usual. `#` and `%` don't count as letters, so a whole-word search for `findid` matches inside `#findid`. - **Regular expression**: a pattern such as `set (%\w+)`. In the Replace text, `$1`, `$2`… put back what the parentheses matched, so the pattern above with `var $1` turns `set %hp 10` into `var %hp 10`. - **Wrap around** (on by default): carry on from the top after the last match. The status line says when it did. - **Prompt on replace**: *Replace All* asks about each match: *Yes*, *No*, *Yes to All* or *Cancel*. - **Scope**: the *current script*, the *selection* (selecting several lines before **Ctrl+F** picks it), or *all open scripts*, where Find Next moves on from tab to tab and Replace All replaces in every one. While the window is open, every match in the script is highlighted and the status line counts them (**3 of 12 matches**). *Replace* replaces the selected match and finds the next one; *Replace All* replaces every match in the scope, and one **Ctrl+Z** undoes it in each script. A script that is running can't be changed: *Replace All* skips it. The last 20 searches and replacements are kept in each box's drop-down list, and the options are remembered, both between sessions. Next: [troubleshooting](https://ilpersi.github.io/EasyUOReforged/guide/troubleshooting/). --- # Check and run scripts with EUOCli > EUOCli is EasyUO Reforged from the command line: check reports what EasyUO would skip or misread in a script, run runs a script and prints what happens, vars and clients read the game, docs looks a command up, and mcp and init give all of it to an AI agent. - **Online:** https://ilpersi.github.io/EasyUOReforged/guide/euocli/ `EUOCli.exe` is EasyUO Reforged from the command line. It is in the release zip, next to `EasyUOReforged.exe`: run it from a terminal, or let an [AI coding agent](https://ilpersi.github.io/EasyUOReforged/guide/agents/) run it on the scripts it writes. | Command | What it does | |---|---| | [`EUOCli check`](#check-a-script) | Reports what EasyUO would skip or misread in a script, without running it. | | [`EUOCli run`](#run-a-script) | Runs a script with nobody watching and prints what happens. | | [`EUOCli vars`](#read-variables) | Reads variables from a client, without a script. | | [`EUOCli clients`](#list-the-clients) | Lists the UO clients found. | | [`EUOCli docs`](#look-up-the-documentation) | Prints the documentation page of a command or `#variable`. | | [`EUOCli init`](#set-a-folder-up-for-an-agent) | Sets a folder of scripts up for AI coding agents. | | [`EUOCli mcp`](#tools-for-an-agent-euocli-mcp) | Gives an AI agent all of the above as tools, and a script it can step through. | `EUOCli help` lists the commands, `EUOCli help run` explains one, and `EUOCli version` prints the version, the same as [`#ReforgedVer`](https://ilpersi.github.io/EasyUOReforged/variables/reforgedver/). The output is UTF-8. ## Check a script EasyUO gives no errors. A line it can't understand is skipped, and the script goes on, so a typo shows up only as a script that does the wrong thing. `EUOCli check` reads a script without running it and reports what EasyUO would skip or misread. It needs no UO client. ```text title="loot.euo" set %bag ABCDEFG ; your loot bag finditm POF G_3 if (#FindCnt > 0) { exevent drag #FindID #FindStak exevent dropc %bag } gosub report ``` ```text > EUOCli check loot.euo loot.euo:2:1: warning [unknown-command] "finditm" is not a command: the interpreter skips this line without an error. Take the command from the command list. If this was meant as a label, it needs a : at the end. loot.euo:3:4: warning [glued-words] "(#FindCnt" is one word to the interpreter: nothing in it is replaced or worked out. Put a space around every operator and parenthesis: ( %a > 1 ), %b + 1. loot.euo:3:16: warning [glued-words] "0)" is one word to the interpreter: nothing in it is replaced or worked out. Put a space around every operator and parenthesis: ( %a > 1 ), %b + 1. loot.euo:5:24: warning [unknown-variable] #FindStak is not a variable of EasyUO: it reads N/A. Take the name from the variable list. loot.euo:8:7: warning [missing-sub] There is no "sub report" in this script: the gosub does nothing. A sub has to be in the same file as its gosub. loot.euo:8: warning [restarts-at-end] After this line the script can reach its end, which starts it again from the first line (in a called file: returns to the caller). End the main part with halt, and put the subs after it. A called file ends with exit. loot.euo: note [needs-client] These commands act on the UO client and are skipped when none is attached: exevent. loot.euo: 6 warnings, 1 note ``` Each finding gives the file, the line and the column, the rule in brackets, what is wrong, and on the next line what to do about it. A script with nothing to report prints `loot.euo: nothing found`. ### The command ```text EUOCli check [more scripts] [--json] [--strict] [--curpath ] ``` | Part | Meaning | |---|---| | `