My inebriety

From Kolmafia
Revision as of 13:04, 26 June 2007 by imported>Efilnikufecin
Jump to navigation Jump to search

int my_inebriety()

This function returns the logged-in character's current level of drunkenness as an int. This information, combined with the character's inebriety_limit(), is vital for any script which intends to drink for the character, but without overdrinking.

An example:

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