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

Count

Searching for items with type ObjType in backpack and returning FindFullQuantity.

NB: This method doesn’t search in subcontainers

Pascal

function Count(ObjType : Word) : Integer;

Python

def Count(ObjType) -> Integer

Example Pascal

Program New;
var foodamount: integer;
begin
 if (count(food) < maxfood) then
  begin
   foodamount:=count (food);
   FindType(food,ground);
   if FindQuantity = 0 then continue;
   if (FindQuantity > (maxfood-food)) then
      grab (finditem, maxfood-food);
   else 
      grab (finditem, 0);
   wait (200);
  end;
end.```