My class: Difference between revisions

From Kolmafia
Jump to navigation Jump to search
imported>Metraxis
No edit summary
 
imported>Metraxis
No edit summary
Line 2: Line 2:


This function returns the logged-in character's current class as a [[class]].
This function returns the logged-in character's current class as a [[class]].
As an example, the following code snippet decides how many big rocks to acquire based on the character's class:
<code>
  [[int]] rocks;
 
  if([[my_class()]] == $[[class]][Seal Clubber] ||
  [[my_class()]] == $[[class]][Turtle Tamer] ||
  [[my_class()]] == $[[class]][Disco Bandit]) {
    rocks = 2;
  } else {
    rocks = 1;
  }
</code>

Revision as of 07:33, 17 January 2007

class my_class()

This function returns the logged-in character's current class as a class.

As an example, the following code snippet decides how many big rocks to acquire based on the character's class:

 int rocks;
 
 if(my_class() == $class[Seal Clubber] ||
  my_class() == $class[Turtle Tamer] ||
  my_class() == $class[Disco Bandit]) {
   rocks = 2;
 } else {
   rocks = 1;
 }