Difference between revisions of "My maxmp"

From Kolmafia
Jump to navigation Jump to search
imported>Zarqon
(more links, better example, consistent formatting, logged-out info)
imported>Grotfang
m (moved My maxmp() to My maxmp: Conformity)
(No difference)

Revision as of 13:22, 1 March 2010

int my_maxmp()

Returns the logged-in character's maximum MP level as an int.

The following example attempts to ensure that you are able to cast Olfaction before adventuring:

 location bountylocation = $location[Hole in the Sky];
 if (my_maxmp() < mp_cost($skill[transcendant olfaction])) {
   print("You are unable to cast Olfaction.","red");
 } else {
   restore_mp(mp_cost($skill[transcendant olfaction]));
 }
 adventure(my_adventures(),bountylocation);

When not logged in, this function returns 0.