Page 1 of 1

How to get player id in a greasemonkey script.

PostPosted: Thu Oct 31, 2013 12:43 pm
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.

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

PostPosted: Fri Nov 01, 2013 11:37 am
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