_N0N4M3's Diep.io Mod

Dark theme, FPS & Ping display

目前為 2024-11-06 提交的版本,檢視 最新版本

// ==UserScript==
// @name         _N0N4M3's Diep.io Mod
// @namespace    http://tampermonkey.net/
// @version      2024-11-06
// @description  Dark theme, FPS & Ping display
// @author       _N0N4M3
// @match        https://diep.io/
// @icon         https://www.google.com/s2/favicons?sz=64&domain=diep.io
// @run-at       document-start
// @grant        none
// ==/UserScript==

let darkThemeEnabled = 0;
let info = 0;
let currentElem = {};
let fill = CanvasRenderingContext2D.prototype.fill;
 
function darkTheme() {
	input.execute("ren_background false");
	input.execute("net_replace_colors 0x1c1c1c 0x333333 0x003b4b 0x003b4b 0x501a1c 0x3f2a51 0x004b24 0x2e5523 0x554d23 0x542727 0x272f54 0x502749 0x554d23 0x165530 0x3e3e3e 0x501a1c 0x544127 0x404040");
	input.execute("ren_minimap_background_color 0x555555");
	input.execute("ren_stroke_soft_color_intensity -2");
	input.execute("ren_health_background_color 0x222222");
	input.execute("ren_health_fill_color 0x00FF00");
	input.execute("ren_score_bar_fill_color 0xFF0000");
	input.execute("ren_xp_bar_fill_color 0xFFFF80");

    darkThemeEnabled = 1;
}
 
function lightTheme() {
	input.execute("ren_background true");
	input.execute("net_replace_colors 0x555555 0x999999 0x00B2E1 0x00B2E1 0xF14E54 0xBF7FF5 0x00E16E 0x8AFF69 0xFFE869 0xFC7677 0x768DFC 0xF177DD 0xFFE869 0x43FF91 0xBBBBBB 0xF14E54 0xFCC376 0xC0C0C0");
	input.execute("ren_minimap_background_color 0xCDCDCD");
	input.execute("ren_stroke_soft_color_intensity 0.25");
	input.execute("ren_health_background_color 0x555555");
	input.execute("ren_health_fill_color 0x85E37D");
	input.execute("ren_score_bar_fill_color 0x43FF91");
	input.execute("ren_xp_bar_fill_color 0xFFDE43");

    darkThemeEnabled = 0;
}
 
function showInfo() {
	input.execute("ren_debug_info true");
	input.execute("ren_fps true");
}
 
function hideInfo() {
	input.execute("ren_debug_info false");
	input.execute("ren_fps false");
}

function canUseKey(e) {
    return input.doesHaveTank() && !e.ctrlKey && currentElem.tagName != "INPUT";
}
 
document.addEventListener("keydown", e => {
    let canUse = canUseKey(e);

	if (canUse) {
		let code = e.code;
 
		if (code == "KeyR") {
			darkTheme();
		}
 
		if (code == "KeyT") {
			lightTheme();
		}
	}
});
 
document.addEventListener("keyup", e => {
    let canUse = canUseKey(e);

	if (canUse) {
		let code = e.code;
 
		if (code == "KeyL") {
			info = !info;
 
			if (info) {
				showInfo();
			} else {
				hideInfo();
			}
		}
	}
});

CanvasRenderingContext2D.prototype.fill = function() {
	if (darkThemeEnabled && this.fillStyle == "#000000") {
		this.fillStyle = "#EEEEEE";
	}

	fill.apply(this);
}

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址