daily pastebin goal
45%
SHARE
TWEET

Minimal Tetris Friends - Results Fix

a guest May 22nd, 2014 211 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 26 March 2014 v2.10
  10. // @author knux
  11. // ==/UserScript==
  12. addEventListener("DOMContentLoaded",
  13. function(){
  14. var gameNameStr = "", gameWidth, gameHeight, gameURL;
  15. if(location.href.indexOf("Ultra") != -1)
  16. {
  17. gameNameStr = "Ultra";
  18. gameWidth = 760;
  19. gameHeight = 560;
  20. gameURL = "http://tetrisow-a.akamaihd.net/data4_0_0_1/games/Ultra/OWGameUltra.swf?version=3";
  21. }
  22. if(location.href.indexOf("Sprint") != -1)
  23. {
  24. gameNameStr = "Sprint";
  25. gameWidth = 760;
  26. gameHeight = 560;
  27. gameURL = "http://tetrisow-a.akamaihd.net/data4_0_0_1/games/Sprint/OWGameSprint.swf?version=3";
  28. }
  29. if(location.href.indexOf("Live") != -1)
  30. {
  31. gameNameStr = "Live";
  32. gameWidth = 946;
  33. gameHeight = 560;
  34. gameURL = "http://www.tetrisfriends.com/data/games/Live/OWGameTetrisLive.swf?livebust=0165?version=0";
  35. }
  36. setTimeout(gamePrerollComplete, 1000);
  37. var bodyStr = '<object type="application/x-shockwave-flash" allowscriptaccess="always" data="' + gameURL + '" width="' + gameWidth + '" height="' + gameHeight + '" id="contentFlash" style="visibility: visible;">' +
  38. '<param name="wmode" value="window">' + document.getElementsByName("flashvars")[0].outerHTML +
  39. '<param name="quality" value="low">' +
  40. '</object>';
  41. document.head.innerHTML = '<link rel="stylesheet" href="http://tetrisow-a.akamaihd.net/data4_0_0_1/stylesheets/combined.min.css" type="text/css" media="screen"><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>';
  42.  
  43.  
  44. if(gameNameStr == "Live")
  45. {
  46. startScript = document.createElement("script");
  47. startScript.innerHTML =
  48. '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();'
  49. document.body.appendChild(startScript);
  50.     document.body.innerHTML = bodyStr;
  51. } else {
  52.     document.body.innerHTML = '<div id="wrapper" style="top:40px;"><div id="container"><div id="game_container" class="game_container">' + bodyStr + '</div></div></div>';
  53. }
  54. })
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