Difference between revisions of "FindItem"

From Wiki
Jump to: navigation, search
(New page: {{command header|Client}} {{body|findItem <nowiki>{{</nowiki>id} <nowiki>|</nowiki> {type} <nowiki>|</nowiki> *} [index] [[G] <nowiki>|</nowiki> [G_{dist}] <nowiki>|</nowiki> [C] <nowiki>...)
(No difference)

Revision as of 22:55, 23 April 2008


Synopsis

findItem {{id} | {type} | *} [index] [[G] | [G_{dist}] | [C] | [C_{container id}]]

Description

The findItem command finds objects given by their ID (6-8 letters) or any object type (2-3 letters). If no index is given the first object found is returned in the #FIND* variables. If an index is given, the {index}'th object is returned in the #FIND*. If * is used instead of an id or an index, all items of all types will be returned.

It is possible to specify multiply object types in the {type} parameter (i.e. NSF_FSF).

C Only objects in containers are returned. (Container must be open)
C_{container id} Only objects in the container given by {container id} are returned. (Container must be open)
G Only objects on the ground are returned.
G_{Dist} Only objects on the ground, and no farther than {dist} are returned.
A Hidden Objects.
CA_{container id} Only hidden objects in the container given by {container id} are returned.


Example

set %regbag XXXXX ; <- replace with your own bag

; find an dagger on the ground within 2 tiles (pickup distance)
; and picks it up and drops it at a specific position
finditem TSF G_2
if #FINDCNT > 0
{
	event Drag #FINDID
	wait 20
	click 200 300 p
}

; find a stack of Black Pearl in a specific bag and moves it
; to a specific position
finditem KUF C_ , %regbag
if #FINDCNT > 0
{
	event Drag #FINDID
	wait 20
	click 200 300 p
}
Note: User Contributed Notes

/docs/Command_findItem.php Add Notes About Notes Roadkill@no.not 25-Sep-2004 15:55 #15 I noticed the A modifier is not listed, after sending someone here. A search of the forums shows very little written, and the best I could find is Cheffe's initial explanation from the 0092 announcement:

New modifiers explained:

Up to now, only visible items could be found when using FINDITEM. Invisible items had to be ignored because it wouldn't always be clear if they could be found or not or whether they would mess up scripts.

Example: A script drags items out of the backpack and drops them onto a closed bag in the bank box. In that situation, the item can still be found until the bank box gets closed even though the item isn't visible. If I remember correctly, older clients used to clean up those invisible items after a few seconds so it wouldn't be clear at all if they were found or not. This effect used to cause problems because scripts tried to drag items that weren't even on screen.

The A modifier (for Advanced or All) tells FINDITEM to include invisible items in the search. This way you can find many new things including equipment, clothing and backpacks of other characters. You can use A alone or in connection with C_contid. (GA doesn't make sense and thus isn't valid.)

Only use A if it is really required! ---end of quote from Cheffe. Note the last sentence! I expect this is a very slow and time consuming command, thus Cheffe's admonition. Roadkill

From this page: http://www.easyuo.com/docs/Command_findItem.php

Note: User Contributed Notes

to distinguish mobs from items : #findStack equal to 0 is mobile
to distinguish corpse types quicker than event Property : #findStack seems to be some type-id

Related Commands

ignoreItem findItem #findCnt
#findID #findType #findX
#findY #findZ #findDist
#findKind #findStack #findBagID
#findMod #findRep #findCol
#findIndex

See Also

Client

  • Client commands are used to send information to the Ultima Online client in order to perform an action or effect some change.
chooseSkill Reads the current skill value/lock status for a specific skill
click Clicks at a specific position in the UO client
cmpPix Compares a current pixel to a previously saved pixel
contPos Moves the active topmost gump to a new position
deleteJournal Forgets the contents of the journal buffer
findItem Finds items, monsters, players, NPCs based on object ID or object type
getShopInfo Retrieves information from the client about the currently shown top entry on a shopping gump
getUOTitle Gets the text on the title bar of the client
hideItem Removes an items graphic from the client
ignoreItem Removes items from the list searched by findItem
key Sends a key-stroke to the client
move Moves the character to a specified location
msg Sends a string to the client as keystrokes
nextCPos Denotes where the next opened container/gump will open
onHotKey Performs a line of code if a specific key is pressed
savePix Saves the color of a pixel in a specified location
setShopItem Sets the number of items to purchase given by ID
setUOTitle Sets the text on the title bar of the client
scanJournal Scans the users journal and stores the string for examination
sleep Waits a specified amount of time
target Waits for a target cursor to appear
terminate Terminates the current client
uoXL Start/manage clients
wait Waits a specified amount of time