Minimal Tetromino Friends: Reducing lag as much as possible

Started by morningpee, December 21, 2013, 09:08:38 AM

Previous topic - Next topic

SirJeivus

I saw this thread a while ago but didn't try out the Adblock Plus until last week. I have to say it made huge changes with my TF performance. I was able to break my TF sprint record by more than a second thanks to you, so I wanted to give you my formal thanks.

32.22s to 31.19!


morningpee

#16
New version released today (2.10)!  The update now includes:
• Minimal versions of Ultra and Sprint
• Opera support

Quote from: SirJeivus
I saw this thread a while ago but didn't try out the Adblock Plus until last week. I have to say it made huge changes with my TF performance. I was able to break my TF sprint record by more than a second thanks to you, so I wanted to give you my formal thanks.

32.22s to 31.19!
Glad it worked out for you!

FelipeMayrink

Quote from: morningpee
New version released today (2.10)!  The update now includes:
• Minimal versions of Ultra and Sprint
When I finish a game of Sprint or Ultra I get this:
[!--ImageUrlBegin--][a href=\\\"http://i.imgur.com/iXE3IAV.png\\\" target=\\\"_new\\\"][!--ImageUrlEBegin--][img width=\\\"400\\\" class=\\\"attach\\\" src=\\\"http://i.imgur.com/iXE3IAV.png\\\" border=\\\'0\\\' alt=\\\"IPB Image\\\" /][!--ImageUrlEnd--][/a][!--ImageUrlEEnd--]


Though when playing and when I load the page it works fine. Help? Or do I actually need to manually refresh the page?

morningpee

#18
Quote from: FelipeMayrink
When I finish a game of Sprint or Ultra I get this:
Though when playing and when I load the page it works fine. Help? Or do I actually need to manually refresh the page?
Tetris Friends still records your game, so if you get a daily or all-time high score, it will save it.  MTF's next update will add the replayer back in after the game finishes, though you do get a blank page for now.

djackallstar

#19
Quote from: morningpee
New version released today (2.10)!  The update now includes:
• Minimal versions of Ultra and Sprint
• Opera support
Environment
OS: Debian Sid
Browser: Iceweasel 24.4.0
Script Manager: Scriptish 0.1.11

Bug Reports
1. gamePrerollComplete is not defined.
[!--ImageUrlBegin--][a href=\\\"http://i.imgur.com/E5zRqJD.png\\\" target=\\\"_new\\\"][!--ImageUrlEBegin--][img width=\\\"400\\\" class=\\\"attach\\\" src=\\\"http://i.imgur.com/E5zRqJD.png\\\" border=\\\'0\\\' alt=\\\"IPB Image\\\" /][!--ImageUrlEnd--][/a][!--ImageUrlEEnd--]


The script stops there.
I changed setTimeout(gamePrerollComplete, 1000); to the following in order for the script to work:

            for (var i=0; i<3; i++) {
                try {
                    setTimeout(function() {
                        unsafeWindow.document.getElementById("contentFlash").style.visibility="visible";
                        unsafeWindow.document.getElementById("contentFlash").as3_prerollDone();
                    }, 1000)
                } catch(e) {};
            }


2. The key binding to restart the game doesn't work now.
This is my previous code to restart the game with the "q" key:

unsafeWindow.document.getElementById('contentFlash').onkeydown=function(evt){if(evt.keyCode==81){evt.preventDefault(); unsafeWindow.document.getElementById("contentFlash").as3_tetrisGameRestart();}};

I inserted it directly into the bottom of MTF and it doesn't work.
Not sure why, because unsafeWindow.document.getElementById('contentFlash') isn't null.

Feature Requests
1. Instead of adding the replay player back, would you please add a flag in the script for the user to choose between 'show the replay player' and 'continue the next game without asking'? I'm kinda lazy to click the 'play again' button every time I finish a sprint, and due to my crappy Internet connection, refreshing the page is a little bit too slow.
.

Aaron

[div align=\\\"center\\\"]
Quote from: AlexandraI don't really know much about hot dogs but I do know Aaron is the greatest moderator ever.
[/div]

Blink


jkwon23

I cut 2 seconds off my sprint time!

32.?? - > 30.64

Thanks, morningpee!


unpronuncyashun2

This actually helps quite a lot, my pieces stopped teleporting and I made way less MDs than vanilla TF. Thanks morningpee  

Donorgyll

Userscripts is down at the moment, is it possible for you to re-host it somewhere else? I would really appreciate it!

djackallstar

Quote from: Donorgyll
Userscripts is down at the moment, is it possible for you to re-host it somewhere else? I would really appreciate it!

One can still access USO thru port 8080.

http://userscripts.org:8080/scripts/source/186531.user.js
.

morningpee

Quote from: Donorgyll
Userscripts is down at the moment, is it possible for you to re-host it somewhere else? I would really appreciate it!
Sure.  The links should work now, or click here.

Quote from: djackallstar
One can still access USO thru port 8080.

http://userscripts.org:8080/scripts/source/186531.user.js
Nifty!

pwn_by_numbers

I did a quick hack that makes the results page show up for Sprint and Ultra, it doesn't look very pretty though. (Looks like the styling depends on some elements that were removed, I tried to fix it, but didn't have much luck.)

http://pastebin.com/zbEsDNVU

djackallstar

#28
Quote from: pwn_by_numbers
I did a quick hack that makes the results page show up for Sprint and Ultra ...
Just compiled an incomplete but more thorough list of swf files to be included in MTF.

Note that the NBlox swf doesn't work.


var href = location.href;
var game_swf = '';
if(/\bSprint\b/.test(href)) { game_swf = "http://tetrisow-a.akamaihd.net/data4_0_0_1/games/Sprint/OWGameSprint.swf?version=3"; }
else if(/\bLive\b/.test(href)) { game_swf = "http://www.tetrisfriends.com/data/games/Live/OWGameTetrisLive.swf?livebust=0165?version=0"; }
else if(/\bUltra\b/.test(href)) { game_swf = "http://tetrisow-a.akamaihd.net/data4_0_0_1/games/Ultra/OWGameUltra.swf?version=3"; }
else if(/\bMarathon\b/.test(href)) { game_swf = "http://tetrisow-a.akamaihd.net/data4_0_0_1/games/Marathon/OWGameMarathon.swf?version=3"; }
else if(/\bMono\b/.test(href)) { game_swf = "http://tetrisow-a.akamaihd.net/data4_0_0_1/games/Mono/OWGameColorBlind.swf?version=3"; }
else if(/\bSurvival\b/.test(href)) { game_swf = "http://tetrisow-a.akamaihd.net/data4_0_0_1/games/Survival/OWGameSurvival.swf?version=3"; }
else if(/\bNBlox\b/.test(href)) { game_swf = "http://tetrisow-a.akamaihd.net/data4_0_0_1/games/NBlox/nbloxWebsite.swf?version=3"; } // doesn't work
else if(/\bBattle2P\b/.test(href)) { game_swf = "http://tetrisow-a.akamaihd.net/data4_0_0_1/games/Battle2P/OWGameBattle2pMaps.swf?version=0"; }
else if(/\bBattle6P\b/.test(href)) { game_swf = "http://tetrisow-a.akamaihd.net/data4_0_0_1/games/Battle6P/OWGameBattle6P.swf?version=0"; }
else if(/\bRally8P\b/.test(href)) { game_swf = "http://tetrisow-a.akamaihd.net/data4_0_0_1/games/Rally8P/OWRally8P.swf?version=0"; }
else if(/\bSprint5P\b/.test(href)) { game_swf = "http://tetrisow-a.akamaihd.net/data4_0_0_1/games/Sprint5P/OWGameSprint5p.swf?version=0"; }
else { game_swf = document.getElementsByTagName('OBJECT')[0].data; }
.

djackallstar

userscripts.org is completely down, but fortunately someone has set up a mirror site. To download morningpee's script, visit http://userscripts-mirror.org/scripts/show/186531.html
.