Difference between revisions of "Class modifier"

From Kolmafia
Jump to navigation Jump to search
imported>Slyz
(Created page with '{{ #vardefine:name|class_modifier}}{{ #vardefine:return_type|class}}{{ FunctionPage| name={{#var:name}}| function_category=Modifier Functions| function1={{Function| name={{#var…')
 
imported>Bale
m
 
(One intermediate revision by one other user not shown)
Line 5: Line 5:
 
FunctionPage|
 
FunctionPage|
 
name={{#var:name}}|
 
name={{#var:name}}|
function_category=Modifier Functions|
 
  
 
function1={{Function|
 
function1={{Function|
Line 38: Line 37:
 
code=
 
code=
 
<syntaxhighlight>
 
<syntaxhighlight>
foreach it in $items[chintzy seal pendant, chintzy turtle brooch, chintzy noodle ring, chintzy saucepan earring, chintzy disco ball pendant, chintzy accordion pin]
+
foreach it in $items[chintzy seal pendant, chintzy turtle brooch,
 +
                    chintzy noodle ring, chintzy saucepan earring,
 +
                    chintzy disco ball pendant, chintzy accordion pin]
 
   if ( class_modifier( it, "Class" ) == my_class() )
 
   if ( class_modifier( it, "Class" ) == my_class() )
 
       print("Your class chintzy item is the " + it +".") ;
 
       print("Your class chintzy item is the " + it +".") ;
Line 44: Line 45:
 
more_info= See [http://kolmafia.us/showthread.php?802 this thread] for details.|
 
more_info= See [http://kolmafia.us/showthread.php?802 this thread] for details.|
 
}}
 
}}
 +
 +
[[Category:Modifier Functions]]

Latest revision as of 05:24, 22 May 2010

Function Syntax

class class_modifier(item check_me ,string modifier_name )

class class_modifier(string check_me ,string modifier_name )

Returns a class if check_me is class specific. modifier_name should be "Class".

Code Sample

Prints the class which benefits from using a chintzy saucepan earring:

class cls = class_modifier( $item[chintzy saucepan earring] , "Class" );
print(cls);

This prints the chintzy item corresponding to your class:

foreach it in $items[chintzy seal pendant, chintzy turtle brooch,
                     chintzy noodle ring, chintzy saucepan earring,
                     chintzy disco ball pendant, chintzy accordion pin]
   if ( class_modifier( it, "Class" ) == my_class() )
      print("Your class chintzy item is the " + it +".") ;

More Information

See this thread for details.