Greasy Fork is available in English.

MooMooMod

wait

Stan na 25-08-2021. Zobacz najnowsza wersja.

// ==UserScript==
// @name         MooMooMod
// @namespace    none
// @version      1.1.3
// @description  wait
// @author       00100110#6361
// @match        *://*.moomoo.io/*
// @match        *://moomoo.io/*
// @require      https://greasyfork.org/scripts/423602-msgpack/code/msgpack.js
// @grant        none
// ==/UserScript==
(function() {
'use strict'; // Okay, let's use strict mode
class Main {
constructor(status) {
this.status = status
}
RemoveAd() { // Ad
try {
console.log("Ad!")
setTimeout(() => ($('#ot-sdk-btn-floating').remove(), $('#pre-content-container').remove()), 3000) // Remove cookie
document.getElementById("moomooio_728x90_home").style.display = "none"
jQuery("#moomooio_728x90_home").parent().css("display", "none")
jQuery('#adCard').remove()
jQuery("#adBlock").remove()
} catch (e) {}
}
AdapterPing() { // Ping
try {
console.log("Ping!")
jQuery("#errorNotification").remove()
jQuery("#youtuberOf").remove()
jQuery("#followText").remove()
jQuery("#promoImgHolder").remove()
jQuery("#twitterFollow").remove()
jQuery("#joinPartyButton").remove()
jQuery("#linksContainer2").remove()
jQuery("#partyButton").remove()
jQuery("#youtubeFollow").remove()
jQuery("#mobileInstructions").remove()
jQuery("#altServer").remove()
jQuery("#downloadButtonContainer").remove()
jQuery("#mobileDownloadButtonContainer").remove()
jQuery(".downloadBadge").remove()
} catch (e) {}
}
AdapterFPS() { // FPS
try {
console.log("Fps!")
window.location.native_resolution = true
} catch (e) {}
}
}
const MAIN = new Main("Work")
console.log("Status: " + MAIN.status)
queueMicrotask(MAIN.AdapterPing)
queueMicrotask(MAIN.AdapterFPS)
queueMicrotask(MAIN.RemoveAd)
const $el_PING = jQuery("#pingDisplay")
$el_PING.css("display", "block")
$("body").append($el_PING)
window.requestAnimFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || function(e) {
window.setTimeout(e, 1e3 / 40)
}
window.requestAnimFrame(MAIN)
})()
// AutoHeal
let autoHeal = {
tgl: false,
health: 100,
date: Date.now(),
speed: 75
}
setInterval(() => {
if(autoHeal.tgl === true) {
if(Date.now() - autoHeal.date >= autoHeal.speed) {
for (let i = 0; i < (autoHeal.health / (foodType === 0 ? 85 : 135)); i++) {
main.Place(foodType)
}
autoHeal.tgl = false;
}
}
});
let {primary, secondary, foodType, wallType, spikeType, millType, mineType, boostType, turretType, spawnpadType} = {// Id
primary: null,
secondary: null,
foodType: null,
wallType: null,
spikeType: null,
millType: null,
mineType: null,
boostType: null,
turretType: null,
spawnpadType:null
}
let {enemiesNear, nearEnemy, isEnemyNear, nearEnemyAngle} = {// Enemy
enemiesNear: null,
nearEnemy: null,
IsEnemyNear: null,
nearEnemyAngle: null
}
let {myID, myX, myY, myDir, Object, Weapon, Clan, IsLeader, Hat, Acc, IsSkull} = {// My paramets
myID: null,
myX: null,
myY: null,
myDir: null,
Object: null,
Weapon: null,
Clan: null,
IsLeader: null,
Hat: null,
Acc: null,
IsSkull: null
}
let speedMill = 150
let old = Date.now()
let $el_id = document.activeElement.id.toLowerCase()
let AutoMill = false
let w, h, mX, mY// width, height, mouseX, mouseY
let wS// websocket
let msgPack = msgpack
document.msgpack = msgpack
WebSocket.prototype.Sender = WebSocket.prototype.send;
WebSocket.prototype.send = function(e) {
if (!wS) {
wS = this
SOCKETADAPTER(this)
}
this.Sender(e)
}
const SOCKETADAPTER = (e) => {
e.addEventListener("message", msg => HANDLER(msg))
}
const HANDLER = (e) => {
let temp = msgPack.decode(new Uint8Array(e.data))
let data;
if (temp.length > 1) {
data = [temp[0], ...temp[1]]
if (data[1] instanceof Array) data = data
} else {
data = temp
}
let item = data[0];
if (!data) return
if (item == "io-init") {
let cvs = document.getElementById("gameCanvas");
w = cvs.clientWidth
h = cvs.clientHeight
$(window).resize(function() {
w = cvs.clientWidth
h = cvs.clientHeight
});
cvs.addEventListener("mousemove", e => {
mX = e.clientX
mY = e.clientY
});
}
if (item == "1" && myID == null) {
myID = data[1]
}
if (item == "33") {
enemiesNear = [];
for (let i = 0; i < data[1].length / 13; i++) {
let fAi = data[1].slice(13 * i, 13 * i + 13);
if (fAi[0] == myID) {
myX = fAi[1]
myY = fAi[2]
myDir = fAi[3]
Object = fAi[4]
Weapon = fAi[5]
Clan = fAi[7]
IsLeader = fAi[8]
Hat = fAi[9]
Acc = fAi[10]
IsSkull = fAi[11]
} else if (fAi[7] !== Clan || fAi[7] == null) {
enemiesNear.push(fAi)
}
}
}
if (enemiesNear) {
nearEnemy = enemiesNear.sort((a, b) => main.dist(a) - main.dist(b))[0]
}
if (!nearEnemy) {
nearEnemyAngle = myDir
}
if (nearEnemy) {
nearEnemyAngle = Math.atan2(nearEnemy[2] - myY, nearEnemy[1] - myX)
if (Math.sqrt(Math.pow((myY - nearEnemy[2]), 2) + Math.pow((myX - nearEnemy[1]), 2)) < 300) {
isEnemyNear = true
}
}
item === "h" && myID == data[1] && data[2] <= autoHeal.health && (autoHeal.tgl = true, autoHeal.date = Date.now())
item === "h" && myID == data[1] && data[2] <= autoHeal.health && autoHeal.date < 75 ? autoHeal.speed = 125 : autoHeal.speed = 75
main.getId()
}
class Fncs {
constructor() {}
SendInWS(e) {
wS.send(new Uint8Array(Array.from(msgPack.encode(e))))
}
Send(e, a) {
main.SendInWS([e, [a]])
}
Place(id, a = Math.atan2(mY - h / 2, mX - w / 2)) {
main.SendInWS(["5", [id, null]])
main.SendInWS(["c", [1, a]])
main.SendInWS(["c", [0, a]])
main.SendInWS(["5", [Weapon, true]])
}
EquipAcc(id) {
main.SendInWS(["13c", [1, id, 1]])
main.SendInWS(["13c", [0, id, 1]])
}
EquipHat(id) {
main.SendInWS(["13c", [1, id, 0]])
main.SendInWS(["13c", [0, id, 0]])
}
toRad(angle) {
return angle * 0.01745329251;
}
dist(a) {
return Math.sqrt(Math.pow((myY - a[2]), 2) + Math.pow((myX - a[1]), 2))
}
eV(e) {
return e.offsetParent !== null
}
getId() {
for (let i = 0; i < 9; i++) if (main.eV(document.getElementById("actionBarItem" + i.toString()))) primary = i
for (let i = 9; i < 16; i++) if (main.eV(document.getElementById("actionBarItem" + i.toString()))) secondary= i
for (let i = 16; i < 19; i++) if (main.eV(document.getElementById("actionBarItem" + i.toString()))) foodType = i - 16
for (let i = 19; i < 22; i++) if (main.eV(document.getElementById("actionBarItem" + i.toString()))) wallType = i - 16
for (let i = 22; i < 26; i++) if (main.eV(document.getElementById("actionBarItem" + i.toString()))) spikeType = i - 16
for (let i = 26; i < 29; i++) if (main.eV(document.getElementById("actionBarItem" + i.toString()))) millType = i - 16
for (let i = 29; i < 31; i++) if (main.eV(document.getElementById("actionBarItem" + i.toString()))) mineType = i - 16
for (let i = 31; i < 33; i++) if (main.eV(document.getElementById("actionBarItem" + i.toString()))) boostType = i - 16
for (let i = 33; i < 36; i++) if (main.eV(document.getElementById("actionBarItem" + i.toString()))) turretType = i - 16
for (let i=37;i<39;i++) if (main.eV(document.getElementById("actionBarItem" + i.toString()))) turretType = i - 16
}
InstaKill() {
if(Acc == 11) main.EquipAcc(0)
main.Send("ch", "MooMooInsta")
main.Send("7", 1)
main.SendInWS(["5", [primary, true]])
main.EquipHat(7)
setTimeout(() => {
main.EquipHat(53)
main.SendInWS(["5", [secondary, true]])
setTimeout(() => {
main.Send("7", 1)
main.SendInWS(["5", [primary, true]])
main.EquipHat(6)
}, 160)
}, 92)
}
KM() {
setTimeout(() => {
main.Send("6", 3)
main.Send("6", 17)
main.Send("6", 31)
main.Send("6", 23)
main.Send("6", 9)
main.Send("6", 38)
main.Send("6", 4)
main.Send("6", 15)
}, 100);
}
TripleMills(diraim) {
if(Hat == 12) speedMill = 107
else if(Hat == 12 && Acc == 11) speedMill = 60
else if(Hat == 12 && Acc == 11 && Weapon == 7 || Weapon == 8) speedMill = 35
else if(Weapon == 0) speedMill = 150
else if(Hat == 12 && Acc == 11 && Weapon == 0) speedMill = 95
else if(Acc == 11) speedMill = 115
else if(Weapon == 7) speedMill = 110
else if(Weapon == 7 || Weapon == 8 && Acc == 11) speedMill = 84
else if(Weapon == 7 || Weapon == 8 && Hat == 12) speedMill = 90
if (!old || Date.now() - old >= speedMill){
main.Place(millType, diraim - main.toRad(0));
main.Place(millType, diraim - main.toRad((76 - Math.PI / 180) - Math.PI))
main.Place(millType, diraim + main.toRad((76 - Math.PI / 180) - Math.PI))
old = Date.now();
}
}
rpt(k, i, itr) {
let {skeyDown, itrvl} = {
skeyDown: 0,
itrvl: undefined
}
return {
start: function(keycode) {
if (keycode == k && $el_id !== 'chatbox') {
skeyDown = 1
if (itrvl == undefined) {
itrvl = setInterval(() => {
i()
!skeyDown && (clearInterval(itrvl), itrvl = undefined)
}, itr)
}
}
},
stop: function(keycode) {
keycode == k && $el_id !== 'chatbox' && (skeyDown = 0)
}
}
}
}
let main = new Fncs()
const MillType1 = main.rpt(78, () => {
main.Place(millType)
}, 1);
const SpikeType1 = main.rpt(86, () => {
main.Place(spikeType)
}, 1);
const BoostType1 = main.rpt(70, () => {
main.Place(boostType)
}, 1);
const FoodType1 = main.rpt(81, () => {
main.Place(foodType)
}, 1);
const TurretType1 = main.rpt(72, () => {
main.Place(turretType)
}, 1);
document.addEventListener('keydown', (e) => {
TurretType1.start(e.keyCode)
MillType1.start(e.keyCode)
SpikeType1.start(e.keyCode)
BoostType1.start(e.keyCode)
FoodType1.start(e.keyCode)
e.keyCode == 90 && $el_id !== 'chatbox' && (main.EquipHat(40), main.EquipAcc(19))
if(e.keyCode == 16 && $el_id !== 'chatbox') {
main.EquipAcc(11)
if (myY < 2400) main.EquipHat(15)
else if (myY > 6850 && myY < 7550) main.EquipHat(31)
else main.EquipHat(12)
}
e.keyCode == 82 && $el_id !== 'chatbox' && (main.InstaKill())
e.keyCode == 38 && $el_id !== 'chatbox' && (main.KM())
e.keyCode == 77 && $el_id !== 'chatbox' && (AutoMill == true ? (AutoMill = false, main.Send("ch", "TripleMills: Off")) : (AutoMill = true, main.Send("ch", "TripleMills: On")))
if (AutoMill == true) {
if (e.keyCode == 87 && e.keyCode == 65) main.TripleMills(0.79)
else if (e.keyCode == 87 && e.keyCode == 68) main.TripleMills(2.36)
else if (e.keyCode == 83 && e.keyCode == 65) main.TripleMills(-0.79)
else if (e.keyCode == 83 && e.keyCode == 68) main.TripleMills(-2.36)
else if (e.keyCode == 83) main.TripleMills(-1.57)
else if (e.keyCode == 87) main.TripleMills(1.57)
else if (e.keyCode == 68) main.TripleMills(3.14)
else if (e.keyCode == 65) main.TripleMills(0)
}
})
document.addEventListener('keyup', (e) => {
TurretType1.stop(e.keyCode)
MillType1.stop(e.keyCode)
SpikeType1.stop(e.keyCode)
BoostType1.stop(e.keyCode)
FoodType1.stop(e.keyCode)
})
function newDOM() {
document.getElementById("storeHolder").style = "height: 1500px; width: 450px;"
document.getElementById("moomooio_728x90_home").style.display = "none"
document.getElementById("enterGame").innerHTML = "Spawn"
document.getElementById("gameName").innerHTML = "MooMooMod"
}
let $el_lT = document.getElementById("loadingText")
const RELOAD = setInterval(() => {
switch ($el_lT.textContent) {
case "disconnectedreload":
document.getElementById("gameName").textContent = "AutoReload: Start!"
window.onbeforeunload = null
setTimeout(() => clearInterval(RELOAD), 100)
window.location.reload()
break
}
})
queueMicrotask(newDOM)