Surviv.io XClient (BETA)

Miscellaneous Surviv.io tweaks to make the game better!

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         Surviv.io XClient (BETA)
// @namespace    https://greasyfork.org/en/users/198860-zyenith
// @version      1.0.0
// @description  Miscellaneous Surviv.io tweaks to make the game better!
// @author       zyenith
// @match        *://surviv.io/*
// @match        *://surviv2.io/*
// @match        *://2dbattleroyale.com/*
// @match        *://2dbattleroyale.org/*
// @match        *://piearesquared.info/*
// @match        *://thecircleisclosing.com/*
// @match        *://secantsecant.com/*
// @match        *://parmainitiative.com/*
// @match        *://ot38.club/*
// @match        *://drchandlertallow.com/*
// @match        *://rarepotato.com/*
// @match        *://archimedesofsyracuse.info/*
// @match        *://nevelskoygroup.com/*
// @match        *://kugahi.com/*
// @match        *://kugaheavyindustry.com/*
// @match        *://chandlertallowmd.com/*
// @grant        none
// @antifeature    Tracking, for compatibility info
// @require        https://greasyfork.org/scripts/410512-sci-js-from-ksw2-center/code/scijs%20(from%20ksw2-center).js
// ==/UserScript==

const healthContainer = document.querySelector('#ui-health-container');

// Create health element
const health = document.createElement('span');
health.style.cssText = `
    display: block;
    position: fixed;
    z-index: 2;
    margin: 6px 0 0 0;
    right: 15px;
    mix-blend-mode: difference;
    font-weight: bold;
    font-size: large;
  `;
healthContainer.appendChild(health);

// Create adr element
const adr = document.createElement('span');
adr.style.cssText = `
    display: block;
    position: fixed;
    z-index: 2;
    margin: 6px 0 0 0;
    left: 15px;
    mix-blend-mode: difference;
    font-weight: bold;
    font-size: large;
  `;
healthContainer.appendChild(adr);

setInterval(function() {
    // Update health
    const hp = document.getElementById('ui-health-actual').style.width.slice(0, -1);
    health.innerHTML = Math.round(hp);

    // Calculate and update adr
    const boost0 = document.getElementById('ui-boost-counter-0').querySelector('.ui-bar-inner').style.width.slice(0, -1);
    const boost1 = document.getElementById('ui-boost-counter-1').querySelector('.ui-bar-inner').style.width.slice(0, -1);
    const boost2 = document.getElementById('ui-boost-counter-2').querySelector('.ui-bar-inner').style.width.slice(0, -1);
    const boost3 = document.getElementById('ui-boost-counter-3').querySelector('.ui-bar-inner').style.width.slice(0, -1);
    const adr0 = boost0 * 25 / 100 + boost1 * 25 / 100 + boost2 * 37.5 / 100 + boost3 * 12.5 / 100;
    adr.innerHTML = Math.round(adr0);
});