Elemental resistance: Difference between revisions

From Kolmafia
Jump to navigation Jump to search
imported>Grotfang
mNo edit summary
imported>Grotfang
No edit summary
Line 7: Line 7:
<code>
<code>
   [[boolean]] hot_check() {
   [[boolean]] hot_check() {
     if( elemental_resistance( $element[hot] ) > 20 )
     if( '''elemental_resistance( $element[hot] )''' > 20 )
         return true;
         return true;
     else
     else

Revision as of 14:29, 22 February 2010

elemental_resistance()

Returns your current resistance for a specified element in the form of a float.

The following function returns true if you have a resistance greater than 20 for the element "hot".

 boolean hot_check() {
   if( elemental_resistance( $element[hot] ) > 20 )
       return true;
   else
       return false;
 }

When not logged in the function returns 0 (needs spading).