Greasy Fork

Greasy Fork is available in English.

OWOP Follower

Teleports you wherever the last pixel was placed

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         OWOP Follower
// @namespace    http://greasyfork.icu/en/users/1474965/
// @version      2.0
// @description  Teleports you wherever the last pixel was placed
// @author       thisisks
// @match        https://ourworldofpixels.com/*
// @match        https://pre.ourworldofpixels.com/*
// @exclude      https://ourworldofpixels.com/api/*
// @exclude      https://pre.ourworldofpixels.com/api/*
// @grant        none
// @run-at       document-idle
// @license MIT
// ==/UserScript==
 
(function() {
    'use strict';
 
    const button = document.createElement('button');
    button.textContent = 'Follower: OFF';
    Object.assign(button.style, {
        position: 'fixed',
        top: '10px',
        right: '10px',
        zIndex: '9999',
        padding: '8px 12px',
        backgroundColor: '#222',
        color: '#fff',
        border: 'none',
        borderRadius: '4px',
        cursor: 'pointer',
        fontSize: '14px'
    });
    document.body.appendChild(button);
 
    let emitEnabled = false;
 
    button.addEventListener('click', () => {
        emitEnabled = !emitEnabled;
        button.textContent = `Follower: ${emitEnabled ? 'ON' : 'OFF'}`;
        button.style.backgroundColor = emitEnabled ? '#7b2121' : '#222';
    });
 
    OWOP.on(OWOP.events.net.world.tilesUpdated, (log) => {
        if (emitEnabled) {
            OWOP.emit(29, log[0].x, log[0].y);
 
        }
    });
})();