Player ID

pgrmdave

New member
I'm new to scripting, and I'm trying to make a somewhat specialized chatbot, but I need to get a person's player id number when they pm me - how would I go about doing that?
 

pgrmdave

New member
Yes, they'll be in my clan, but I'm a bit wary of loading the clan member's page (assuming that's what you're talking about), as I'm in Senam's, and we've got a bit over 11,000 members.
 

Grotfang

Developer

Nice link, Spiny (didn't even know that existed!) but it's not wholly reliable, from what the forum post says - especially, I imagine, in a clan where names may be less than original. pgrmdave... how many people approve applications? Also, how many new applications are accepted and rejected each day? The issue, as you rightly point out, is not necessarily the difficulty of the process, but rather the problem of size of any system we come up with. An alternative method (reducing server hits) would be to get mafia to log all your members through - initially - hitting your member pages (not your detailed roster, mind; that would be far too big) and subsequently parsing your clan log.

What I am imagining is a system whereby mafia creates local map files of your entire clan, then changes those files according to what it finds having changed in your Clan Activity Log. That would remove hitting the server more than once per session (or once every set time period) and would also speed up any checks you run for the individual's name.
 

mredge73

Member
What I am imagining is a system whereby mafia creates local map files of your entire clan, then changes those files according to what it finds having changed in your Clan Activity Log. That would remove hitting the server more than once per session (or once every set time period) and would also speed up any checks you run for the individual's name.

I agree, I think the best way to do it would be to parse your clan into a local map. I have a small clan so I can afford to run this script every hour or so to capture changes. If you modify it to just capture the name and ID it may run faster but you may still only want to run it weekly due to the size of your clan. Causes only one server hit but it could be a big one when you have a large clan. I don't know what the buffer limitation is so I don't know for sure if it will work for you.

My parser can be found in my Clan Admin (LITE) script or here:
http://kolmafia.us/showthread.php?t=912

After running the parser it will create a file called: ClanRoster.txt

Then you can use the map created to get any clannie's ID (or other info) that does not use a server hit:
Code:
//rebuild the map
record
    {
        int ID;
        string Type;
        int Muscle;
        int Myst;
        int Moxie;
        int TotalStats;
        int Ascentions;
        int HCAscentions;
        int PVPscore;
        string Rank;
        int Karma;
    } [string] CurrentRoster;

    File_To_Map("ClanRoster.txt", ClanRoster);

//Test
print(ClanRoster[my_name()].ID);
 
Top