SHARE
TWEET

Untitled

a guest Oct 15th, 2014 288 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name Minimal Tetris Friends
  3. // @namespace minimaltetrisfriends
  4. // @description /Reduces lag as much as possible by removing everything from the page except for the games themselves.
  5. // @include http://*tetrisfriends.com/games/Ultra/game.php*
  6. // @include http://*tetrisfriends.com/games/Sprint/game.php*
  7. // @include http://*tetrisfriends.com/games/Live/game.php*
  8. // @grant none
  9. // @version 15 October 2014 - pwn_by_numbers fix
  10. // @author knux
  11. // ==/UserScript==
  12. function minimalTF(){
  13.     var gameNameStr = "", gameWidth, gameHeight, gameURL;
  14.     if(location.href.indexOf("Ultra") != -1)
  15.     {
  16.         gameNameStr = "Ultra";
  17.         gameWidth = 760;
  18.         gameHeight = 560;
  19.         gameURL = "http://tetrisow-a.akamaihd.net/data4_0_0_1/games/Ultra/OWGameUltra.swf?version=3";
  20.     }
  21.     if(location.href.indexOf("Sprint") != -1)
  22.     {
  23.         gameNameStr = "Sprint";
  24.         gameWidth = 760;
  25.         gameHeight = 560;
  26.         gameURL = "http://tetrisow-a.akamaihd.net/data4_0_0_1/games/Sprint/OWGameSprint.swf?version=3";
  27.     }
  28.     if(location.href.indexOf("Live") != -1)
  29.     {
  30.         gameNameStr = "Live";
  31.         gameWidth = 946;
  32.         gameHeight = 560;
  33.         gameURL = "http://www.tetrisfriends.com/data/games/Live/OWGameTetrisLive.swf?livebust=0165?version=0";
  34.     }
  35.     setTimeout(gamePrerollComplete, 1000);
  36.     var bodyStr = '<object type="application/x-shockwave-flash" allowscriptaccess="always" data="' + gameURL + '" width="' + gameWidth + '" height="' + gameHeight + '" id="contentFlash" style="visibility: visible;">' +
  37.         '<param name="wmode" value="window">' + document.getElementsByName("flashvars")[0].outerHTML +
  38.         '<param name="quality" value="low">' +
  39.         '</object>';
  40.     document.head.innerHTML = '<style> body { background: url(http://tetrisow-a.akamaihd.net/data4_0_0_1/images/bg.jpg) repeat-x; font-family: "Trebuchet MS",Helvetica,Tahoma,Geneva,Verdana,Arial,sans-serif; font-size: 12px; color: #666; margin: 0; text-align: center; display: block; } object { margin: 20px; }* { margin: 0; padding: 0; outline: none; -moz-box-sizing: border-box; box-sizing: border-box; } </style>';
  41.     document.body.innerHTML = bodyStr;
  42.    
  43.     if(gameNameStr == "Live")
  44.     {
  45.         startScript = document.createElement("script");
  46.         startScript.innerHTML =
  47.             'var sArenaTimes = 5; function startArena(){if(contentFlash.TotalFrames){try{contentFlash.style.visibility="visible"; contentFlash.as3_prerollDone();}catch(err){}}else{setTimeout(startArena, 1000); return}; sArenaTimes--; setTimeout(startArena, 1000)}; startArena();';
  48.         document.body.appendChild(startScript);
  49.     }
  50. };
  51. if (document.readyState == "interactive") {
  52.     minimalTF();
  53. } else {
  54.     addEventListener("DOMContentLoaded", minimalTF, false);
  55. }
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
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top