Home API Manuals About Forum
Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

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:

Search distance modifiers:

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