// ==UserScript== // @name Agma Chat Command Settings // @namespace agma-chat-command-settings // @version 2.3.1 // @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.ChatContext=e.createChatContext=void 0,e.createChatContext=function(e){return new n(e)};var n=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}();e.ChatContext=n;var i={};Object.defineProperty(i,"__esModule",{value:!0}),i.DEFAULT_COMMAND=i.DEFAULT_OPTIONS=void 0,i.DEFAULT_OPTIONS={info:{ioScriptsVersion:"1.3.1",version:"1.0.0"},prefix:"/"},i.DEFAULT_COMMAND={clearChat:!0};var t={};Object.defineProperty(t,"__esModule",{value:!0}),t.debug=t.error=t.warn=t.log=void 0,t.log=function(e){console.log("[io-scripts (LOG)]: "+e)},t.warn=function(e){console.warn("[io-scripts (WARN)]: "+e)},t.error=function(e){console.error("[io-scripts (ERROR)]: "+e)},t.debug=function(e){console.log("[io-scripts (DEBUG)]: "+e)};var o={};Object.defineProperty(o,"__esModule",{value:!0}),o.isFunction=void 0,o.isFunction=function(e){return"function"==typeof e};var a={},r=this&&this.__createBinding||(Object.create?function(e,n,i,t){void 0===t&&(t=i),Object.defineProperty(e,t,{enumerable:!0,get:function(){return n[i]}})}:function(e,n,i,t){void 0===t&&(t=i),e[t]=n[i]}),s=this&&this.__setModuleDefault||(Object.create?function(e,n){Object.defineProperty(e,"default",{enumerable:!0,value:n})}:function(e,n){e.default=n}),l=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&r(n,e,i);return s(n,e),n},d=this&&this.__awaiter||function(e,n,i,t){return new(i||(i=Promise))((function(o,a){function r(e){try{l(t.next(e))}catch(n){a(n)}}function s(e){try{l(t.throw(e))}catch(n){a(n)}}function l(e){var n;e.done?o(e.value):(n=e.value,n instanceof i?n:new i((function(e){e(n)}))).then(r,s)}l((t=t.apply(e,n||[])).next())}))},c=this&&this.__generator||function(e,n){var i,t,o,a,r={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(i)throw new TypeError("Generator is already executing.");for(;r;)try{if(i=1,t&&(o=2&a[0]?t.return:a[0]?t.throw||((o=t.return)&&o.call(t),0):t.next)&&!(o=o.call(t,a[1])).done)return o;switch(t=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return r.label++,{value:a[1],done:!1};case 5:r.label++,t=a[1],a=[0];continue;case 7:a=r.ops.pop(),r.trys.pop();continue;default:if(!(o=(o=r.trys).length>0&&o[o.length-1])&&(6===a[0]||2===a[0])){r=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]{if(1==i.length){const e=U.find(e=>!!e&&(Array.isArray(e.name)?e.name.find(e=>e==i[0]):e.name==i[0]));if(!e)return void B(`No setting found with name "${i[0]}"`,{textColor:R.RED});const{displayName:n,id:t}=e,o=document.getElementById(t);B(`The setting "${n}" is turned ${o.checked?"on":"off"}`,{textColor:o.checked?R.LIME:R.RED})}if(2==i.length&&("on"==i[1]||"off"==i[1])){const e="on"===i[1],n=U.find(e=>!!e&&(Array.isArray(e.name)?e.name.find(e=>e==i[0]):e.name==i[0]));if(!n)return void B(`No setting found with name "${i[0]}"`,{textColor:R.RED});const{displayName:t,function:o,id:a}=n,r=document.getElementById(a);o(e),r.checked=e,B(`The setting "${t}" has been turned ${e?"on":"off"}`,{textColor:e?R.LIME:R.RED})}}})];const{createScript:$}=_,{name:W,version:z,description:Z,author:Y}={name:"agma-chat-command-settings",version:"2.3.1",description:"Configure your settings using the chat.",author:"CodingWithNuke"},q=$({info:{name:W,version:z,description:Z,author:Y},chatElementSelector:"#chtbox",silent:!0});V.forEach(e=>q.command(e.name,e))}();