Difference between pages "Get chateau" and "Get all properties"

From Kolmafia
(Difference between pages)
Jump to navigation Jump to search
imported>Relyk
 
imported>Smelltastic
 
Line 1: Line 1:
 
{{
 
{{
#vardefine:name|get_chateau}}{{
+
#vardefine:name|get_all_properties}}{{
#vardefine:return_type|int [item]}}{{
+
#vardefine:return_type|boolean [string]}}{{
 
#vardefine:aggregate|yes}}{{
 
#vardefine:aggregate|yes}}{{
  
 
FunctionPage|
 
FunctionPage|
 +
 
name={{#var:name}}|
 
name={{#var:name}}|
  
Line 14: Line 15:
 
}}|
 
}}|
  
function_description=Returns a map of your campground items as integers, keyed by item names.
+
function_description=Returns a map from name to a boolean which is true if the property is supported by KoLmafia itself or false if its for/by user scripts. The "global" boolean argument says whether to get properties from the GLOBAL prefs file or the NAME prefs file of the current user.|
<ul>
 
<li> Most values will be 1 to represent the item exists.</li>
 
<li> Not all items will be included, players must purchase at least one item for each spot to appear.</li>
 
<li> Your painting is accessed separately with its own properties.</li>
 
</ul>|
 
 
 
code1={{CodeSample|
 
title=Code Sample|
 
description=The following checks if Chateau Mantegna is available and then prints the contents and painting status.|
 
code=
 
<syntaxhighlight>
 
  if(to_boolean(get_property("chateauAvailable")))
 
  {
 
    int [item] chateau = get_chateau();
 
    foreach furniture in chateau
 
    {
 
      print(furniture + " " + chateau[furniture]);
 
    }
 
  
    string painting = get_property("chateauMonster");
+
needscode=yes|
    string fought = get_property("_chateauMonsterFought");
 
    print(painting + " " + fought);
 
  }
 
</syntaxhighlight>}}|
 
  
see_also={{SeeAlso|get_campground}}|
+
see_also={{SeeAlso|Miscellaneous_Functions#Property_Functions}}|
 
}}
 
}}
  
[[Category:Item Management]]
+
[[Category:Property Functions]]

Revision as of 23:48, 20 March 2017

needs(code_samples);

Function Syntax

boolean [string] get_all_properties()

Returns a map from name to a boolean which is true if the property is supported by KoLmafia itself or false if its for/by user scripts. The "global" boolean argument says whether to get properties from the GLOBAL prefs file or the NAME prefs file of the current user.

See Also

Miscellaneous_Functions#Property_Functions()