Advertisement
Guest User

Untitled

a guest
Sep 19th, 2019
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.64 KB | None | 0 0
  1. // ==UserScript==
  2. // @name Jstris Mods
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description try to take over the world!
  6. // @author You
  7. // @match https://*.jezevec10.com/*
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. 'use strict';
  13. window.addEventListener('load', function(){
  14. if(typeof Game != "undefined"){
  15. if(typeof trim != "function"){var trim=a=>{a=a.slice(0,-1);a=a.substr(a.indexOf("{")+1);return a}}
  16.  
  17. document['addEventListener']('keydown', press);
  18. document['addEventListener']('keyup', press);
  19.  
  20. function press(e) {
  21. if(document.getElementById("lrem").innerText <= 0){alert('win');}
  22. if(~Game['set2ings'].indexOf(e.keyCode)){
  23. var corresponding = [6,8,1,2,3,5,4,0][Game['set2ings'].indexOf(e.keyCode)]
  24. document.getElementsByClassName("kbkey")[corresponding].style.backgroundColor = ["lightgoldenrodyellow",""][+(e.type=="keyup")]
  25. }
  26. }
  27. var kbhold=document.createElement("div");
  28. kbhold.id="keyboardHolder";
  29. kbhold.style.position="absolute"
  30. kbhold.style.left = (myCanvas.getBoundingClientRect().left - 300) + "px";
  31. kbhold.style.top = (myCanvas.getBoundingClientRect().top + 100) + "px";
  32. document.body.appendChild(kbhold);
  33.  
  34. var f='<R>M{text-align:center;position: absolute;font-size:15px`{]-Q:QIspacing:0;Nred`td|th|Uwp8o_000000;]:inherit`UT_34ff34`Ujy2k_f8a102`UO_f8ff00;}</RYbo"Yps"KPJV"Ptr^Tq180~TqSD~TqHDZ[CCWZXtr^OqHL~OqCWZ[&lt;[v[&gt;X/JK>~</td^|{padding:10px 5pxIR:solidIwidth:2px`q kbkey">`;}M.tg _{]-N#^PtdV-]border[~jy2kqZ~wp8o">YPdiv id="kX</tdP/trPV class="tgU.tg-Ttc3eRstyleQcollapseP><Op39mNcolor:M#kbo KP/divJtableI;]-';var g=0;var i=0;for(i in g='IJKMNOPQRTUVXYZ[]^_`q|~')var e=f.split(g[i]),f=e.join(e.pop())
  35. keyboardHolder.innerHTML = f
  36.  
  37. var set2ings = Game['prototype']['readyGo'].toString()
  38. set2ings = "Game['set2ings']=this.Settings.controls;" + trim(set2ings)
  39. Game['prototype']['readyGo'] = new Function(set2ings);
  40.  
  41. var updateTextBarFunc = Game['prototype']['updateTextBar'].toString()
  42. updateTextBarFunc = trim(updateTextBarFunc) + ";kps.innerHTML='KPS: '+(this.getKPP()*this.placedBlocks/this.clock).toFixed(2)"
  43. Game['prototype']['updateTextBar'] = new Function(updateTextBarFunc);
  44.  
  45.  
  46.  
  47. if(typeof trim != "function"){var trim=a=>{a=a.slice(0,-1);a=a.substr(a.indexOf("{")+1);return a}}
  48. if(typeof getParams != "function"){var getParams=a=>{var params=a.slice(a.indexOf("(")+1);params=params.substr(0,params.indexOf(")")).split(",");return params}}
  49. if(typeof Game != "undefined"){
  50.  
  51. var aliveHold=document.createElement("div");
  52. aliveHold.id="aliveHolder";
  53. aliveHold.style.position="absolute"
  54. aliveHold.style.left = (myCanvas.getBoundingClientRect().left - 200) + "px";
  55. aliveHold.style.top = (myCanvas.getBoundingClientRect().top + 400) + "px";
  56. document.body.appendChild(aliveHold);
  57.  
  58. var f='<div id="lrem"><div id="aliveNum"></div></div><div id="sprintText"><div id="stLrem" style="display: block;">opponents remaining</div></div>'
  59. aliveHolder.innerHTML = f
  60. aliveHolder.style.display='none'
  61.  
  62. var printAlive = SlotView['prototype']['printSlotPlace'].toString()
  63. var printAliveParams = getParams(printAlive);
  64. printAlive = `aliveHolder.style.display='block';aliveNum.innerHTML=parseInt(this['slot']['gs']['p']['getPlaceColor'](${printAliveParams[0]})['str'])-1;` + trim(printAlive)
  65. SlotView['prototype']['printSlotPlace'] = new Function(...printAliveParams, printAlive);
  66.  
  67. var readyGoAlive = Game['prototype']['restart'].toString()
  68. readyGoAlive = "if(this['pmode']+this['isPmode'](true)+this['isPmode'](false)==0){aliveHolder.style.display='block';aliveNum.innerHTML='all'};" + trim(readyGoAlive)
  69. Game['prototype']['restart'] = new Function(readyGoAlive);
  70.  
  71. }
  72.  
  73. }});
  74. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement