How to get player id in a greasemonkey script.

Discuss developing tools and get details on Conquer Club's API.

Moderator: Tech Team

Forum rules
Please read the Community Guidelines before posting.
Post Reply
User avatar
Woltato
Posts: 192
Joined: Sat Jan 17, 2009 8:09 pm
Gender: Male
Location: Bingley, UK

How to get player id in a greasemonkey script.

Post by Woltato »

Please does anyone know the easiest way to obtain the player id. ie player currently logged in. Wanting to do this programmatically in a greasemonkey script. Is there a predefined variable or function that will return it?

I've written a script and was going to put it onto userscripts.org. however at the moment it's got my userid hardcoded into it so it will only work for me.
User avatar
Woltato
Posts: 192
Joined: Sat Jan 17, 2009 8:09 pm
Gender: Male
Location: Bingley, UK

Re: How to get player id in a greasemonkey script.

Post by Woltato »

Figured this out now.

this is how in case anyone's interested

function getPlayerID()
{
var playerid = document.cookie;
playerid = playerid.split("phpbb3_jer7c_u=")[1]
playerid = playerid.split(";")[0];
return playerid;
}

if playerid is returned as "1" then it means not logged in
Post Reply

Return to “Tools Development”