My maxmp: Difference between revisions

From Kolmafia
Jump to navigation Jump to search
imported>Grotfang
No edit summary
imported>Grotfang
mNo edit summary
Line 31: Line 31:
}}|
}}|


see_also={{SeeAlso|my_maxhp|mp_cost|restore_mp|my_adventures}}|
see_also={{SeeAlso|my_maxhp|my_mp|mp_cost|restore_mp|my_adventures}}|
special=When not logged in, this function returns 0.
special=When not logged in, this function returns 0.
}}
}}

Revision as of 13:34, 1 March 2010



Function Syntax

int my_maxmp()

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

Code Samples

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);

See Also

my_maxhp() | my_mp() | mp_cost() | restore_mp() | my_adventures()

Special

When not logged in, this function returns 0.