Arras.io Clone script (patched)

Right-click on any player and you become his clone! Then you can right-click anywhere again to stop being one. You can adjust the maximum distance from the clone host with the + and - keys. This script allows you to do multiboxing even without a VPN, as well as giving other players bots.

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name        Arras.io Clone script (patched)
// @namespace   LA3T
// @match       *://arras.io/*
// @grant       none
// @version     1.1
// @author      LA3T
// @description Right-click on any player and you become his clone! Then you can right-click anywhere again to stop being one. You can adjust the maximum distance from the clone host with the + and - keys. This script allows you to do multiboxing even without a VPN, as well as giving other players bots.
// @run-at       document-start
// @require      https://greatest.deepsurf.us/scripts/434599-apm/code/APM.js?version=983214
// @license      MIT
// ==/UserScript==


arras.hijack().then((sock) => {
  let ownerName = null;
  let ownerAngle = null;
  let ownerSize = null;
  let ownerX = null;
  let ownerY = null;
  let ownerGuns = 0;

  let doll = new arras.UpdateParser(true);
  let maxDelta = 55;
  let mx = 0;
  let my = 0;
  let flags = 0;

  sock.hookMsg((data) => {
    if (data[0] === 'u') {
      doll.parse(data);



      if (ownerName !== null) {
        doll.entities.forEach((cur, ind, arr) => {
          if (cur.name === ownerName && cur.size === ownerSize && cur.guns.length === ownerGuns) {
            let flag = 0;
            ownerAngle = (cur.facing / 2) * Math.PI / 180;
            ownerX = cur.x;
            ownerY = cur.y;
            if (Math.abs(ownerX - doll.camera.x) > maxDelta) {
              if (ownerX > doll.camera.x) {
                flag |= 0b0001000;
              } else {
                flag |= 0b0000100;
              }
            }

            if (Math.abs(ownerY - doll.camera.y) > maxDelta) {
              if (ownerY > doll.camera.y) {
                flag |= 0b0000010;
              } else {
                flag |= 0b0000001;
              }
            }


            let distance = 999;
            let newMx = Math.cos(ownerAngle) * distance;
            let newMy = Math.sin(ownerAngle) * distance;

            flags = flag;
            sock.talk('C', newMx, newMy, flag);
          }
        });
      }
    }
  });

  sock.hookSend((data) => {
    if (data[0] === 'C') {
      let flag2 = data[3];
      flag2 &= 0b1110000;
      let rightMouseOn = flag2 & 0b1000000;
      if (rightMouseOn) {
        mx = data[1];
        my = data[2];
        ownerName = null;
        ownerAngle = null;
        ownerSize = null;
        doll.entities.forEach((cur, ind, arr) => {
          let clickX = doll.camera.x + mx;
          let clickY = doll.camera.y + my;

          let deltaX = clickX - cur.x;
          let deltaY = clickY - cur.y;

          if (Math.sqrt(deltaX * deltaX + deltaY * deltaY) <= cur.size) {
            ownerName = cur.name;
            ownerAngle = cur.facing;
            ownerSize = cur.size;
            ownerGuns = cur.guns.length;
            ownerX = cur.x;
            ownerY = cur.y;



            sock.receive('m', ownerName + " is your owner now!");
          }
        });
      }

      if (ownerName !== null) {

        let distance = 999;
        let newMx = Math.cos(ownerAngle) * distance;
        let newMy = Math.sin(ownerAngle) * distance;

        return ['C', newMx, newMy, flags];
      }
    }
  });


  window.addEventListener("keydown", (key) => {
    switch (key.code) {
      case "Equal":
        maxDelta += 1;
        sock.receive('m', "Max distance is "+maxDelta+" now!");
      break;


      case "Minus":
        maxDelta -= 1;
        sock.receive('m', "Max distance is "+maxDelta+" now!");
      break;
    };
  });
});