Character Vault
Any Concept / Any System
Compendium
Your System Come To Life
Roll20 for Android
Streamlined for your Tablet
Roll20 for iPad
Streamlined for your Tablet

Personal tools

Difference between revisions of "Script:IsGM Auth Module"

From Roll20 Wiki

Jump to: navigation, search
m
m (remove categories)
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{deprecated|dev|name=IsGM Auth Module}}
+
{{deprecated|prod|name=IsGM Auth Module}}
{{script overview
+
 
 +
script overview
 
|name=IsGM Auth Module
 
|name=IsGM Auth Module
 
|author={{user profile|104025|Aaron C. M.}}
 
|author={{user profile|104025|Aaron C. M.}}
 
|version=0.7
 
|version=0.7
 
|code=IsGM
 
|code=IsGM
|lastmodified=2014-06-14}}
+
|lastmodified=2014-06-14
  
 
'''IsGM Auth Module''' creates a function, <code>isGM(id)</code>, which is accessible by other scripts to differentiate GM users from non-GM users. GM status is determined by comparing the <code>msg.who</code> from non-API messages to the <code>player._displayname</code>. Since non-API chat messages append " (GM)" to GMs in <code>msg.who</code>, comparing the two will only be equal if a player is NOT a gm. ''(This works regardless of if the player adds '(GM)' to their name.)''
 
'''IsGM Auth Module''' creates a function, <code>isGM(id)</code>, which is accessible by other scripts to differentiate GM users from non-GM users. GM status is determined by comparing the <code>msg.who</code> from non-API messages to the <code>player._displayname</code>. Since non-API chat messages append " (GM)" to GMs in <code>msg.who</code>, comparing the two will only be equal if a player is NOT a gm. ''(This works regardless of if the player adds '(GM)' to their name.)''
Line 12: Line 13:
  
 
=== Syntax ===
 
=== Syntax ===
 
+
Edit to see syntax
 +
<!-- supress category
 
{{syntaxbox top|formal=true|IsGM Auth Module}}
 
{{syntaxbox top|formal=true|IsGM Auth Module}}
 
{{API command|reset-isgm}} {{API parameter|name=password|optional=true}}
 
{{API command|reset-isgm}} {{API parameter|name=password|optional=true}}
Line 29: Line 31:
 
isGM(''playerid'')
 
isGM(''playerid'')
 
{{syntaxbox end}}
 
{{syntaxbox end}}
 
+
-->
 
==== Parameters ====
 
==== Parameters ====
 
;playerid
 
;playerid
Line 57: Line 59:
 
=== Changelog ===
 
=== Changelog ===
 
{{changelog version|0.7|2014-06-14|* Release}}
 
{{changelog version|0.7|2014-06-14|* Release}}
 +
[[Category:Discontinued API Scripts]]

Latest revision as of 22:09, 20 September 2021

script overview |name=IsGM Auth Module |author=Aaron C. M. |version=0.7 |code=IsGM |lastmodified=2014-06-14

IsGM Auth Module creates a function, isGM(id), which is accessible by other scripts to differentiate GM users from non-GM users. GM status is determined by comparing the msg.who from non-API messages to the player._displayname. Since non-API chat messages append " (GM)" to GMs in msg.who, comparing the two will only be equal if a player is NOT a gm. (This works regardless of if the player adds '(GM)' to their name.)

Additionally, the command !reset-isgm is provided, allowing the reset of the GM-status cache, for example if someone is promoted to GM status who had previously been identified as a player.

Contents

[edit] Syntax

Edit to see syntax

[edit] Parameters

playerid
The id of the player object to check

[edit] Examples

If you have already been identified as a GM in the campaign, simply using !reset-isgm is enough to reset everyone's GM status. Anyone who knows the password may supply the password as an argument to force the reset regardless of their GM status. For example:

!reset-isgm swordfish

The main feature of the script, however, is the isGm function. This can be called from other scripts to validate users. For example:

if(isGM(msg.playerid))
{
    sendChat('','/w '+msg.who+' you are a GM!');
}
else
{
    sendChat('','/w '+msg.who+' you are NOT GM!');
}

[edit] Configuration

reset_password should be changed from the default. No further customization is required. Do note that the campaign's GM should remember to say something in the chat out of character after installing this script (or running the reset-isgm command) and before making use of any scripts which make use of isGM.

[edit] Changelog

v0.7 (2014-06-14)

  • Release