您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
press L and region shows
- // ==UserScript==
- // @name Diep.io Region Decoder
- // @namespace http://tampermonkey.net/
- // @version 1.0
- // @description press L and region shows
- // @author el bismut
- // @match https://diep.io/
- // @icon https://www.google.com/s2/favicons?domain=diep.io
- // @grant none
- // @license none
- // ==/UserScript==
- //original content
- var region = '';
- var link = '';
- function serverConnectHook(server) {
- region = server.split("lobby.")[1].split(".hiss")[0];
- }
- window.WebSocket = new Proxy(WebSocket, {construct(t, args) {serverConnectHook(args[0]); return Reflect.construct(t, args)}});
- CanvasRenderingContext2D.prototype.fillText = new Proxy(CanvasRenderingContext2D.prototype.fillText, {
- apply(fillText, ctx, [text, x, y, ...blah]) {
- if(text.includes("ms") && text.includes(".")) {
- const lengthBefore = ctx.measureText(text).width;
- text = text.split(" ms")[0] + "ms " + region;
- ctx.textAlign = 'right';
- x += lengthBefore;
- }
- fillText.call(ctx, text, x, y, ...blah);
- }
- });
- CanvasRenderingContext2D.prototype.strokeText = new Proxy(CanvasRenderingContext2D.prototype.strokeText, {
- apply(strokeText, ctx, [text, x, y, ...blah]) {
- if(text.includes("ms") && text.includes(".")) {
- const lengthBefore = ctx.measureText(text).width;
- text = text.split(" ms")[0] + "ms " + region;
- ctx.textAlign = 'right';
- x += lengthBefore;
- }
- strokeText.call(ctx, text, x, y, ...blah);
- }
- });