Get player id

From Kolmafia
Revision as of 09:11, 7 November 2014 by imported>Bale (r11208)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Function Syntax

string get_player_id(string player )

Returns the user id number of a given player.

Code Sample

Get user id so that we can check the user's page for their current class.

class player_to_class( string player ) {
   string id = get_player_id( name );
   matcher classy = create_matcher( "Class:</b></td><td>(.+?)</td>", visit_url( "showplayer.php?who=" + id ) ); 
   if(find(classy))  
      return classy.group(1).to_class();
   return $class[none]; 
}


See Also

my_id() | get_clan_id() | get_clan_name()