Can drink

From Kolmafia
Revision as of 07:08, 5 April 2020 by imported>Taltamir (plumber also returns false)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Function Syntax

boolean can_drink()

This function returns true if the logged-in character is not subject to dietary restrictions that completely forbid drinking. Those being Plumber, Teetotaler, or Oxygenarian path. If the character is subject to those restrictions this function returns false.

Code Samples

If the character is able to drink, this code will make them drink 3 bottles of gin.

if(can_drink()) {
   drink(3 , $item[bottle of gin]);
}

See Also

can_eat() | drink()

Special

When not logged in, this function returns true.