From e278fd953f06110d5f1a03ce9b57dd1eb717500d Mon Sep 17 00:00:00 2001 From: "Aaron C. Meadows" Date: Sat, 9 May 2015 15:18:42 -0500 Subject: [PATCH] Removed duplicate file. Added Depreciation notice. --- IsGM/IsGMModule.js | 96 ---------------------------------------------- IsGM/README.md | 4 ++ 2 files changed, 4 insertions(+), 96 deletions(-) delete mode 100644 IsGM/IsGMModule.js create mode 100644 IsGM/README.md diff --git a/IsGM/IsGMModule.js b/IsGM/IsGMModule.js deleted file mode 100644 index cdc439ba75..0000000000 --- a/IsGM/IsGMModule.js +++ /dev/null @@ -1,96 +0,0 @@ -// Github: https://github.com/shdwjk/Roll20API/blob/master/IsGM/IsGMModule.js -// By: The Aaron, Arcane Scriptomancer -// Contact: https://app.roll20.net/users/104025/the-aaron - -var IsGMModule = IsGMModule || { - version: 0.6, - active: true, - reset_password: "swordfish", - - CheckInstall: function() { - var players = findObjs({_type:"player"}); - - if( ! _.has(state,'IsGM') || ! _.has(state.IsGM,'version') || state.IsGM.version != IsGMModule.version ) - { - state.IsGM={ - version: IsGMModule.version, - gms: [], - players: [], - unknown: [] - }; - } - state.IsGM.unknown=_.difference( - _.pluck(players,'id'), - state.IsGM.gms, - state.IsGM.players - ); - IsGMModule.active = (state.IsGM.unknown.length>0); - }, - IsGM: function(id) { - return _.contains(state.IsGM.gms,id); - }, - HandleMessages: function(msg) - { - if(msg.type != "api") - { - if(IsGMModule.active && msg.playerid != 'API') - { - if(_.contains(state.IsGM.unknown, msg.playerid)) - { - var player=getObj('player',msg.playerid); - if("" == player.get('speakingas') || 'player|'+msg.playerid == player.get('speakingas')) - { - if(msg.who == player.get('_displayname')) - { - state.IsGM.players.push(msg.playerid); - } - else - { - state.IsGM.gms.push(msg.playerid); - sendChat('IsGM','/w gm '+player.get('_displayname')+' is now flagged as a GM.') - } - state.IsGM.unknown=_.without(state.IsGM.unknown,msg.playerid); - IsGMModule.active = (state.IsGM.unknown.length>0); - } - } - } - } - else - { - var tokenized = msg.content.split(" "); - var command = tokenized[0]; - switch(command) - { - case '!reset-isgm': - if(isGM(msg.playerid) || (tokenized.length>1 && tokenized[1] == IsGMModule.reset_password)) - { - delete state.IsGM; - IsGMModule.CheckInstall(); - sendChat('IsGM','/w gm IsGM data reset.'); - } - else - { - var who=getObj('player',msg.playerid).get('_displayname').split(' ')[0]; - sendChat('IsGM','/w '+who+' ('+who+')Only GMs may reset the IsGM data.' - +'If you are a GM you can reset by specifying the reset password from' - +'the top of the IsGM script as an argument to !reset-isgm') - } - break; - } - } - }, - RegisterEventHandlers: function(){ - on('chat:message',IsGMModule.HandleMessages); - }, - -}; - -on('ready',function(){ - IsGMModule.CheckInstall(); - IsGMModule.RegisterEventHandlers(); -}); - -var isGM = isGM || function(id) { - return IsGMModule.IsGM(id); -}; - diff --git a/IsGM/README.md b/IsGM/README.md new file mode 100644 index 0000000000..1b83800238 --- /dev/null +++ b/IsGM/README.md @@ -0,0 +1,4 @@ +***DEPRECATED*** + +For new scripts, you should use the playerIsGM() function that is now built into Roll20. +