My name: Difference between revisions
Jump to navigation
Jump to search
imported>Zarqon m still more links |
imported>That FN Ninja m my_name() is not case sensative. |
||
Line 1: | Line 1: | ||
[[string]] [[my_name()]] | [[string]] [[my_name()]] | ||
This function returns the logged-in character's name as a [[string]] | This function returns the logged-in character's name as a [[string]]. | ||
This example imports different breakfast scripts depending on which character is running the script. | This example imports different breakfast scripts depending on which character is running the script. | ||
Line 13: | Line 13: | ||
</code> | </code> | ||
Note that | Note that capitalization is not strictly adhered to. When using [[my_name()]] the following examples are functionally equivalent: | ||
<code> | <code> | ||
if ([[my_name()]] == " | if ([[my_name()]] == "That FN Ninja") { | ||
[[comments| // code]] | |||
} | |||
</code> | |||
<code> | |||
if ([[my_name()]] == "that fn ninja") { | |||
[[comments|// code]] | |||
} | } | ||
</code> | </code> | ||
Line 23: | Line 29: | ||
[[Category:Ash Functions | My name()]] | [[Category:Ash Functions | My name()]] | ||
When not logged in, this | When not logged in, this function returns an empty string. |
Revision as of 04:42, 23 December 2009
This function returns the logged-in character's name as a string.
This example imports different breakfast scripts depending on which character is running the script.
if (my_name() == "zammywarrior") {
import <Zammy Morning.ash>;
}
else if (my_name() == "hippymon") {
import <Hippy Morning.ash>;
}
Note that capitalization is not strictly adhered to. When using my_name() the following examples are functionally equivalent:
if (my_name() == "That FN Ninja") {
// code
}
if (my_name() == "that fn ninja") {
// code
}
When not logged in, this function returns an empty string.