My name

From Kolmafia
Revision as of 12:16, 25 February 2010 by imported>StDoodle
Jump to navigation Jump to search

Function Syntax

Returns the name of the logged-in character.

Code Samples

This example imports different breakfast scripts depending on which character is running the script.

if (my_name() == "MyMain") {
  import <MainBreakfast.ash>;
}
else if (my_name() == "MyMulti") {
  import <MultiBreakfast.ash>;
}

Note that capitalization is not strictly adhered to (much as with the chat command "/whois" in game). The following two examples are functionally equivalent.

if ([[my_name()]] == "MyCharacter") {
  //code
}
if ([[my_name()]] == "MyCharacter") {
  //code
}

Special

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