Path: blob/master/cheatGUI/src/utils/fps.ts
2563 views
import { wrapper } from "../index";12const FPSc = document.createElement("button"); // Create menu toggler3var enabled : boolean = false;456export function startFps () : void {7enabled = true;8activate();9}1011export function stopFps () : void {12enabled = false;13document.getElementById("fps-counter")?.remove();14}151617function activate () : void {1819FPSc.id = "fps-counter";20wrapper?.prepend(FPSc);212223setInterval(() => {2425const fps : number = _.player.game.fps._framerate;2627if (enabled) {28FPSc.innerText = fps.toFixed(2) + " FPS";29} else {30FPSc.remove();31return;32}33}, 300);34}3536