FindItem
finditem {type|id}[_{type|id}...] [index] [G|G_{range}|C|C_{container}|A|CA_{container}]- Sets
#FindID,#FindType,#FindX,#FindY,#FindZ,#FindDist,#FindKind,#FindStack,#FindBagID,#FindLayer,#FindRep,#FindCol,#FindIndex,#FindCnt- uo.dll
ScanItems
Also searchable as: FindItem · find item · search item · scan items · find object
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;
#FindCnt says how many objects matched.
Parameters
Section titled “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. |
CA_{container} |
Like C_{container}, including objects the client doesn’t show. |
Reading the results
Section titled “Reading the results”- Found:
#FindCntis 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,#FindRepand#FindCol. For an object a character wears,#FindLayeris the layer it is worn in. - Not found:
#FindCntis0,#FindKindis-1, and#FindIDand#FindTypereadX. Test#FindCntor#FindKind, not#FindID. - The other matches: set
#FindIndexto 2, 3, …#FindCntto select them one after the other. This reuses the snapshot, so it is much faster than callingFindItemagain.
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
Section titled “Examples”Pick up a dagger lying within 2 tiles and drop it at a screen position:
finditem TSF G_2if #FindCnt > 0{ event Drag #FindID wait 20 click 200 300 p}haltMove a stack of black pearl out of a known bag. The comma glues C_ and the bag ID into a single
C_ABCDEFG parameter:
set %regbag ABCDEFG ; your reagent bag's IDfinditem KUF C_ , %regbagif #FindCnt > 0{ event Drag #FindID wait 20 click 200 300 p}haltCount the gold stacks in the backpack and list each one:
finditem POF C_ , #BackpackIDfor %i 1 #FindCnt{ set #FindIndex %i display ok Stack %i : #FindStack gold}haltHidden objects
Section titled “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
Section titled “Items and characters”#FindStack is 0 for characters (mobiles), so it is a quick way to tell them apart from items.
Reforged notes
Section titled “Reforged notes”FindItemalso fills#FindLayer: the layer a character wears the selected object in, orN/Awhen nobody wears it. Which objects it finds, and every other#Find…variable, are unchanged.
See also
Based on the EasyUO wiki, edited for EasyUO Reforged. This text is available under the GNU Free Documentation License 1.2.