您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
change title to show coordinates, and a 30 second timer after space has been pressed, updated by HPrivakos
- // ==UserScript==
- // @name chopcoin coords+timer higher precision
- // @namespace namespace
- // @description change title to show coordinates, and a 30 second timer after space has been pressed, updated by HPrivakos
- // @include http://chopcoin.io/
- // @version 1.1
- // @grant none
- // ==/UserScript==
- var timer = 0;
- var xCoord = 0;
- var yCoord = 0;
- setTitle();
- window.addEventListener("keydown", dealWithKeyboard, false);
- function setTitle() {
- getCoords();
- document.title = xCoord + " : " + yCoord + " | " + Math.round(timer / 10);
- if (timer != 0) timer--;
- setTimeout(function(){ setTitle(); }, 100);
- }
- function getCoords() {
- var rawNodes = chopcoin.game.nodes['all'];
- for(var i=0; i<rawNodes.length; i++) {
- if (rawNodes[i]._name) {
- xCoord = Math.round(rawNodes[i].x / 100);
- yCoord = Math.round(rawNodes[i].y / 100);
- //console.log(xCoord + " x " + yCoord);
- }
- }
- }
- function dealWithKeyboard(e) {
- if (e.keyCode == "32") timer = 300;
- }