visit()

From KoLMafia
Jump to: navigation, search

Function Syntax

boolean visit(coinmaster master )

  • master is the coinmaster to purchase from

Visits a coinmaster to see what is currently for sale there. This is useful for coinmasters whose inventory may change, such as the Hermit, Mr. Store and Traveling Trader. Returns true if the visit was successful or false if it was unsuccessful.

Code Sample

This checks to see if a clover is currently available for purchase.

if(visit($coinmaster[Hermit])) {
   if(sells_item($coinmaster[Hermit], $item[ten-leaf clover])) 
      print("There is still a ten-leaf clover available to purchase today!"); 
   else print("The Hermit is out of clovers. :("); 
} else print(inaccessible_reason($coinmaster[Hermit]));

See Also