Difference between revisions of "Have shop"

From Kolmafia
Jump to navigation Jump to search
imported>Bale
m
imported>Eliteofdelete
 
Line 16: 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}}|

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.