r/TagPro•
DatBlizzard

[Userscript Update] TagPro Scoreboard Enhancer: Now can prevent the scoreboard order from moving around while open and continue to show players who left the game

Small update to the scoreboard enhancer. Pressing shift+esc to open the scoreboard will put in a static mode meaning that while scores and stats will continue to update, the names will not shuffle around. It's main use is for reporting so you can more easily click the correct name without the scoreboard moving around right as you try to click.

I also added something to keep players who left the game on the scoreboard. A blank line is added below the regular scoreboard and then any players who were in the game but left are added below this. For the time being, this is off by default just because it's' really ugly right now. To enable it, just open up the script, scroll down a bit or ctrl+f for keepTrackOfLeftPlayers, and change it's value to true to enable it. Hopefully I'll get around to making it prettier in which case I'll enable it by default.

Scripts in Tampermonkey usually autoupdate within 24 hours. But if you want to update now, use this link to directly install: https://gist.github.com/SomeBall-1/a28d36aa02c672604f82/raw/TagPro%2520Scoreboard%2520Enhancer.user.js

Or view the script here: https://gist.github.com/SomeBall-1/a28d36aa02c672604f82

As always, if you catch any bugs or have a good idea on something to add then let me know and I'll see what I can do. Last version of the script can be found here.

Posted Oct 16, 2015, 2:50 AM UTC

228
IupvotestupidCRAPRighty | Centra•

Oh my god, this was so annoying in the previous versions. Thank you for the update!

3
ElbwanaGoofy Goober | Centra •

Nice work! I love all the sleight changes that improve the game so much. Playing vanilla tagpro is not worth it anymore

1
HelplessMooseHelplesMoose (please raise the limit on nick length) // Chord•

Any chance for Firefox/GreaseMonkey compatibility? The @grants cause the script to be sandboxed, which means it can't access tagpro and $ directly...

1
DatBlizzardOPSome Ball -1•

Is that the only reason it doesn't work in Firefox? The grant stuff isn't necessary, it's only in there to keep the scoreboard sorted in the same way across multiple games.

Alternatively, if you change every instance of tagpro to window.tagpro and $ to window.$ will that work? I'm not familiar with the extent of the sandboxing. Actually you may be able to test real quick by adding this.tagpro = window.tagpro and this.$ = window.$ up near the top of the script.

1
HelplessMooseHelplesMoose (please raise the limit on nick length) // Chord•

Based on skimming over the code, I'd say that it's the only reason, yes.

The window object is actually a wrapper in Greasemonkey, not the normal window object. There's unsafeWindow, which gives direct access to the normal window, but as the name suggests, it is (or can be) insecure. (Namely, using it can give the website's JavaScript code access to privileged resources such as the GM_* APIs or even files.)

I'm not really sure what The Right Way™ to use both the GM_* functions and page variables is. There are solutions involving window.eval or using script injection combined with timeouts, but both seem very ugly to me.

I've tried removing the GM_* calls and replacing the @grants by a @grant none, which means that the script is executed in the page context and therefore can access the variables normally. This is not really a full solution of course since some functionality is lost, but that functionality isn't too important for me, so I'd be fine with this.

I guess I screwed up somewhere along the path since sorting doesn't work now. Also, the scoreboard header is shifted to the right. It could also be an interaction with a different script. I'll try debugging this a bit further.

1
DatBlizzardOPSome Ball -1•

I made this real quick: http://pastebin.com/raw.php?i=MhDZXrAf. Haven't tested it but hopefully it works.

1
HelplessMooseHelplesMoose (please raise the limit on nick length) // Chord•

Sorry, with the event going on, I totally forgot to look at this further...

I diff'd this against my version and the code is identical. The header shift was caused by #mapInfo's float: left, so I fixed that with a userstyle. Also, sorting actually works fine; it's just quite slow, so I thought at first that nothing happened at all...

Thanks for the script and your support! :-)

1
nabbynznabby • diameter•

I found there was basically 2 things needed...

Gotta get jQuery externally...

// @require http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js

And redefine the tagpro object...

var tagpro = unsafeWindow.tagpro;

Most of the ones I tested worked fine after this.

1