3

You might also like

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

// ==UserScript==

// @name Copy Coords Tool thing


// @namespace http://tampermonkey.net/
// @version 0.0.1
// @license MIT
// @description simple tool
// @author gh8sted
// @match *://ourworldofpixels.com/*
// @icon https://www.google.com/s2/favicons?domain=ourworldofpixels.com
// @grant none
// @namespace none
// ==/UserScript==

(function() {
'use strict';
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms))
}
function load(){

if(!OWOP.cursors.paste && OWOP.cursors.stamp) OWOP.cursors.paste =


OWOP.cursors.stamp;
if(!OWOP.tools) OWOP.tools = OWOP.tool;
if(!OWOP.tool) OWOP.tool = OWOP.tools;
OWOP.tool.addToolObject(new OWOP.tool.class("copycoords",
OWOP.cursors.cursor, OWOP.fx.player.RECT_SELECT_ALIGNED(1), true, tool => {
tool.setEvent("mousedown", e => {
if(e.buttons === 0) return;
const [x, y] = [OWOP.mouse.tileX, OWOP.mouse.tileY];
navigator.clipboard.writeText(x+","+y);
});
}));
}
async function waitForOWOP() {
try{
while (!OWOP){
await sleep(100);
}
while (!OWOP.windowSys.windows["Tools"]) {
await new Promise(resolve => setTimeout(resolve, 100));
}
setTimeout(() => {
load();
}, 1000)
} catch {
await sleep(100);
waitForOWOP();
}
}

waitForOWOP();
})();

You might also like