Agma Chat Command Settings

Configure your settings using the chat.

目前为 2021-09-24 提交的版本。查看 最新版本

// ==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
// ==/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<t;i++)for(var o in n=arguments[i])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e}).apply(this,arguments)},s=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]}),d=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)&&s(n,e,i);return d(n,e),n},c=this&&this.__spreadArray||function(e,n,i){if(i||2===arguments.length)for(var t,o=0,a=n.length;o<a;o++)!t&&o in n||(t||(t=Array.prototype.slice.call(n,0,o)),t[o]=n[o]);return e.concat(t||Array.prototype.slice.call(n))};Object.defineProperty(a,"__esModule",{value:!0}),a.Script=a.createScript=void 0;var u=l(n);a.createScript=function(e){return new m(e)};var m=function(){function n(n){this._initialized=!1,this.options=r(r({},e.DEFAULT_OPTIONS),n),this.plugins=new Set,this.commands=[],this.init(),this.options.exposeToWindowObject&&(window.$script?u.warn('Unable to expose script to "window.$script". "window.$script" is already in use by another script.'):window.$script=this)}return n.prototype.command=function(n,i){if(i)return this.options.debug&&u.debug('Registering command "'+n+'"...'),this.commands.includes(i)?this.options.silent||u.warn('Command "'+i.name+'" has already been registered'):(i=r(r(r({},e.DEFAULT_COMMAND),i),{name:n}),this.commands.push(i),this.options.debug&&u.debug('Registered command "'+n+'".')),this;this.options.debug&&u.debug('Searching for command "'+n+'"...');for(var t=0;t<this.commands.length;t++){var o=this.commands[t];if(o.name==n)return this.options.debug&&(u.debug('Command "'+n+'" found.'),console.log(o)),o;if(o.aliases){if("string"==typeof o.aliases&&o.aliases===n)return this.options.debug&&(u.debug('Command "'+n+'" found.'),console.log(o)),o;if(Array.isArray(o.aliases)&&o.aliases.includes(n))return this.options.debug&&(u.debug('Command "'+n+'" found.'),console.log(o)),o}}this.options.debug&&u.debug('Command "'+n+'" 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&&u.warn("Plugin has already been applied."):e&&(0,i.isFunction)(e)?(this.plugins.add(e),e.apply(void 0,c([this],n,!1))):this.options.silent||u.error("A plugin must be a function."),this},n.prototype.init=function(){var e=this;if(!this._initialized){this.options.debug&&u.debug("Initializing script...");var n=this.options,i=n.chatElementSelector,o=n.prefix;if(i){var a=document.querySelector(i);a?(a.addEventListener("keydown",(function(n){if("Enter"==n.key){var r=a.value;if(!r.startsWith(o))return;var s=r.trim().slice(null==o?void 0:o.length).split(/ +/g),d=s[0],l=s.slice(1),c=e.command(d.toLowerCase());if(c){if(c.disabled)return;var u=(0,t.createChatContext)(i);c.clearChat&&u.clear(),c.run(e,u,l)}}})),this._initialized=!0,this.options.debug&&u.debug("Script initialized.")):u.error('Given chatElementSelector "'+i+'" not found as an element.')}}},n}();a.Script=m;var f={};Object.defineProperty(f,"__esModule",{value:!0}),f.defineCommand=void 0,f.defineCommand=function(e){return e};var p={};Object.defineProperty(p,"__esModule",{value:!0});var h={};Object.defineProperty(h,"__esModule",{value:!0});var y={};Object.defineProperty(y,"__esModule",{value:!0}),y.Script=void 0,Object.defineProperty(y,"Script",{enumerable:!0,get:function(){return a.Script}});var w={},b=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]}),v=this&&this.__exportStar||function(e,n){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(n,i)||b(n,e,i)};Object.defineProperty(w,"__esModule",{value:!0}),w.ChatContext=void 0,Object.defineProperty(w,"ChatContext",{enumerable:!0,get:function(){return t.ChatContext}}),v(p,w),v(h,w),v(y,w);var g={},C=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]}),O=this&&this.__exportStar||function(e,n){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(n,i)||C(n,e,i)};Object.defineProperty(g,"__esModule",{value:!0}),g.defineCommand=g.createScript=void 0,Object.defineProperty(g,"createScript",{enumerable:!0,get:function(){return a.createScript}}),Object.defineProperty(g,"defineCommand",{enumerable:!0,get:function(){return f.defineCommand}}),O(w,g);var _={};Object.defineProperty(_,"__esModule",{value:!0}),_.Colors=_.DEFAULT_OPTIONS=void 0,_.DEFAULT_OPTIONS={textColor:"#ffffff",visibilityTime:5e3,alertElement:"#curser"},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"}(_.Colors||(_.Colors={}));var S={},N=this&&this.__assign||function(){return(N=Object.assign||function(e){for(var n,i=1,t=arguments.length;i<t;i++)for(var o in n=arguments[i])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e}).apply(this,arguments)};Object.defineProperty(S,"__esModule",{value:!0}),S.useAlert=void 0,S.useAlert=function(e,n){n=N(N({},_.DEFAULT_OPTIONS),n);var i=document.querySelector(n.alertElement);n.textColor&&(i.style.color=n.textColor),i.style.fontSize="24px",i.textContent=e,i.style.display="block",setTimeout((function(){i.style.display="none"}),n.visibilityTime)};var P={};Object.defineProperty(P,"__esModule",{value:!0});var A={},F=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]}),M=this&&this.__exportStar||function(e,n){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(n,i)||F(n,e,i)};Object.defineProperty(A,"__esModule",{value:!0}),M(P,A);var j={},E=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]}),k=this&&this.__exportStar||function(e,n){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(n,i)||E(n,e,i)};Object.defineProperty(j,"__esModule",{value:!0}),j.Colors=j.useAlert=void 0,Object.defineProperty(j,"useAlert",{enumerable:!0,get:function(){return S.useAlert}}),k(A,j),Object.defineProperty(j,"Colors",{enumerable:!0,get:function(){return _.Colors}});var L={};const x=[{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"}],T=[{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"}];L.availableSettings=[...x,...T];const{defineCommand:D}=g,{useAlert:G,Colors:I}=j,{availableSettings:B}=L;var R=[D({name:"setting",aliases:["s"],run:(e,n,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))}();

QingJ © 2025

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