Difference between revisions of "My id"

From Kolmafia
Jump to navigation Jump to search
imported>Zarqon
m (pre to code for consistency, more links)
imported>Bale
m
 
(13 intermediate revisions by 3 users not shown)
Line 1: Line 1:
[[string]] [[my_id()]]
+
{{
 +
#vardefine:name|my_id}}{{
 +
#vardefine:return_type|string}}{{
  
This function returns the logged-in character's id number as a [[string]].
+
FunctionPage|
 +
name={{#var:name}}|
 +
function1={{Function|
 +
name={{#var:name}}|
 +
aggregate={{#var:aggregate}}|
 +
return_type={{#var:return_type}}|
 +
return_also={{#var:return_also}}
 +
}}|
 +
function_description=Returns the Character ID of the logged-in character.|
 +
code1={{CodeSample|
 +
title=Code Sample|
 +
description=This example allows you to visit your own charsheet.|
 +
code=
 +
<syntaxhighlight>
 +
visit_url("showplayer.php?who=" + my_id());
 +
</syntaxhighlight>
 +
}}|
 +
see_also={{SeeAlso|my_name}}|
 +
special=When no character is logged in, this function returns the Character ID of the last logged-in character or 0 if no character has logged in yet.
 +
}}
  
This example visits your public charsheet:
+
[[Category:Your Character]]
 
 
<code>
 
  [[visit_url]]("showplayer.php?who="+[[my_id()]]);
 
</code>
 
[[Category:Your Character | My ID()]]
 
[[Category:Ash Functions | My ID()]]
 
 
 
When no character is logged in, this functions returns "0".
 

Latest revision as of 21:31, 21 May 2010

Function Syntax

string my_id()

Returns the Character ID of the logged-in character.

Code Sample

This example allows you to visit your own charsheet.

visit_url("showplayer.php?who=" + my_id());

See Also

my_name()

Special

When no character is logged in, this function returns the Character ID of the last logged-in character or 0 if no character has logged in yet.