Greasy Fork 还支持 简体中文。

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.1
  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.innerHTML = `
  26. <table style='width:100%;height:100%;table-layout:fixed;'>
  27. <tr>
  28. <th style='text-align:center' colspan="2">Pace:</th>
  29. </tr>
  30. <tr>
  31. <td>PPB:</td>
  32. <td id='ultraPaceTime'>0</td>
  33. </tr>
  34. <tr>
  35. <td>Score </td>
  36. <td id='ultraPacePieces'>0</td>
  37. </tr>
  38. </table>
  39. `
  40. document.body.appendChild(p);
  41.  
  42.  
  43. if(typeof trim != "function"){var trim=a=>{a=a.slice(0,-1);a=a.substr(a.indexOf("{")+1);return a}}
  44. if(typeof getParams != "function"){var getParams=a=>{var params=a.slice(a.indexOf("(")+1);params=params.substr(0,params.indexOf(")")).split(",");return params}}
  45.  
  46. var queueBoxFunc = Game['prototype']['updateQueueBox'].toString()
  47.  
  48. function paces() {
  49.  
  50. var score = this["gamedata"]["score"]
  51. var placedBlocks = this["placedBlocks"]
  52.  
  53. var ppb = score / placedBlocks
  54. //console.log(this["clock"])
  55. var scorePace = score + score / this["clock"] * (120 - this["clock"]);
  56.  
  57. ultraPaceTime.innerHTML= (ppb*0 + 1)? ppb.toFixed(2):'0.00';
  58. ultraPacePieces.innerHTML= (scorePace*0 + 1)? scorePace.toFixed(0):'0';
  59. }
  60.  
  61. queueBoxFunc = trim(paces.toString()) + trim(queueBoxFunc);
  62. Game['prototype']["updateQueueBox"] = new Function(queueBoxFunc);
  63.  
  64. function afterReadyGoFunction() {
  65. //console.log(this['pmode'])
  66. if (this['pmode'] == 5) {
  67. ultra_pace.style.display = "block"
  68. } else {
  69. ultra_pace.style.display = "none"
  70. }
  71. }
  72.  
  73. var readyGoFunc3 = Game['prototype']['startPractice'].toString()
  74. var params5 = getParams(readyGoFunc3)
  75. readyGoFunc3 = trim(readyGoFunc3) + trim(afterReadyGoFunction.toString())
  76. Game['prototype']['startPractice'] = new Function(...params5, readyGoFunc3);
  77.  
  78. //}
  79.  
  80. });
  81. })();