From Stealth Client

Jump to: navigation, search


FindTypeEx

function FindTypeEx(ObjType:Word; Color:Word; Container:Cardinal; InSub:Boolean):Cardinal

Searches for the specified object type ObjType and color Color in that container, Container.

InSub includes a search mode in the pouches(containers within the specified container).

Search results for:

  • A list of found objects is stored in the FindedList, which can be obtained, ipolzuya function Doc:Api/GetFindedList
  • The last object was found recorded in the Doc:Api/FindItem
  • The last object found is returned rezutatom perform this function
  • The Doc:Api/FindCount recorded count found aytemov(a stack of several "stekirovannyh" aytemov is considered as one aytem!)
  • The Doc:Api/FindQuantity entered aytemov count on the stack(the stack), if the latter is aytem stack(stack)
  • The Doc:Api/FindFullQuantity recorded the total number of aytemov all I found stacks(if such there in the results, it will be equal to Doc:Api/FindCount

At the distance of the search depends on:

  • Doc:Api/FindDistance - specifies the search range for the horizontal cells. 3 - then will look at each other and within a radius of three cells. The default value is 2(taken as the default on most servers as the maximum distance at which an ordinary player under normal conditions can raise or put the thing)
  • Doc:Api/FindVertical - specifies the search range for the vertical. The default is 5, so as not to affect adjacent floors in the search.

If nothing is found - return 0.

The parameter Container can be used:

If you specify a nonexistent container ID, the search is performed in a backpack chara The parameter Color can be used:

  • $ FFFF(-1) - if the color is not considered in the search
  • The color you want aytema

FindTypeEx with parameters Color = $ FFFF and InSub = False still function Doc:Api/FindType

Example 1:

if FindTypeEx(bottle_type,bottle_color,Ground,false) > 0 then
begin
  UseObject(FindItem);
end;

Example 2:

  FindTypeEx(runes, runes_color, backpack, true);
  AddToSystemJournal('Runes found:' + IntToStr(FindCount));