My class

From Kolmafia
Revision as of 04:41, 29 January 2009 by imported>Zarqon
Jump to navigation Jump to search

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 = 1;
 
 if (my_class() == $class[seal clubber] ||
     my_class() == $class[turtle tamer] ||
     my_class() == $class[disco bandit]) {
   rocks = 2;
 }

When not logged in, this function returns $class[none].