Item type

From Kolmafia
Revision as of 21:45, 5 August 2010 by imported>Icon315
Jump to navigation Jump to search

Function Syntax

string item_type(item check_me )

  • check_me is the item to check

Returns the type of item that check_me is categorized as by KoLmafia. Possible values are all equipment types (see Category:Weapons on Coldfront) or other types (such as hp restore, mp restore, hp+mp restore, food, booze, drink helper, food helper, and familiar larva) that KoLmafia has a programmed action that the item is associated with.

Simple Example

A universal consume function.

if(item_type(it)=="food") eat(qty,it);
else if(item_type(it)=="booze") drink(qty,it);
else use(qty,it);
// Note: this example doesn't check your drunkenness, so it isn't practical for normal use.

Special

For items that KoLmafia doesn't have a programmed function for, this function returns an empty string.