From Kolmafia
Jump to navigation Jump to search

Function Syntax

int tavern()

int tavern(string target )

  • target is the (optional) target destination (one of "faucet", "baron", "fight", or "explore".) Defaults to "faucet".

Attempts to complete the level 3 tavern quest, stopping when it has reached the target specified. "faucet" and "baron" will find the faucet and the baron respectively, "fight" will find and fight the baron, and "explore" will explore the entire cellar. Returns the square the faucet or baron is found in, 0 if "explore" is chosen, or -1 if an error is encountered.  

Code Sample

Solve the Typical Tavern.

int square = tavern();
if(get_property("tavernLayout").contains_text("3")) {
   print("Found the Rat Faucet in square " + square);
   if(available_amount($item[Baron von Ratsworth's monocle]) == 0
    && available_amount($item[Baron von Ratsworth's money clip]) == 0
    && available_amount($item[Baron von Ratsworth's tophat]) == 0
    && user_confirm("Do you want to fight Baron Von Ratsworth?")) {
} else print("Did not find the rat faucet.", "red");

CLI Equivalent

The CLI commands "tavern" and "baron" function similarly.

See Also

chamber() | entryway() | guardians() | hedgemaze()