Drink: Difference between revisions

From Kolmafia
Jump to navigation Jump to search
imported>StDoodle
mNo edit summary
imported>Bale
added code sample
Line 20: Line 20:
function_description=Will attempt to drink {{pspan|qty}} amount of item {{pspan|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.|
function_description=Will attempt to drink {{pspan|qty}} amount of item {{pspan|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.|


needscode=yes|
code1={{CodeSample|
title=Code Sample|
description=Drinks maximum amount of tangaritas without getting drunk.|
code=
<syntaxhighlight>
int amount = (inebriety_limit() - my_inebriety()) / 4;
drink(amount, $item[tangarita]);
</syntaxhighlight>
}}|


see_also={{SeeAlso|can_drink|drink_silent|inebriety_limit|my_inebriety}}|
see_also={{SeeAlso|can_drink|drink_silent|inebriety_limit|my_inebriety}}|
cli_equiv=The CLI command "drink" works similarly.|
cli_equiv=The CLI command "drink" works similarly.|
}}
}}

Revision as of 09:52, 10 March 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 = (inebriety_limit() - my_inebriety()) / 4;
drink(amount, $item[tangarita]);

CLI Equivalent

The CLI command "drink" works similarly.

See Also

can_drink() | drink_silent() | inebriety_limit() | my_inebriety()