Overdrink: Difference between revisions
Jump to navigation
Jump to search
imported>Eliteofdelete Code Example |
imported>Eliteofdelete No edit summary |
||
Line 21: | Line 21: | ||
code1={{CodeSample| | code1={{CodeSample| | ||
title=Code Samples| | title=Code Samples| | ||
description=This will drink Mae West without Ode without a warning if you are unable to get Ode.| | description=This will drink 1 Mae West without Ode without a warning if you are unable to get Ode.| | ||
code= | code= | ||
<syntaxhighlight> | <syntaxhighlight> | ||
Line 34: | Line 34: | ||
</syntaxhighlight>| | </syntaxhighlight>| | ||
moreinfo= | moreinfo= | ||
Beware: Since it suppresses the overdrink warning, it is wise to do checks to assure you don't accidentally overdrink when using it to prevent the Ode Warning. | |||
}}| | }}| | ||
Revision as of 08:16, 11 January 2015
Function Syntax
boolean overdrink(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.) Using this command, rather than drink()
, suppresses warning dialogs for overdrinking and drinking without Ode to Booze.
Code Samples
This will drink 1 Mae West without Ode without a warning if you are unable to get Ode.
if (!have_skill($skill[The Ode to Booze]) && !can_interact()) {
if (inebriety_limit() >= my_inebriety()+4) { //Make sure we are not over drinking with the Mea West
print("You don't have Ode and can't get it, drinking Mae West anyways.");
overdrink(1, $item[Mae West]); //Overdrink Prevents Ode Warning
}
else print("You do not have enough inebriety left to prevent overdrunkeness");
}
else print("You should cast or acquire the Ode Buff before drinking.");
Beware: Since it suppresses the overdrink warning, it is wise to do checks to assure you don't accidentally overdrink when using it to prevent the Ode Warning.
CLI Equivalent
The CLI command "drink" works similarly.