Item type: Difference between revisions
Jump to navigation
Jump to search
imported>Icon315 No edit summary |
imported>Bale Revision 10247: pasta guardian! |
||
Line 15: | Line 15: | ||
}}| | }}| | ||
function_description=Returns the type of item that {{pspan|check_me}} is categorized as by KoLmafia. Possible values are all equipment types (see {{kolwiki|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.| | function_description=Returns the type of item that {{pspan|check_me}} is categorized as by KoLmafia. Possible values are all equipment types (see {{kolwiki|Category:Weapons}} on Coldfront) or other types (such as hp restore, mp restore, hp+mp restore, food, booze, drink helper, food helper, pasta guardian, and familiar larva) that KoLmafia has a programmed action that the item is associated with.| | ||
code1={{CodeSample| | code1={{CodeSample| |
Revision as of 00:12, 17 January 2012
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, pasta guardian, 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.