Created
June 8, 2021 17:26
-
-
Save L0laapk3/db02b1b402a96dfc62675e8ca83a9de3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name yare.io less delay | |
// @namespace http://tampermonkey.net/ | |
// @version 1.0 | |
// @author L0laapk3 | |
// @match yare.io/d1/* | |
// @run-at document-idle | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
const _setInterval = window.setInterval; | |
window.setInterval = (f, t) => { | |
if (t == 1000) { // prevent the first instance of setinterval with t = 1000 | |
_setInterval(_ => { | |
window.tick_counter = window.incoming.t; // update tick counter to latest received packet | |
f(); | |
}, t); | |
window.setInterval = _setInterval; // remove proxy function | |
} else | |
_setInterval(f, t) | |
}; | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment