// ==UserScript== // @name Agma Chat Command Settings // @namespace agma-chat-command-settings // @version 2.3.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=void 0,e.DEFAULT_OPTIONS={info:{version:"1.0.0"},prefix:"/"},e.DEFAULT_COMMAND={clearChat:!0};var n={};Object.defineProperty(n,"__esModule",{value:!0}),n.debug=n.error=n.warn=n.log=void 0,n.log=function(e){return console.log("[io-scripts (LOG)]: "+e)},n.warn=function(e){return console.warn("[io-scripts (WARN)]: "+e)},n.error=function(e){return console.error("[io-scripts (ERROR)]: "+e)},n.debug=function(e){return console.log("[io-scripts (DEBUG)]: "+e)};var i={};Object.defineProperty(i,"__esModule",{value:!0}),i.isFunction=void 0,i.isFunction=function(e){return"function"==typeof e};var t={};Object.defineProperty(t,"__esModule",{value:!0}),t.ChatContext=t.createChatContext=void 0,t.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}();t.ChatContext=o;var a={},r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var n,i=1,t=arguments.length;i{if(1==i.length){const e=B.find(e=>!!e&&(Array.isArray(e.name)?e.name.find(e=>e==i[0]):e.name==i[0]));if(!e)return void G(`No setting found with name "${i[0]}"`,{textColor:I.RED});const{displayName:n,id:t}=e,o=document.getElementById(t);G(`The setting "${n}" is turned ${o.checked?"on":"off"}`,{textColor:o.checked?I.LIME:I.RED})}if(2==i.length&&("on"==i[1]||"off"==i[1])){const e="on"===i[1],n=B.find(e=>!!e&&(Array.isArray(e.name)?e.name.find(e=>e==i[0]):e.name==i[0]));if(!n)return void G(`No setting found with name "${i[0]}"`,{textColor:I.RED});const{displayName:t,function:o,id:a}=n,r=document.getElementById(a);o(e),r.checked=e,G(`The setting "${t}" has been turned ${e?"on":"off"}`,{textColor:e?I.LIME:I.RED})}}})];const{createScript:U}=g,{name:V,version:$,description:W,author:z}={name:"agma-chat-command-settings",version:"2.3.0",description:"Configure your settings using the chat.",author:"CodingWithNuke"},Z=U({info:{name:V,version:$,description:W,author:z},chatElementSelector:"#chtbox",silent:!0});R.forEach(e=>Z.command(e.name,e))}();