change resolution

press p

  1. // ==UserScript==
  2. // @name change resolution
  3. // @namespace http://tampermonkey.net/
  4. // @version 2024-02-04
  5. // @description press p
  6. // @author Ly
  7. // @license MIT
  8. // @match https://flowr.fun/
  9. // @icon https://www.google.com/s2/favicons?sz=64&domain=flowr.fun
  10. // @grant none
  11. // ==/UserScript==
  12.  
  13. //requested by xion
  14.  
  15. let resolution = 1 //idk if there is a better way to do this because i am suck at programming :/
  16. document.addEventListener("keydown", event => {
  17. if (event.code === "KeyP") {
  18. resolution = prompt('Type in resolution. <1 for worse quality, >1 for higher quality. Keep in mind values higher than 3 or even 2 can cause lag and may crash your game. To update screen resolution, enter/exit fullscreen.')
  19. window.devicePixelRatio = parseFloat(resolution)
  20. }
  21. })
  22.