My level: Difference between revisions

From Kolmafia
Jump to navigation Jump to search
imported>Efilnikufecin
m fixed spelling error
imported>Efilnikufecin
No edit summary
Line 15: Line 15:
       ...etc...
       ...etc...
</code>
</code>
[[Category:Your Character | My level()]]

Revision as of 12:47, 26 June 2007

int my_level()

This function returns the logged-in character's current level as an int, and is easily used as an initial test to avoid aborts and loops in scripts which attempt to burn adventures in specific areas due to the targeted area being unavailable. An example:

location select_farming_area() {
  if(my_level() >= 10) {
    if(item_amount($item[S.O.C.K.]) + ...
     item_amount($item[intragalactic rowboat]) > 0) {
      return $location[Castle in the Clouds in the Sky];
    } else {
      return $location[Penultimate Fantasy Airship];
    }
  } else if(my_level() >= 8) { 
     ...etc...