Use : function to search an item in hero's invent and return if present otherwise nil
: For multiple instances of same item, first one is returned
Arguments:
hscript hero : the player's hero
string itemname: Item name for e.g. "item_blink"
bool stash : whether to search stash slots also
bool dropped : whether to search dropped items also
Returns Values :
Returns a table with key,
Item: if found in slots
PhysicalItem: if dropped item
Otherwise nil
Use : function to remove an item in hero's invent if present
: For multiple instances of same item, first one is removed only
Arguments:
hscript hero : the player's hero
string itemname: Item name for e.g. "item_blink"
bool stash : whether to search stash slots also
bool dropped : whether to search dropped items also
Returns Values : true on Success otherwise false
[1]
[2]