FindType
Search for the objects with specified type ObjType in specified container Container.
Returns the last object found using the function.
If no objects found, or char disconnected - returns 0.
NB: THis method is NOT searching in subcontainers! For searching in subcontainers use FindTypeEx with True in last param.
Search result:
- A list of found objects can be obtained ny methods GetFindedList or GetFoundItems
- The last object was found also stored in FindItem
- FindCount returns amount of found items (without stacks content)
- FindQuantity returns quantity of last finded object (object field).
- FindFullQuantity returns amount of found items (including stacks content)
Search distance modifiers:
- FindDistance - specifies the search range by horizontal
- FindVertical - specifies the search range by vertical
The parameter Container can be:
- Backpack
- Ground
- $FFFFFFFF(= -1)
- ID of the required container (if object with ID not exists, searching in Backpack)
If ObjType = -1($FFFF) - will search ANY objects.
Pascal
function FindType(ObjType:Word; Container:Cardinal) : Cardinal
Python
def FindType(ObjType, Container): -> uint
Example Pascal
if FindType(bottle_type,Ground) > 0 then
begin
UseObject(FindItem);
end;
Example Python
FindType(runes, Backpack())
AddAddToSystemJournal('Runes found: {0}'.format(FindCount()))