
No, there is no means to do so without some hardcoding. Some people write scripts looking for a name ending in " (GM)", but that only works if the GM is speaking OOC, and a player could potentially change their display name to end with (GM). Hardcoding the d20userid and comparing to that is probably optimal, because it can't be spoofed, and it's a short number instead of a long, indecipherable string (like player.id).
If you're writing a script to be released to the greater R20 community, please remember that campaigns can have multiple GMs. You should probably iterate over an array of hardcoded ids, even if the array only contains 1.
Brian said:
No, there is no means to do so without some hardcoding. Some people write scripts looking for a name ending in " (GM)", but that only works if the GM is speaking OOC, and a player could potentially change their display name to end with (GM). Hardcoding the d20userid and comparing to that is probably optimal, because it can't be spoofed, and it's a short number instead of a long, indecipherable string (like player.id).
If you're writing a script to be released to the greater R20 community, please remember that campaigns can have multiple GMs. You should probably iterate over an array of hardcoded ids, even if the array only contains 1.