Difference between revisions of "My mp"

From Kolmafia
Jump to navigation Jump to search
imported>Zarqon
(more links, consistent formatting, logged-out info)
imported>Bale
m
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
[[int]] [[my_mp()]]
+
{{
 +
#vardefine:name|my_mp}}{{
 +
#vardefine:return_type|int}}{{
  
Returns your current MP level as an [[int]].
+
FunctionPage|
 +
name={{#var:name}}|
  
The following example will attempt to restore you to full MP when your MP reaches 0.
+
function1={{Function|
 +
name={{#var:name}}|
 +
aggregate={{#var:aggregate}}|
 +
return_type={{#var:return_type}}|
 +
return_also={{#var:return_also}}
 +
}}|
  
<code>
+
function_description=Returns your current MP level as an int.|
  if ([[my_mp()]] == 0) {
 
    [[restore_mp()|restore_mp]]([[my_maxmp()]]);
 
  }
 
</code>
 
[[Category:Your Character | My mp()]]
 
[[Category:Ash Functions |My mp()]]
 
  
When not logged in, this function returns 0.
+
code1={{CodeSample|
 +
title=Code Samples|
 +
description=The following example will attempt to restore you to full MP when your MP reaches 0.|
 +
code=
 +
<syntaxhighlight>
 +
if(my_mp() == 0) {
 +
  restore_mp(my_maxmp());
 +
}
 +
</syntaxhighlight>
 +
}}|
 +
 
 +
see_also={{SeeAlso|my_maxmp|restore_mp}}|
 +
special=When not logged in, this function returns 0.
 +
}}
 +
 
 +
[[Category:Your Character]]

Latest revision as of 21:33, 21 May 2010

Function Syntax

int my_mp()

Returns your current MP level as an int.

Code Samples

The following example will attempt to restore you to full MP when your MP reaches 0.

if(my_mp() == 0) {
   restore_mp(my_maxmp());
}

See Also

my_maxmp() | restore_mp()

Special

When not logged in, this function returns 0.