Skip to content

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 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

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.

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 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:

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 lists every open window, and the server’s have the name generic_gump:

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: it holds what the click sent, in the words exevent GumpReply takes. Run this probe first, then click:

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:

scanjournal 1
display ok Text: #Journal $Colour: #JColor
halt