Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

Help finding my GM Id

I am trying to install an API for a custom Turn order tracker and I need to find my GM ID. I can't seem to find it and typing !getmyid in the chat box isn't working. I'm not very well versed in API scripts so I apologize if this is a dumb question
1432313400
The Aaron
Pro
API Scripter
It's not a dumb question. Which script is it? Throw this script in an api tab, then run the command "!getmyid": on('ready',function(){ "use strict"; on('chat:message',function(msg){ if('api' === msg.type && '!getmyid' === msg.content){ sendChat('Your Player ID is','<b>'+msg.playerid+'</b>'); } }); });
Is the api tab the macro section?
I am trying to install this script - <a href="https://app.roll20.net/forum/post/841127/script-second-tracker-for-hackmaster-5e/#post-841127" rel="nofollow">https://app.roll20.net/forum/post/841127/script-second-tracker-for-hackmaster-5e/#post-841127</a>
Just know that this is your 'local' id as opposed to your universal ID. EIther way the campaign only tracks your 'local' Id for that campaign irrc. Correct me if I'm wrong.
I ran the script for getmyid and this is what I'm getting in my chat box- Andy Gould (GM): }); });
1432317689
The Aaron
Pro
API Scripter
I think you're putting this in the wrong place. Are you going to your campaign and clicking on API Scripts ? When I run the command, I get: Your Player ID is: -JS3qKxIUPHLzSbK24ve I think you are probably putting the code in a macro and running it.
Thanks - I was doing that. I thought you put them in the macros section. For the script I am trying to use do I put that in the API section as well or is that a macro function? Again, thanks for the help I am very new to this stuff.
1432318801
The Aaron
Pro
API Scripter
Your linked script is an API script, it would need to go in the API Scripts section. It's a fairly old script, and you can avoid this player id stuff by changing the last bit of the script from this: // Returns true if the given playerid is a GM // Uses the GmIdList global to determine if player is a GM function IsGM(playerid){ if(!GmIdList) return false; return ArraySearch(GmIdList, getObj("player", playerid).get("_d20userid")) &gt;= 0; }; to this: // Returns true if the given playerid is a GM // Uses the GmIdList global to determine if player is a GM function IsGM(playerid){ return playerIsGM(playerid); }; There wasn't a function to determine if a player was a GM back in the day, so there were various workarounds. Now that there is, the old scripts can be updated to take advantage of it.
Thank you. Pretty much got everything working now. I appreciate you taking the time to educate me
1432320858
The Aaron
Pro
API Scripter
No problem, happy to help! Feel free to ask anything!