Hold Stat Script

Shows how often hold was used

当前为 2019-07-22 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Hold Stat Script
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description Shows how often hold was used
  6. // @author Oki
  7. // @match https://*.jstris.jezevec10.com/*
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. /**************************
  12. Hold Stat Script
  13. **************************/
  14.  
  15.  
  16. (function() {
  17. window.addEventListener('load', function(){
  18.  
  19. var STAT_POS = 970;
  20.  
  21. if(typeof trim != "function"){var trim=a=>{a=a.slice(0,-1);a=a.substr(a.indexOf("{")+1);return a}}
  22.  
  23. var readyGoFunc = Game['prototype']["startReadyGo"].toString()
  24. var holdBlockFunc = GameCore['prototype']['holdBlock'].toString()
  25.  
  26. readyGoFunc = "holdStat=0;this['GameStats'].addStat(new StatLine('HOLD_FREQ', 'Hold', "+STAT_POS+"),true);" + trim(readyGoFunc)
  27. holdBlockFunc = "if(!this['holdUsedAlready']&&this['holdEnabled']){holdStat++};if(this['GameStats'].get('HOLD_FREQ'))this['GameStats'].get('HOLD_FREQ').set(holdStat);" + trim(holdBlockFunc);
  28.  
  29. Game['prototype']["startReadyGo"] = new Function(readyGoFunc);
  30. GameCore['prototype']['holdBlock'] = new Function(holdBlockFunc);
  31.  
  32. });
  33. })();