Evades.io Tracers

New Tracers, go from any side(player) to any stones

Fra 25.05.2025. Se den seneste versjonen.

// ==UserScript==
// @name        Evades.io Tracers
// @namespace   Violentmonkey Scripts
// @match       *://evades.io/*
// @grant       none
// @version     1.0
// @author      Drik
// @description New Tracers, go from any side(player) to any stones
// @run-at      document-idle
// @license MIT
// ==/UserScript==

(function() {
  'use strict';

  const c = {
    e: true,
    m: 1000,
    t: 2,
    l: true,
    f: '12px Arial',
    o: { x: 4, y: -4 },
    r: 20
  };

  window.addEventListener('keydown', k => {
    if (k.key === 'F4') c.e = !c.e;
  });

  const s = 'div.quests-launcher';
  let fb, g;

  function gS() {
    const el = document.querySelector(s);
    if (!el) return false;
    fb = Object.keys(el).find(k => k.startsWith('__reactFiber$'));
    g = el[fb]?.memoizedProps?.children?._owner?.stateNode?.gameState;
    return !!(g?.entities && g.areaInfo?.self?.entity);
  }

  function dT() {
    if (!c.e || !gS()) return;
    const cv = document.querySelector('canvas');
    const ct = cv.getContext('2d');
    const w = cv.width;
    const h = cv.height;
    const p = g.areaInfo.self.entity;
    const cx = w / 2;
    const cy = h / 2;
    const sc = 1;

    ct.save();
    ct.lineWidth = c.t;
    ct.font = c.f;

    Object.values(g.entities).forEach(e => {
      if (!e.isEnemy) return;
      const dx = (e.x - p.x) * sc;
      const dy = (e.y - p.y) * sc;
      const d = Math.hypot(dx, dy);
      if (d > c.m) return;
      const ex = cx + dx;
      const ey = cy + dy;
      const rr = (typeof e.radius === 'number' ? e.radius : c.r) * sc;
      const a = Math.atan2(dy, dx);
      const ax = ex - Math.cos(a) * rr;
      const ay = ey - Math.sin(a) * rr;

      ct.strokeStyle = e.color || '#ff0';
      ct.beginPath();
      ct.moveTo(cx, cy);
      ct.lineTo(ax, ay);
      ct.stroke();

      if (c.l) {
        ct.fillStyle = e.color || '#ff0';
        ct.fillText(Math.round(d), ax + c.o.x, ay + c.o.y);
      }
    });

    ct.restore();
  }

  const rAF = window.requestAnimationFrame;
  window.requestAnimationFrame = cb => rAF(t => {
    cb(t);
    dT();
  });

})();
长期地址
遇到问题?请前往 GitHub 提 Issues。