moomoo-api

API для взаимодействия с игрой

As of 03.10.2018. See апошняя версія.

This script should not be not be installed directly. It is a library for other scripts to include with the meta directive // @require https://update.greatest.deepsurf.us/scripts/372832/633816/moomoo-api.js

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

var MooMoo=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){"use strict";function r(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=[],r=!0,o=!1,u=void 0;try{for(var a,i=e[Symbol.iterator]();!(r=(a=i.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,u=e}finally{try{r||null==i.return||i.return()}finally{if(o)throw u}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}n.r(t),n.d(t,"encodeMsg",function(){return i}),n.d(t,"decodeMsg",function(){return c}),n.d(t,"sendMsg",function(){return s}),n.d(t,"on",function(){return d}),n.d(t,"off",function(){return f}),n.d(t,"once",function(){return l}),n.d(t,"actions",function(){return m});var o=null,u=document.getElementById("enterGame"),a=new EventEmitter;function i(e){return msgpack.encode(e)}function c(e){return msgpack.decode(new Uint8Array(e))}function s(e,t){if(!o)throw new Error("ws is null");o.oldSend(i([e,t]))}function d(e,t){a.on(e,t)}function f(e,t){a.off(e,t)}function l(e,t){a.once(e,t)}u?u.onmousedown=function(){a.emit("__start__"),WebSocket.prototype.oldSend=WebSocket.prototype.send,WebSocket.prototype.send=function(e){o||((o=this).addEventListener("message",function(e){a.emit("__message__",e.data)}),a.emit("__socketFound__",o)),a.emit("__send__",e),this.oldSend(e)},u.onmousedown=null}:a.emit("__error__",{message:"button#enterGame not found"}),a.on("__message__",function(e){var t=r(c(e),2),n=t[0],o=t[1];switch(n){case"1":a.emit("enterGame",{playerId:o[0]});break;case"2":break;case"10":a.emit("hp",{playerId:o[0],hp:o[1]});break;case"7":a.emit("attack",{playerId:o[0],isHit:o[1],weaponId:o[2]});break;case"ch":a.emit("chat",{playerId:o[0],message:o[1]});break;case"9":a.emit("resources",{name:o[0],total:o[1],count:o[2]});break;case"us":a.emit("hat",{actionType:o[0],itemId:o[1],itemType:o[2]});break;case"an":a.emit("clanRequest",{playerId:o[0],playerName:o[1]});break;case"11":a.emit("dead")}});var m={sendChatMessage:function(e){s("ch",[e])},equipItem:function(e,t){s("13s",[0,e,t])}}}]);