Difference between pages "Sell" and "Visit"
(Difference between pages)
Jump to navigation
Jump to search
imported>Gnocchi masala m (Fix obsolete syntax) |
imported>Bale (r9555) |
||
Line 1: | Line 1: | ||
{{ | {{ | ||
− | #vardefine:name| | + | #vardefine:name|visit}}{{ |
#vardefine:return_type|boolean}}{{ | #vardefine:return_type|boolean}}{{ | ||
Line 12: | Line 12: | ||
return_also={{#var:return_also}}| | return_also={{#var:return_also}}| | ||
parameter1={{Param|coinmaster|master}}| | parameter1={{Param|coinmaster|master}}| | ||
− | |||
− | |||
p1desc={{pspan|master}} is the coinmaster to purchase from| | p1desc={{pspan|master}} is the coinmaster to purchase from| | ||
− | + | ||
− | |||
}}| | }}| | ||
− | function_description= | + | function_description=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.| |
code1={{CodeSample| | code1={{CodeSample| | ||
title=Code Sample| | title=Code Sample| | ||
− | description=This | + | description=This checks to see if a clover is currently available for purchase.| |
code= | code= | ||
<syntaxhighlight> | <syntaxhighlight> | ||
− | + | if(visit($coinmaster[Hermit])) { | |
− | + | if(sells_item($coinmaster[Hermit], $item[ten-leaf clover])) | |
− | if( | + | print("There is still a ten-leaf clover available to purchase today!"); |
− | print(" | + | else print("The Hermit is out of clovers. :("); |
− | + | } else print(inaccessible_reason($coinmaster[Hermit])); | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
</syntaxhighlight> | </syntaxhighlight> | ||
}}| | }}| | ||
− | see_also={{SeeAlso| | + | see_also={{SeeAlso|is_accessible|sells_item|buys_item}}| |
}} | }} | ||
[[Category:Item Management]] | [[Category:Item Management]] |
Latest revision as of 06:04, 20 July 2011
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]));