SHARE
TWEET

Untitled

a guest May 19th, 2019 79 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name         T99 Script
  3. // @namespace    http://tampermonkey.net/
  4. // @version      0.1
  5. // @description  try to take over the world!
  6. // @author       You
  7. // @match        https://*.jstris.jezevec10.com/*
  8. // @grant        none
  9. // ==/UserScript==
  10.  
  11. (function() {
  12.     'use strict';
  13.  
  14.  
  15.     window.addEventListener('load', function(){
  16.  
  17.         //Jstris Custom Background Image
  18.         document.head.getElementsByTagName("style")[0].innerHTML="";
  19.         document.body.style.backgroundImage="url('https://media.discordapp.net/attachments/360554528556449795/361706190406680576/d29d4205-1f9e-4c85-8a5b-3f573e55b5f4.png')";
  20.         document.body.style.backgroundSize="100%";
  21.         document.getElementById("app").style.backgroundColor="rgba(0, 0, 0, 0)";
  22.         document.getElementById("app").style.height="1000px";
  23.  
  24.                //Jstris SFX
  25.         CustomSFXset.prototype = new BaseSFXset;
  26.         loadSFX(new CustomSFXset);
  27.  
  28.         function CustomSFXset(){
  29.     this.volume=1;
  30.     this.lock={url:"https://ecdldaiiere.github.io/Eddiez-Soundz/t99lock.wav",abs:1};
  31.     this.ready={url:"https://ecdldaiiere.github.io/Eddiez-Soundz/t99ready.wav",abs:1,set:1};
  32.     this.go={url:"https://ecdldaiiere.github.io/Eddiez-Soundz/t99go.wav",abs:1,set:0};
  33.     this.died={url:"https://ecdldaiiere.github.io/Eddiez-Soundz/t99died.wav",abs:1,set:1};
  34.     this.hold={url:"https://ecdldaiiere.github.io/Eddiez-Soundz/t99hold.wav",abs:1,set:0};
  35.     this.move={url:"https://ecdldaiiere.github.io/Eddiez-Soundz/t99move.wav",abs:1,set:0};
  36.     };
  37.         //Jstris Block Skin Change
  38.         loadSkin("https://i.imgur.com/G6WbXoD.png",32);
  39.  
  40.  
  41.         /**************************
  42.   Special Events Script
  43. **************************/
  44.  
  45. Game["clearSounds"] = [
  46.     "https://ecdldaiiere.github.io/Eddiez-Soundz/t99_clear1.wav",
  47.     "https://ecdldaiiere.github.io/Eddiez-Soundz/t99_clear1.wav",
  48.     "https://ecdldaiiere.github.io/Eddiez-Soundz/t99_clear1.wav",
  49.     "https://ecdldaiiere.github.io/Eddiez-Soundz/t99_clear2.wav",
  50.     "https://ecdldaiiere.github.io/Eddiez-Soundz/t99_clear2.wav",
  51.     "https://ecdldaiiere.github.io/Eddiez-Soundz/t99_clear3.wav",
  52.     "https://ecdldaiiere.github.io/Eddiez-Soundz/t99_clear3.wav",
  53.     "https://ecdldaiiere.github.io/Eddiez-Soundz/t99_clear4.wav",
  54.     "https://ecdldaiiere.github.io/Eddiez-Soundz/t99_perfectclear.wav"
  55. ];
  56.  
  57. var events = ["TSPIN_SINGLE","TSPIN_MINI_SINGLE","CLEAR1","TSPIN_DOUBLE","CLEAR2","TSPIN_TRIPLE","CLEAR3","CLEAR4","PERFECT_CLEAR"]
  58.  
  59. Game["pieceSounds"] = [];
  60.  
  61. if(typeof playSound != 'function') {
  62.     window.playSound = function(s){!s.paused&&0<s.currentTime?s.currentTime=0:s.play()}
  63. }
  64.  
  65. Game["clearSounds"].map((x,i)=>{
  66.     Game["pieceSounds"].push(document.createElement("audio"));
  67.     Game["pieceSounds"][i].src = x;
  68.     Game["pieceSounds"][i].volume = .5;
  69. })
  70.  
  71. var replacedFunc = Game['prototype']['checkLineClears'].toString()
  72.  
  73.  
  74. for (var i = 0; i < events.length; i++) {
  75.     var insert = "Game['clearSounds']["+i+"]?playSound(Game['pieceSounds']["+i+"]):8>"+i+"&&playSound(Game['pieceSounds'][2*(0|("+i+"+2)/2)]);"
  76.     replacedFunc = replacedFunc.replace(events[i]+")",events[i]+");" + insert)
  77. }
  78.  
  79. replacedFunc = replacedFunc.slice(0,-1)
  80. replacedFunc = replacedFunc.substr(replacedFunc.indexOf("{")+1)
  81.  
  82. Game['prototype']["checkLineClears"] = new Function(replacedFunc);
  83.  
  84.         });
  85. })();
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top