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:
set %lootbag ABCDEFG ; the ID of your loot bagset %goldtype POF ; the type of gold on your shardfinditem %goldtype C_ , %lootbagdisplay ok Stacks of gold in the bag: #FindCnthaltWith the variable inspector
Section titled “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 and #LObjectType |
| Target something | #LTargetID, or #LTargetX and #LTargetY for a place |
| Open a container or a gump | #ContID, #ContName, #ContKind, #ContSize |
| Stand somewhere | #CharPosX and #CharPosY |
Your own character and backpack need no looking up: they are #CharID and
#BackpackID.
With a probe script
Section titled “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.
event sysmessage Click the object.set #TargCurs 1while #TargCurs = 1 wait 1finditem #LTargetIDdisplay ok ID: #FindID $Type: #FindType $Stack: #FindStackhaltThis one shows the gump on top, for a script that waits for a gump or clicks in one:
display ok Name: #ContName $Kind: #ContKind $Size: #ContSize $Position: #ContPosX #ContPosYhaltA 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 lists every open window, and
the server’s have the name generic_gump:
scangumpsfor #GumpIndex 1 #GumpCnt if #GumpName = generic_gump display ok Type ID: #GumpTypeID $Position: #GumpPosX #GumpPosY $Size: #GumpSizeX #GumpSizeYhaltA 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: it holds what the click sent, in the words
exevent GumpReply takes. Run this probe first, then click:
set %n #GumpReplyCntevent sysmessage Now click the button in the gump.set %t #SCnt + 60repeat wait 5until #GumpReplyCnt <> %n || #SCnt > %tdisplay ok exevent GumpReply #GumpReplyhaltAnd this one shows the newest line of the journal as a script sees it, with _ for spaces, and its colour:
scanjournal 1display ok Text: #Journal $Colour: #JColorhalt