Difference between revisions of "Have shop"

From Kolmafia
Jump to navigation Jump to search
imported>StDoodle
(Created page with '{{ #vardefine:name|have_shop}}{{ #vardefine:return_type|boolean}}{{ FunctionPage| name={{#var:name}}| function_category=Item Management| function1={{Function| name={{#var:name…')
 
imported>Eliteofdelete
 
(One intermediate revision by one other user not shown)
Line 6: Line 6:
  
 
name={{#var:name}}|
 
name={{#var:name}}|
function_category=Item Management|
 
  
 
function1={{Function|
 
function1={{Function|
Line 17: Line 16:
 
function_description=Returns true if you have a mall store, false otherwise.|
 
function_description=Returns true if you have a mall store, false otherwise.|
  
needscode=yes|
+
code1={{CodeSample|
 +
title=Code Samples|
 +
description=Informs you if you have a shop in the mall of loathing. If not, it checks to see if you are able to get one.|
 +
code=
 +
<syntaxhighlight>
 +
if (have_shop())
 +
  print("You have a shop in the Mall of Loathing!", "green");
 +
else if (my_meat() < 50000)
 +
  print("You need 50,000 meat for a shop!", "red");
 +
else if (my_level() < 9)
 +
  print("You need to be at least level 9 to purchase a shop", "red");
 +
else print("You currently do not have a shop but have the means to get one. You should buy one.", "green");
 +
</syntaxhighlight>|
 +
 
 +
}}|
  
 
see_also={{SeeAlso|have_display}}|
 
see_also={{SeeAlso|have_display}}|
 
special=This function returns false if no character is logged in.|
 
special=This function returns false if no character is logged in.|
 
}}
 
}}
 +
 +
[[Category:Item Management]]

Latest revision as of 03:37, 14 January 2015

Function Syntax

boolean have_shop()

Returns true if you have a mall store, false otherwise.

Code Samples

Informs you if you have a shop in the mall of loathing. If not, it checks to see if you are able to get one.

if (have_shop())
   print("You have a shop in the Mall of Loathing!", "green");
else if (my_meat() < 50000)
   print("You need 50,000 meat for a shop!", "red");
else if (my_level() < 9)
   print("You need to be at least level 9 to purchase a shop", "red");
else print("You currently do not have a shop but have the means to get one. You should buy one.", "green");

See Also

have_display()

Special

This function returns false if no character is logged in.