Eat: Difference between revisions

From Kolmafia
Jump to navigation Jump to search
No edit summary
Added details about boolean return value.
Line 1: Line 1:
'''[[boolean]] eat(int number, item itemtype)'''
'''[[boolean]] eat(int quantity, item itemtype)'''


Will attempt to eat the number of food specified.
Will attempt to eat the number of food specified. The return value only tells you whether the item can be eaten, not if you have enough room for it.


eg.
So,<br>
<code>
<code>
eat(3,$item[stinky hi mein]);
eat(3,$item[stinky hi mein]);
</code>
</code>
will attempt to eat 3 stinky hi meins.
<br>
will eat 3 stinky hi meins (depending on fullness) and return true.
 
While,
<br>
<code>
eat(3,$item[blue pixel]);
</code>
<br>
will tell you that a blue pixel cannot be consumed and return false.

Revision as of 13:37, 20 December 2009

boolean eat(int quantity, item itemtype)

Will attempt to eat the number of food specified. The return value only tells you whether the item can be eaten, not if you have enough room for it.

So,
eat(3,$item[stinky hi mein]);
will eat 3 stinky hi meins (depending on fullness) and return true.

While,
eat(3,$item[blue pixel]);
will tell you that a blue pixel cannot be consumed and return false.