My name

From Kolmafia
Revision as of 04:42, 29 January 2009 by imported>Zarqon (changed pre tags to code tags for consistency)
Jump to navigation Jump to search

string my_name()

This function returns the logged-in character's name as a string in all lowercase.

  1. Script checks players name. If your name returns ZammyWarrior it will import Zammy Morning.ash script.
  2. If name returns Hippymon it will import Hippymon Morning.ash script.
  3. Great script for one with multiple accounts as a "breakfast script".

if (my_name() == "zammywarrior"){

  import <Zammy Morning.ash>;

} else if (my_name() == "hippymon"){

  import <Hippy Morning.ash>;

}

Note that even if your name is capitalized in KoL, my_name() will convert it to lowercase:

if (my_name() == "My Capitalized Name") {

 // this block of commands will never be performed

}

When not logged in, this fuction returns an empty string.