Now you’ve got more chances in PvP :)
// ==UserScript==
// @name CoordsHelper
// @namespace Violentmonkey Scripts
// @match *://cavegame.io/*
// @match *://mineroyale.io/*
// @grant none
// @version 0.1.1.1
// @author Drik
// @description Now you’ve got more chances in PvP :)
// @run-at document-start
// @license MIT
// ==/UserScript==
(function() {
'use strict';
const $$$Coords$$$ = '.player-position.no-select';
const __chat__ = document.querySelector('#chat-input');
window.addEventListener('keyup', (e) => {
if (e.key.toLowerCase() !== 'r') return;
if (document.activeElement === __chat__) return;
const _eventT = new KeyboardEvent('keydown', {
key: 't',
code: 'KeyT',
keyCode: 84,
which: 84,
bubbles: true,
cancelable: true
});
document.dispatchEvent(_eventT);
const el = document.querySelector($$$Coords$$$);
if (!el || !__chat__) return;
const coords = el.textContent.trim();
__chat__.value = coords;
const _eventEnter = new KeyboardEvent('keydown', {
key: 'Enter',
code: 'Enter',
keyCode: 13,
which: 13,
bubbles: true,
cancelable: true
});
__chat__.dispatchEvent(_eventEnter);
});
})();