My inebriety: Difference between revisions

From Kolmafia
Jump to navigation Jump to search
imported>Zarqon
m a couple spaces
imported>StDoodle
(No difference)

Revision as of 19:47, 28 February 2010

int my_inebriety()

This function returns the logged-in character's current level of drunkenness as an int. Common uses include 1) checking to see if you are drunk:

 if (my_inebriety() > inebriety_limit()) abort("You are too plastered to continue.");

2) With the help of inebriety_limit(), drinking for the character without overdrinking:

 if (inebriety_limit() - my_inebriety() < 5) {
   int advisable = inebriety_limit() - my_inebriety() - 1;
   drink(advisable,$item[Ram's Face Lager]);
 }

And 3) drinking as many as possible of something:

 drink(floor((inebriety_limit() - my_inebriety()) / 2), $item[shot of peach schnapps]);

When not logged in, this function returns 0.