Ultra PPB Script

Shows ultra ppb and sorta accurate projected score, modified from Oki's cheese pace script

当前为 2021-09-13 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Ultra PPB Script
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.0.2
  5. // @description Shows ultra ppb and sorta accurate projected score, modified from Oki's cheese pace script
  6. // @author orz, meppydc
  7. // @match https://*.jstris.jezevec10.com/*
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. /**************************
  12. Cheese Pace Script
  13. **************************/
  14.  
  15. (function() {
  16. window.addEventListener('load', function(){
  17.  
  18.  
  19. //url = window.location.href
  20. //if(~url.indexOf("play=5")){
  21. var rect = holdCanvas.getBoundingClientRect();
  22. var p = document.createElement("div");
  23. p.id = "ultra_pace"
  24. p.style = ("color:#999;width:150px;position:absolute;top:"+(rect.top+400)+"px;left:"+(rect.left-50)+"px")
  25. p.style.display = "none"
  26. p.innerHTML = `
  27. <table style='width:100%;height:100%;table-layout:fixed;'>
  28. <tr>
  29. <th style='text-align:center' colspan="2">Pace:</th>
  30. </tr>
  31. <tr>
  32. <td>PPB:</td>
  33. <td id='ultraPaceTime'>0</td>
  34. </tr>
  35. <tr>
  36. <td>Score </td>
  37. <td id='ultraPacePieces'>0</td>
  38. </tr>
  39. </table>
  40. `
  41. document.body.appendChild(p);
  42.  
  43.  
  44. if(typeof trim != "function"){var trim=a=>{a=a.slice(0,-1);a=a.substr(a.indexOf("{")+1);return a}}
  45. if(typeof getParams != "function"){var getParams=a=>{var params=a.slice(a.indexOf("(")+1);params=params.substr(0,params.indexOf(")")).split(",");return params}}
  46.  
  47. var queueBoxFunc = Game['prototype']['updateQueueBox'].toString()
  48.  
  49. function paces() {
  50.  
  51. var score = this["gamedata"]["score"]
  52. var placedBlocks = this["placedBlocks"]
  53.  
  54. var ppb = score / placedBlocks
  55. //console.log(this["clock"])
  56. var scorePace = score + score / this["clock"] * (120 - this["clock"]);
  57.  
  58. ultraPaceTime.innerHTML= (ppb*0 + 1)? ppb.toFixed(2):'0.00';
  59. ultraPacePieces.innerHTML= (scorePace*0 + 1)? scorePace.toFixed(0):'0';
  60. }
  61.  
  62. queueBoxFunc = trim(paces.toString()) + trim(queueBoxFunc);
  63. Game['prototype']["updateQueueBox"] = new Function(queueBoxFunc);
  64.  
  65. function afterReadyGoFunction() {
  66. //console.log(this['pmode'])
  67. if (this['pmode'] == 5) {
  68. ultra_pace.style.display = "block"
  69. } else {
  70. ultra_pace.style.display = "none"
  71. }
  72. }
  73.  
  74. var readyGoFunc3 = Game['prototype']['startPractice'].toString()
  75. var params5 = getParams(readyGoFunc3)
  76. readyGoFunc3 = trim(readyGoFunc3) + trim(afterReadyGoFunction.toString())
  77. Game['prototype']['startPractice'] = new Function(...params5, readyGoFunc3);
  78.  
  79. //}
  80.  
  81. });
  82. })();