您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Anti bow insta.
当前为
- // ==UserScript==
- // @name Anti Projectile.
- // @namespace https://sandbox.moomoo.io/
- // @version v1.1
- // @description Anti bow insta.
- // @author Bianos Sozinho, Discord: istisna.bianos
- // @match *://*.moomoo.io/*
- // @require https://cdn.jsdelivr.net/npm/msgpack-lite@0.1.26/dist/msgpack.min.js
- // @icon https://moomoo.io/img/favicon.png?v=1
- // @grant none
- // ==/UserScript==
- (function() {
- 'use strict';
- let msgpack_lite = window.msgpack, possibleBowInsta = false, moving = false, ownPlayer = {}, projectiles = [], packetLimitazition = {max: 120, count: 0}, mill, socket, mouseX, mouseY, mouseAngle, height, width, resize, OriginalWebSocket = window.WebSocket;
- window.WebSocket = function(...args) {
- socket = new OriginalWebSocket(...args);
- socket.addEventListener('message', (event) => {
- let decoded = msgpack_lite.decode(new Uint8Array(event.data));
- let hooked;
- if (decoded.length > 1 && Array.isArray(decoded[1])) {
- hooked = [decoded[0], ...decoded[1]];
- } else {
- hooked = decoded
- }
- if(hooked[0] === "io-init") {
- let cvs = document.getElementById("gameCanvas");
- width = cvs.clientWidth;
- height = cvs.clientHeight;
- $(window).resize(function() {
- width = cvs.clientWidth;
- height = cvs.clientHeight;
- });
- resize = function() {
- width = cvs.clientWidth;
- height = cvs.clientHeight;
- }
- cvs.addEventListener("mousemove", e => {
- mouseX = e.clientX;
- mouseY = e.clientY;
- mouseAngle = Math.atan2(mouseY - (height / 2), mouseX - (width / 2));
- });
- }
- if(hooked[0] == "C") {
- if(ownPlayer.sid == null || ownPlayer.sid == undefined) {
- ownPlayer.sid = hooked[1];
- }
- }
- if (hooked[0] == "a") {
- if(!possibleBowInsta) projectiles = [];
- for (let i = 0; i < hooked[1].length / 13; i++) {
- let playerInfo = hooked[1].slice(13 * i, 13 * i + 13);
- if (playerInfo[0] == ownPlayer.sid) {
- ownPlayer.x = playerInfo[1];
- ownPlayer.y = playerInfo[2];
- }
- }
- if(moving && !possibleBowInsta) {
- setTimeout(() => {
- sendMessage("a", null);
- moving = false;
- }, 300);
- }
- }
- if (hooked[0] == "X") {
- projectiles.push({x: hooked[1], y: hooked[2], type: hooked[6]});
- let choosedProjectiles = [0, 2, 5];
- let filteredProjectiles = projectiles.filter(proj => choosedProjectiles.includes(proj.type));
- if(filteredProjectiles[0].type == 0) {
- possibleBowInsta = true;
- }
- if(filteredProjectiles.length >= 2 && filteredProjectiles[1].type == 2) {
- let getAngle = Math.atan2(filteredProjectiles[0].y - ownPlayer.y, filteredProjectiles[0].x - ownPlayer.x);
- place(mill, getAngle);
- sendMessage("a", getAngle + 35);
- moving = true;
- possibleBowInsta = false;
- }
- }
- update();
- });
- return socket;
- };
- let sendMessage = (function(type, ...args) {
- if (packetLimitazition.count < packetLimitazition.max) {
- const message = [type, args];
- const encodedMessage = msgpack_lite.encode(message);
- const byteArray = new Uint8Array(encodedMessage);
- socket.send(byteArray);
- packetLimitazition.count++;
- }
- });
- function place(id, rad) {
- sendMessage("G", id, null);
- sendMessage("d", 1, rad);
- sendMessage("d", 0, rad);
- };
- function isElementVisible(e) {
- return (e.offsetParent !== null);
- }
- function update() {
- for (let i=26;i<29;i++){
- if (isElementVisible(document.getElementById("actionBarItem" + i.toString()))){
- mill = i - 16;
- }
- }
- }
- })();