Greasy Fork

Greasy Fork is available in English.

OWOP Incognito Mode

Stops sending updates about your position to the server

当前为 2025-10-16 提交的版本,查看 最新版本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         OWOP Incognito Mode
// @namespace    http://tampermonkey.net/
// @version      1.3
// @description  Stops sending updates about your position to the server
// @author       NothingHere7759 & thisisks
// @match        https://ourworldofpixels.com/*
// @match        https://pre.ourworldofpixels.com/*
// @exclude      https://ourworldofpixels.com/api/*
// @exclude      https://pre.ourworldofpixels.com/api/*
// @icon         data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant        none
// @license      MIT
// ==/UserScript==

'use strict'

!function() {

    function install() {
        // The actual script
        window.incognitoMode = false;
        const oldSendUpdate = OWOP.net.protocol.sendUpdates;
        OWOP.net.protocol.sendUpdates = function () {
            if (!incognitoMode) { oldSendUpdate.apply(OWOP.net.protocol, []) } else { return; }
        }

        // Command
        const oldSM = OWOP.misc.chatSendModifier;
        OWOP.misc.chatSendModifier = (msg) => {
            oldSM(msg);
            if (msg.toLowerCase().startsWith('/incog')) {
                let args = msg.toLowerCase().split(' ');
                if (args.length != 2 || !['true', 'false'].includes(args[1])) {
                    OWOP.chat.local('Usage: /incog true/false');
                    return '';
                } else {
                    incognitoMode = args[1] == 'true' ? true : false;
                    if (incognitoMode) { OWOP.chat.local(`Last recorded position: ${OWOP.mouse.tileX} ${OWOP.mouse.tileY}`); };
                    return '';
                }
            } else return msg;
        }
    }
    const waitUntil = (probe, cb, t = 200) => {
        const id = setInterval(() => { try { if (probe()) { clearInterval(id); cb(); } } catch { } }, t);
    };

function init() {
    if (document.getElementById("load-scr")?.style?.transform && OWOP?.player?.tool) {
        install();
    } else {
        setTimeout(init, 1e2);
    }
}

init();
}();