Difference between revisions of "My primestat"

From Kolmafia
Jump to navigation Jump to search
imported>Grotfang
imported>PhilmASTErpLus
(Reformatted code)
 
(3 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{#vardefine:name|my_primestat}}
+
{{
{{#vardefine:return_type|stat}}
+
#vardefine:name|my_primestat}}{{
 +
#vardefine:return_type|stat}}{{
  
{{FunctionPage|
+
FunctionPage|
 
name={{#var:name}}|
 
name={{#var:name}}|
function_category=Your Character|
 
  
 
function1={{Function|
 
function1={{Function|
Line 17: Line 17:
 
code1={{CodeSample|
 
code1={{CodeSample|
 
title=Code Samples|
 
title=Code Samples|
description=The following example attempts to create as many scrumpdiddlyumptious solutions as you have scrumptious reagents if you are a mysticality class.|
+
description=The following example attempts to create as many scrumpdiddlyumptious solutions as you have scrumptious reagents if you can access the Mysticality guild store. Since Accordion Thieves above level 9 can also access {{kolwiki|Gouda's Grimoire and Grocery}}, this code checks for it as well.|
 
code=
 
code=
 
<syntaxhighlight>
 
<syntaxhighlight>
if(my_primestat() == $stat[mysticality]) {
+
if ((my_primestat() == $stat[mysticality] || (my_class() == $class[Accordion Thief] && my_level() > 9))
 +
      && guild_store_available())
 +
{
 
   retrieve_item(item_amount($item[scrumptious reagent]) , $item[delectable catalyst]);
 
   retrieve_item(item_amount($item[scrumptious reagent]) , $item[delectable catalyst]);
 
   use(item_amount($item[delectable catalyst]) , $item[delectable catalyst]);
 
   use(item_amount($item[delectable catalyst]) , $item[delectable catalyst]);
Line 30: Line 32:
 
special=When not logged in, this function returns $stat[moxie] (Needs spading).
 
special=When not logged in, this function returns $stat[moxie] (Needs spading).
 
}}
 
}}
 +
 +
[[Category:Your Character]]

Latest revision as of 19:58, 16 September 2010

Function Syntax

stat my_primestat()

Returns the stat associated with your class.

Code Samples

The following example attempts to create as many scrumpdiddlyumptious solutions as you have scrumptious reagents if you can access the Mysticality guild store. Since Accordion Thieves above level 9 can also access Gouda's Grimoire and Grocery, this code checks for it as well.

if ((my_primestat() == $stat[mysticality] || (my_class() == $class[Accordion Thief] && my_level() > 9))
      && guild_store_available())
{
   retrieve_item(item_amount($item[scrumptious reagent]) , $item[delectable catalyst]);
   use(item_amount($item[delectable catalyst]) , $item[delectable catalyst]);
}

See Also

retrieve_item() | item_amount() | use()

Special

When not logged in, this function returns $stat[moxie] (Needs spading).