Difference between revisions of "Drink"

From Kolmafia
Jump to navigation Jump to search
imported>Bale
(heh)
imported>Bale
m
Line 5: Line 5:
 
FunctionPage|
 
FunctionPage|
 
name={{#var:name}}|
 
name={{#var:name}}|
function_category=Item Management|
 
  
 
function1={{Function|
 
function1={{Function|
Line 33: Line 32:
 
cli_equiv=The CLI command "drink" works similarly.|
 
cli_equiv=The CLI command "drink" works similarly.|
 
}}
 
}}
 +
 +
[[Category:Item Management]]

Revision as of 22:06, 21 May 2010

Function Syntax

boolean drink(int qty ,item consume )

  • qty is the quantity to drink
  • consume is the item to drink

Will attempt to drink qty amount of item consume. Returns true for drinkable items and false for items that are not. (The return value does not reflect whether or not the items were actually consumed.) If this command will cause you to overdrink, a warning dialog will be given. Using this command without Ode to Booze active, when you have the skill & required MP to cast it, will give a warning about drinking without Ode.

Code Sample

Drinks maximum amount of tangaritas without getting drunk.

int amount = floor((inebriety_limit() - my_inebriety()) / 4);
drink(amount, $item[tangarita]);

CLI Equivalent

The CLI command "drink" works similarly.

See Also

can_drink() | overdrink() | inebriety_limit() | my_inebriety()