// ==UserScript== // @name Agma Chat Command Settings // @namespace agma-chat-command-settings // @version 2.1.0 // @description Configure your settings using the chat. // @author Nuke // @match *://agma.io/ // @grant none // @downloadURL none // ==/UserScript== !function(){var e={};Object.defineProperty(e,"__esModule",{value:!0}),e.DEFAULT_COMMAND=e.DEFAULT_OPTIONS=e.DEFAULT_INFORMATION=void 0,e.DEFAULT_INFORMATION={name:void 0,version:"1.0.0",description:void 0,author:void 0},e.DEFAULT_OPTIONS={silent:!1,chatElementSelector:void 0,prefix:"/",exposeToWindowObject:!1},e.DEFAULT_COMMAND={disabled:!1,clearChat:!0};var n={};Object.defineProperty(n,"__esModule",{value:!0}),n.error=n.warn=n.log=void 0,n.log=function(e){return console.log("(@agmajs/core)[LOG]: "+e)},n.warn=function(e){return console.warn("(@agmajs/core)[WARN]: "+e)},n.error=function(e){return console.error("(@agmajs/core)[ERROR]: "+e)};var t={};Object.defineProperty(t,"__esModule",{value:!0}),t.isFunction=void 0,t.isFunction=function(e){return"function"==typeof e};var i={};Object.defineProperty(i,"__esModule",{value:!0}),i.ChatContext=i.createChatContext=void 0,i.createChatContext=function(e){return new o(e)};var o=function(){function e(e){this._chatElement=document.querySelector(e)}return e.prototype.value=function(e){if(void 0===e)return this._chatElement.value;this._chatElement.value=e},e.prototype.clear=function(){this.value("")},e}();i.ChatContext=o;var a={},r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var n,t=1,i=arguments.length;t{if(1==t.length){const e=D.find(e=>!!e&&e.name==t[0]);if(!e)return void x(`No setting found with name "${t[0]}"`,{textColor:k.RED});const{displayName:n,id:i}=e,o=document.getElementById(i);x(`The setting "${n}" is turned ${o.checked?"on":"off"}`,{textColor:o.checked?k.LIME:k.RED})}if(2==t.length&&("on"==t[1]||"off"==t[1])){const e="on"===t[1],n=D.find(e=>!!e&&e.name==t[0]);if(!n)return void x(`No setting found with name "${t[0]}"`,{textColor:k.RED});const{displayName:i,function:o,id:a}=n,r=document.getElementById(a);o(e),r.checked=e,x(`The setting "${i}" has been turned ${e?"on":"off"}`,{textColor:e?k.LIME:k.RED})}}})];const{createScript:B}=O,{name:R,version:U,description:G,author:W}={name:"agma-chat-command-settings",version:"2.1.0",description:"Configure your settings using the chat.",author:"CodingWithNuke"},$=B({name:R,version:U,description:G,author:W},{chatElementSelector:"#chtbox"});I.forEach(e=>$.command(e.name,e))}();