Agma Chat Command Settings

Configure your settings using the chat.

目前为 2021-12-25 提交的版本。查看 最新版本

// ==UserScript==
// @name         Agma Chat Command Settings
// @namespace    agma-chat-command-settings
// @version      2.3.3
// @description  Configure your settings using the chat.
// @author       CodingWithNuke
// @license      MIT
// @match        *://agma.io/*
// @grant        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.prototype.focus=function(){this._chatElement.focus()},e}();e.ChatContext=n;var t={};Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_COMMAND=t.DEFAULT_OPTIONS=void 0,t.DEFAULT_OPTIONS={info:{version:"1.0.0"},prefix:"/"},t.DEFAULT_COMMAND={clearChat:!0};var i={};Object.defineProperty(i,"__esModule",{value:!0}),i.debug=i.error=i.warn=i.log=void 0,i.log=function(e){console.log("[io-scripts (LOG)]: "+e)},i.warn=function(e){console.warn("[io-scripts (WARN)]: "+e)},i.error=function(e){console.error("[io-scripts (ERROR)]: "+e)},i.debug=function(e){console.log("[io-scripts (DEBUG)]: "+e)};var o="2.1.1",a={},r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var n,t=1,i=arguments.length;t<i;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e}).apply(this,arguments)},s=this&&this.__createBinding||(Object.create?function(e,n,t,i){void 0===i&&(i=t),Object.defineProperty(e,i,{enumerable:!0,get:function(){return n[t]}})}:function(e,n,t,i){void 0===i&&(i=t),e[i]=n[t]}),l=this&&this.__setModuleDefault||(Object.create?function(e,n){Object.defineProperty(e,"default",{enumerable:!0,value:n})}:function(e,n){e.default=n}),c=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(null!=e)for(var t in e)"default"!==t&&Object.prototype.hasOwnProperty.call(e,t)&&s(n,e,t);return l(n,e),n},d=this&&this.__awaiter||function(e,n,t,i){return new(t||(t=Promise))((function(o,a){function r(e){try{l(i.next(e))}catch(n){a(n)}}function s(e){try{l(i.throw(e))}catch(n){a(n)}}function l(e){var n;e.done?o(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(r,s)}l((i=i.apply(e,n||[])).next())}))},u=this&&this.__generator||function(e,n){var t,i,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(t)throw new TypeError("Generator is already executing.");for(;r;)try{if(t=1,i&&(o=2&a[0]?i.return:a[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,a[1])).done)return o;switch(i=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++,i=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]<o[3])){r.label=a[1];break}if(6===a[0]&&r.label<o[1]){r.label=o[1],o=a;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(a);break}o[2]&&r.ops.pop(),r.trys.pop();continue}a=n.call(e,r)}catch(s){a=[6,s],i=0}finally{t=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}},f=this&&this.__read||function(e,n){var t="function"==typeof Symbol&&e[Symbol.iterator];if(!t)return e;var i,o,a=t.call(e),r=[];try{for(;(void 0===n||n-- >0)&&!(i=a.next()).done;)r.push(i.value)}catch(s){o={error:s}}finally{try{i&&!i.done&&(t=a.return)&&t.call(a)}finally{if(o)throw o.error}}return r},m=this&&this.__spreadArray||function(e,n,t){if(t||2===arguments.length)for(var i,o=0,a=n.length;o<a;o++)!i&&o in n||(i||(i=Array.prototype.slice.call(n,0,o)),i[o]=n[o]);return e.concat(i||Array.prototype.slice.call(n))};Object.defineProperty(a,"__esModule",{value:!0}),a.Script=a.createScript=void 0;var p=c(i);a.createScript=function(e){return new h(e)};var h=function(){function n(e){this._initialized=!1,this._commands=new Map,this._plugins=new Set,this._ioScriptsVersion=o,this.options=r(r({},t.DEFAULT_OPTIONS),e),this._init(),this.options.exposeToWindowObject&&(window.$script?p.error('Unable to expose script to "window.$script". "window.$script" is already in use by another script.'):window.$script=this)}return n.prototype.command=function(e,n){if(n)return this._commands.get(e)||m([],f(this._commands.values()),!1).find((function(n){return n.aliases&&"string"==typeof n.aliases?n.aliases===e:Array.isArray(n.aliases)&&n.aliases.includes(e)}))?void(this.options.silent||p.warn('Command with name or alias "'+e+'" has already been registered.')):(this._commands.set(e,r(r(r({},t.DEFAULT_COMMAND),n),{name:e})),this);var i=this._commands.get(e)||m([],f(this._commands.values()),!1).find((function(n){return n.aliases&&"string"==typeof n.aliases?n.aliases===e:Array.isArray(n.aliases)&&n.aliases.includes(e)}));if(i)return i;this.options.silent||p.warn('Command "'+e+'" not found.')},n.prototype.use=function(e){for(var n=[],t=1;t<arguments.length;t++)n[t-1]=arguments[t];return this._plugins.has(e)?!this.options.silent&&p.warn("Plugin has already been applied."):e&&"function"==typeof e?(this._plugins.add(e),e.apply(void 0,m([this],f(n),!1))):this.options.silent||p.error("A plugin must be a function."),this},n.prototype._init=function(){var n=this;if(!this._initialized){var t=this.options,i=t.chatElementSelector,o=t.prefix;if(i&&o){var a=document.querySelector(i);a?(a.addEventListener("keydown",(function(t){return d(n,void 0,void 0,(function(){var n,r,s,l,c,d;return u(this,(function(u){switch(u.label){case 0:return"Enter"!==t.code?[3,2]:(n=a.value).startsWith(o)?(r=f(n.trim().slice(o.length).split(/ +/g)),s=r[0],l=r.slice(1),(c=this.command(s.toLowerCase()))?c.disabled?[2]:(d=(0,e.createChatContext)(i),c.clearChat&&d.clear(),[4,c.run(this,d,l)]):[3,2]):[2];case 1:u.sent(),c.focusChatAfterRun&&d.focus(),u.label=2;case 2:return[2]}}))}))})),this._initialized=!0):p.error('Given chatElementSelector "'+i+'" not found as an element.')}}},n}();a.Script=h;var y={};Object.defineProperty(y,"__esModule",{value:!0}),y.defineCommand=void 0,y.defineCommand=function(e){return e};var w={};Object.defineProperty(w,"__esModule",{value:!0}),w.definePlugin=void 0,w.definePlugin=function(e){return e};var v={};Object.defineProperty(v,"__esModule",{value:!0}),v.Script=void 0,Object.defineProperty(v,"Script",{enumerable:!0,get:function(){return a.Script}});var b={};Object.defineProperty(b,"__esModule",{value:!0});var _={};Object.defineProperty(_,"__esModule",{value:!0});var g={},C=this&&this.__createBinding||(Object.create?function(e,n,t,i){void 0===i&&(i=t),Object.defineProperty(e,i,{enumerable:!0,get:function(){return n[t]}})}:function(e,n,t,i){void 0===i&&(i=t),e[i]=n[t]}),S=this&&this.__exportStar||function(e,n){for(var t in e)"default"===t||Object.prototype.hasOwnProperty.call(n,t)||C(n,e,t)};Object.defineProperty(g,"__esModule",{value:!0}),g.ChatContext=void 0,Object.defineProperty(g,"ChatContext",{enumerable:!0,get:function(){return e.ChatContext}}),S(v,g),S(b,g),S(_,g);var O={},N=this&&this.__createBinding||(Object.create?function(e,n,t,i){void 0===i&&(i=t),Object.defineProperty(e,i,{enumerable:!0,get:function(){return n[t]}})}:function(e,n,t,i){void 0===i&&(i=t),e[i]=n[t]}),P=this&&this.__exportStar||function(e,n){for(var t in e)"default"===t||Object.prototype.hasOwnProperty.call(n,t)||N(n,e,t)};Object.defineProperty(O,"__esModule",{value:!0}),O.defineCommand=O.createScript=void 0,Object.defineProperty(O,"createChatContext",{enumerable:!0,get:function(){return e.createChatContext}}),Object.defineProperty(O,"createScript",{enumerable:!0,get:function(){return a.createScript}}),Object.defineProperty(O,"defineCommand",{enumerable:!0,get:function(){return y.defineCommand}}),Object.defineProperty(O,"definePlugin",{enumerable:!0,get:function(){return w.definePlugin}}),P(g,O);var A={};Object.defineProperty(A,"__esModule",{value:!0});var M={},F=this&&this.__createBinding||(Object.create?function(e,n,t,i){void 0===i&&(i=t),Object.defineProperty(e,i,{enumerable:!0,get:function(){return n[t]}})}:function(e,n,t,i){void 0===i&&(i=t),e[i]=n[t]}),E=this&&this.__exportStar||function(e,n){for(var t in e)"default"===t||Object.prototype.hasOwnProperty.call(n,t)||F(n,e,t)};Object.defineProperty(M,"__esModule",{value:!0}),E(A,M);var j={};Object.defineProperty(j,"__esModule",{value:!0}),j.Colors=j.DEFAULT_OPTIONS=void 0,j.DEFAULT_OPTIONS={textColor:"#ffffff",visibilityTime:5e3},function(e){e.WHITE="#FFFFFF",e.SILVER="#C0C0C0",e.GRAY="#808080",e.GREY="#808080",e.BLACK="#000000",e.RED="#FF0000",e.MAROON="#800000",e.YELLOW="#FFF000",e.OLIVE="#808000",e.LIME="#00FF00",e.GREEN="#008000",e.AQUA="#00FFFF",e.TEAL="#008080",e.BLUE="#0000FF",e.NAVY="#000080",e.FUCHSIA="#FF00FF",e.PURPLE="#800080"}(j.Colors||(j.Colors={}));var k={},x=this&&this.__assign||function(){return(x=Object.assign||function(e){for(var n,t=1,i=arguments.length;t<i;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e}).apply(this,arguments)};Object.defineProperty(k,"__esModule",{value:!0}),k.useAlert=void 0,k.useAlert=function(e,n){n=x(x({},j.DEFAULT_OPTIONS),n);var t=document.querySelector(n.alertElementSelector),i=n.textColor,o=n.visibilityTime;i&&(t.style.color=i),t.style.fontSize="24px",t.textContent=e,t.style.display="block",setTimeout((function(){t.style.display="none"}),o)};var L={},T=this&&this.__createBinding||(Object.create?function(e,n,t,i){void 0===i&&(i=t),Object.defineProperty(e,i,{enumerable:!0,get:function(){return n[t]}})}:function(e,n,t,i){void 0===i&&(i=t),e[i]=n[t]}),D=this&&this.__exportStar||function(e,n){for(var t in e)"default"===t||Object.prototype.hasOwnProperty.call(n,t)||T(n,e,t)};Object.defineProperty(L,"__esModule",{value:!0}),L.Colors=L.useAlert=void 0,D(M,L),Object.defineProperty(L,"useAlert",{enumerable:!0,get:function(){return k.useAlert}}),Object.defineProperty(L,"Colors",{enumerable:!0,get:function(){return j.Colors}});var G={};const B=[{displayName:"Dark Theme",name:"darktheme",function:window.setDark,id:"cDark"},{displayName:"Fancy Grid",name:"fancygrid",function:window.setFancyGrid,id:"cFancyGrid"},{displayName:"Section Grid",name:"sectiongrid",function:window.setSectionGrid,id:"cSectionGrid"},{displayName:"Gridlines",name:["gridline","gridlines"],function:window.setGrid,id:"cGrid"},{displayName:"Skins",name:["skin","skins"],function:window.setSkins,id:"cSkins"},{displayName:"Wearables",name:["wearable","wearables"],function:window.setWearables,id:"cWearables"},{displayName:"Show Names",name:["name","names"],function:window.setNames,id:"cNames"},{displayName:"Minion Names",name:["minionname","minionnames"],function:window.setMinionNames,id:"cMinionNames"},{displayName:"Large Names",name:["largename","largenames"],function:window.setLargeNames,id:"cLargeNames"},{displayName:"Name Outlines",name:["nameoutline","nameoutlines"],function:window.setNameOutlines,id:"cNameOutlines"},{displayName:"Show Mass",name:"mass",function:window.setMass,id:"cMass"},{displayName:"Show Food",name:"food",function:window.setFood,id:"cFood"},{displayName:"Cell Animations",name:["cellanimation","cellanimations"],function:window.setCellAnimations,id:"cCellAnimations"},{displayName:"Skin Animations",name:["skinanimation","skinanimations"],function:window.setSkinAnimations,id:"cSkinAnimations"},{displayName:"Map Border",name:"mapborder",function:window.setMapBorder,id:"cMapBorder"},{displayName:"Sounds",name:["sound","sounds"],function:window.setSounds,id:"cSounds"},{displayName:"Infinite Zoom",name:"infinitezoom",function:window.setZoom,id:"cZoom"},{displayName:"Fixed Zoom",name:"fixedzoom",function:window.setFixedZoom,id:"cFixedZoom"},{displayName:"Slow Motion",name:"slowmotion",function:window.setSlowMotion,id:"cSlowMotion"},{displayName:"Minion Panel",name:"minionpanel",function:window.setMinionUi,id:"cMinionUi"},{displayName:"Leaderboard",name:"leaderboard",function:window.setLeaderboard,id:"cLeaderboard"},{displayName:"Chat",name:"chat",function:window.setChat,id:"cChat"},{displayName:"Minimap",name:"minimap",function:window.setMinimap,id:"cMinimap"},{displayName:"FPS / Ping / Stats",name:["fps","ping","stats"],function:window.setFPS,id:"cFPS"},{displayName:"Cell Colors",name:["color","colors","cellcolor","cellcolors"],function:window.setColors,id:"cColors"},{displayName:"Cell Borders",name:["cellborder","cellborders"],function:window.setCellBorders,id:"cCellBorders"},{displayName:"Cell Spikes",name:["cellspike","cellspikes"],function:window.setCellSpikes,id:"cCellSpikes"},{displayName:"Classic Virus Look",name:"classicvirus",function:window.setClassicViruses,id:"cClassicViruses"},{displayName:"Polygon Shapes",name:["polygonshape","polygonshapes"],function:window.setPolygonShapes,id:"cPolygonShapes"},{displayName:"Line Shapes",name:["lineshape","lineshapes"],function:window.setLineShapes,id:"cLineShapes"},{displayName:"Bubble Cells",name:["bubblecell","bubblecells"],function:window.setBubbleCells,id:"cBubbleCells"}],I=[{displayName:"Online Status",name:"onlinestatus",function:window.setFriendlistOnline,id:"cVisibilityStatus"},{displayName:"Allow Party Invitations",name:"partyinvite",function:window.showPartyInvite,id:"cAllowPartyInvite"},{displayName:"Allow Party Animations",name:["partyanimation","partyanimations"],function:window.setPartyAnimations,id:"cAllowPartyAnimations"},{displayName:"Auto Feed",name:"autofeed",function:window.setAutoFeedEnabled,id:"cAutoFeed"},{displayName:"Gold Nickname",name:["goldnick","goldnickname"],function:window.setGoldNickname,id:"cGoldName"},{displayName:"Gold Crown in Chat",name:"goldcrown",function:window.setGoldCrownChat,id:"cGoldCrownChat"},{displayName:"Set Skins on Minions",name:["minionskin","minionskins"],function:window.setMinionSkins,id:"cMinionSkinStatus"},{displayName:"Video Ads",name:["videoad","videoads"],function:window.setVideoAds,id:"cVideoAds"}];G.availableSettings=[...B,...I];const{defineCommand:U}=O,{useAlert:R,Colors:V}=L,{availableSettings:$}=G;var W=[U({name:"setting",aliases:["s"],run:(e,n,t)=>{if(1==t.length){const e=$.find(e=>!!e&&(Array.isArray(e.name)?e.name.find(e=>e==t[0]):e.name==t[0]));if(!e)return void R(`No setting found with name "${t[0]}"`,{alertElementSelector:"#curser",textColor:V.RED});const{displayName:n,id:i}=e,o=document.getElementById(i);R(`The setting "${n}" is turned ${o.checked?"on":"off"}`,{alertElementSelector:"#curser",textColor:o.checked?V.LIME:V.RED})}if(2==t.length&&("on"==t[1]||"off"==t[1])){const e="on"===t[1],n=$.find(e=>!!e&&(Array.isArray(e.name)?e.name.find(e=>e==t[0]):e.name==t[0]));if(!n)return void R(`No setting found with name "${t[0]}"`,{alertElementSelector:"#curser",textColor:V.RED});const{displayName:i,function:o,id:a}=n,r=document.getElementById(a);o(e),r.checked=e,R(`The setting "${i}" has been turned ${e?"on":"off"}`,{alertElementSelector:"#curser",textColor:e?V.LIME:V.RED})}}})];const{createScript:z}=O,{name:Z,version:Y,description:q,author:H}={name:"agma-chat-command-settings",version:"2.3.2",description:"Configure your settings using the chat.",author:"CodingWithNuke"},K=z({info:{name:Z,version:Y,description:q,author:H},chatElementSelector:"#chtbox",silent:!0});W.forEach(e=>K.command(e.name,e))}();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址