Under PPS Restart Script

restarts game automatically when you go too slow

Verze ze dne 11. 06. 2019. Zobrazit nejnovější verzi.

  1. // ==UserScript==
  2. // @name Under PPS Restart Script
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description restarts game automatically when you go too slow
  6. // @author Oki
  7. // @match https://*.jstris.jezevec10.com/*
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. /**************************
  12. Under PPS Restart Script
  13. **************************/
  14.  
  15. localStorage.restartOption = localStorage.restartOption || "0";
  16. localStorage.restartThreshold = localStorage.restartThreshold || "0";
  17.  
  18. var pbOption = document.createElement("table");
  19. pbOption.innerHTML = `<tbody><tr><td><input name='group'onclick="localStorage.restartOption=0"id='soundPPS'type="radio"><label for="soundPPS">Play a sound</label></td><td><input onclick="localStorage.restartOption=1" id='restartPPS' name='group' type="radio"><label for="restartPPS">Restart the run</label></td></tr><tr><td colspan="2"><span>when PPS goes below <input oninput='localStorage.restartThreshold=this.value'id='threshold'style="width:50px"></span></td></tr></tbody><br>`
  20. tab_other.appendChild(pbOption)
  21.  
  22. document.getElementsByName("group")[+localStorage.restartOption].checked = 1
  23. threshold.value = localStorage.restartThreshold
  24.  
  25. var trim=a=>{a=a.slice(0,-1);a=a.substr(a.indexOf("{")+1);return a}
  26. var readyGo = Game['prototype']["readyGo"].toString()
  27. readyGo = `setTimeout(x=>eval('if(0<threshold.value)var checkPPS=setInterval(function(){if(+PPS.innerText<+threshold.value&&0!=+PPS.innerText){if(document.getElementsByName("group")[0].checked&&+localStorage.SE){var a=new Audio("https://jstris.jezevec10.com/res/se0/fault.wav");if(vol=document.getElementById("vol-control").value)a.volume=vol/100;a.play()}else document.dispatchEvent(new KeyboardEvent("keydown",{keyCode:localStorage.k9}));clearInterval(checkPPS)}},200);'), 5000);` + trim(readyGo)
  28. Game['prototype']["readyGo"] = new Function(readyGo);