Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Jstris Mods
- // @namespace http://tampermonkey.net/
- // @version 0.1
- // @description try to take over the world!
- // @author You
- // @match https://*.jezevec10.com/*
- // @grant none
- // ==/UserScript==
- (function() {
- 'use strict';
- window.addEventListener('load', function(){
- if(typeof Game != "undefined"){
- if(typeof trim != "function"){var trim=a=>{a=a.slice(0,-1);a=a.substr(a.indexOf("{")+1);return a}}
- document['addEventListener']('keydown', press);
- document['addEventListener']('keyup', press);
- function press(e) {
- if(document.getElementById("lrem").innerText <= 0){alert('win');}
- if(~Game['set2ings'].indexOf(e.keyCode)){
- var corresponding = [6,8,1,2,3,5,4,0][Game['set2ings'].indexOf(e.keyCode)]
- document.getElementsByClassName("kbkey")[corresponding].style.backgroundColor = ["lightgoldenrodyellow",""][+(e.type=="keyup")]
- }
- }
- var kbhold=document.createElement("div");
- kbhold.id="keyboardHolder";
- kbhold.style.position="absolute"
- kbhold.style.left = (myCanvas.getBoundingClientRect().left - 300) + "px";
- kbhold.style.top = (myCanvas.getBoundingClientRect().top + 100) + "px";
- document.body.appendChild(kbhold);
- 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[<[v[>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())
- keyboardHolder.innerHTML = f
- var set2ings = Game['prototype']['readyGo'].toString()
- set2ings = "Game['set2ings']=this.Settings.controls;" + trim(set2ings)
- Game['prototype']['readyGo'] = new Function(set2ings);
- var updateTextBarFunc = Game['prototype']['updateTextBar'].toString()
- updateTextBarFunc = trim(updateTextBarFunc) + ";kps.innerHTML='KPS: '+(this.getKPP()*this.placedBlocks/this.clock).toFixed(2)"
- Game['prototype']['updateTextBar'] = new Function(updateTextBarFunc);
- if(typeof trim != "function"){var trim=a=>{a=a.slice(0,-1);a=a.substr(a.indexOf("{")+1);return a}}
- if(typeof getParams != "function"){var getParams=a=>{var params=a.slice(a.indexOf("(")+1);params=params.substr(0,params.indexOf(")")).split(",");return params}}
- if(typeof Game != "undefined"){
- var aliveHold=document.createElement("div");
- aliveHold.id="aliveHolder";
- aliveHold.style.position="absolute"
- aliveHold.style.left = (myCanvas.getBoundingClientRect().left - 200) + "px";
- aliveHold.style.top = (myCanvas.getBoundingClientRect().top + 400) + "px";
- document.body.appendChild(aliveHold);
- var f='<div id="lrem"><div id="aliveNum"></div></div><div id="sprintText"><div id="stLrem" style="display: block;">opponents remaining</div></div>'
- aliveHolder.innerHTML = f
- aliveHolder.style.display='none'
- var printAlive = SlotView['prototype']['printSlotPlace'].toString()
- var printAliveParams = getParams(printAlive);
- printAlive = `aliveHolder.style.display='block';aliveNum.innerHTML=parseInt(this['slot']['gs']['p']['getPlaceColor'](${printAliveParams[0]})['str'])-1;` + trim(printAlive)
- SlotView['prototype']['printSlotPlace'] = new Function(...printAliveParams, printAlive);
- var readyGoAlive = Game['prototype']['restart'].toString()
- readyGoAlive = "if(this['pmode']+this['isPmode'](true)+this['isPmode'](false)==0){aliveHolder.style.display='block';aliveNum.innerHTML='all'};" + trim(readyGoAlive)
- Game['prototype']['restart'] = new Function(readyGoAlive);
- }
- }});
- })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement