Tavern: Difference between revisions

From Kolmafia
Jump to navigation Jump to search
imported>Bale
small format issue
imported>StDoodle
assumed no means no? ;)
Line 46: Line 46:
cli_equiv=The CLI command "tavern" functions similarly.|
cli_equiv=The CLI command "tavern" functions similarly.|
more_info= |
more_info= |
special=The function will turn off the faucet, and will not attempt to find and / or fight the baron.|
special=The function will not turn off the faucet, and will not attempt to find and / or fight the baron.|
}}
}}

Revision as of 20:54, 10 March 2010

Function Syntax

int tavern()

Attempts to complete the level 3 tavern quest, stopping when it finds the rat faucet. Returns the number of squares visited.

  • It will stop before actually turning off the faucet.
  • If the quest was already completed, it will return the number of explored squares.
  • If you run out of turns, it will return the number of explored squares.

    Code Sample

    Solve the Typical Tavern.

if(get_property("lastTavernAscension").to_int() == my_ascensions()) {
   print("You've already turned off the Rat Faucet!");
} else {
   int turns = tavern();
   if(get_property("tavernLayout").contains_text("3")) {
      print("Found the Rat Faucet in "+ turns+ " adventures.");
      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?")) {
        print("You'll have to do the next bit yourself. Sorry.", "red");
      } else {
        visit_url("rats.php?action=faucetoff");
      }
   } else print("Spent "+ turns+ " adventures searching, but did not find the rat faucet.", "red");
}

CLI Equivalent

The CLI command "tavern" functions similarly.

See Also

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

Special

The function will not turn off the faucet, and will not attempt to find and / or fight the baron.