Hover Tenacity Breakdown Utility Script Request

« Back to Developers

2214 days, 0 hours, 37 minutes ago
View mjs68508's profile
mjs68508
Hover Tenacity Breakdown Utility Script RequestWrite Reply
If any of the script writers are looking for a quick project that will bring fame and adulation (grin) from the VGAP.nu community, I suggest the following script project. I think it would be an easy one compared to the more complicated ones out there:

We have a page on the Leadership page that shows the people with top 100 tenacity and their breakdowns. We have our own tenacity on our personal History page, but it is not broken down. Looking at the page source for our history page, it seems that a script could be made that (if you know how to do the API calls):

When you hover the mouse over your tenacity rating, a tool tip opens up (hover text) that shows the breakdown (the 3 numbers that are multiplied together to get the final tenacity).

Please, please, please, grovel, grovel, grovel.

Mike, the hopeful
2212 days, 11 hours, 9 minutes ago
Profile Image
kedalion
RE: Hover Tenacity Breakdown Utility Script RequestWrite Reply
I tried to look into it, but it appears that the tenacity code is not on test.planets.nu yet. That is my source for un-minimized (readable) code. Once I can see such a version, it should be easy.
2212 days, 10 hours, 28 minutes ago
View big beefer's profile
big beefer
RE: Hover Tenacity Breakdown Utility Script RequestWrite Reply
I think you just need to basically do the following. Haven't actually tried to make it work, but you can find the 3 tenacity components in the "account" objects. If kedalion doesn't get to it first, I might take a look.

var old_showHistory = ViewOfficers.prototype.showHistory;
ViewOfficers.prototype.showHistory = function (screen, officer) {
old_showHistory.apply(this, arguments);
var account = nu.getAccount(officer.username);
// At this point you should be able to pull the 3 components from the account
// var and display them as you like
// .finishtenacity
// .turntenacity
// .replacementtenacity
}


2212 days, 10 hours, 17 minutes ago
Profile Image
kedalion
RE: Hover Tenacity Breakdown Utility Script RequestWrite Reply
Yep, that's what I thought.

I was hoping to just replace the content current 'tenacity' cell with new text, but it doesn't have an ID to fetch it by. Naturally, I could just fetch the parent and then hope the next element continues to stay the tenacity entry.

The alternative would be to overload the function that actually fills in the whole cell. That's what I'd need the source for.
2212 days, 5 hours, 34 minutes ago
View big beefer's profile
big beefer
RE: Hover Tenacity Breakdown Utility Script RequestWrite Reply
Well, I made a quick and hacky version that just adds a tool-tip to the whole eaccountdata div. Not real glamorous, but seems to work (at least on firefox). Just hover the mouse anywhere near the tenacity rating on someone's "history" page and hopefully the tool-tip will pop up.

http://userscripts.org/scripts/show/173952


2212 days, 4 hours, 59 minutes ago
View mjs68508's profile
mjs68508
RE: Hover Tenacity Breakdown Utility Script RequestWrite Reply
Doesn't work with Chrome + Tampermonkey.

Veldan found out what Tampermonkey needs. See this thread, at the bottom, Veldan's posts:

http://planets.nu/discussion/utility-script-improvements-to-ship -list-display

He says:

But your include line is planets.nu/home/*, and should just be planets.nu/*. It won't work in chrome with tampermonkey. (It's what I did today to make it work, prior to that the script didn't work).
2212 days, 4 hours, 3 minutes ago
Profile Image
kedalion
RE: Hover Tenacity Breakdown Utility Script RequestWrite Reply
Beefer is actually using the right include tags. It's just not working with tampermonkey. Yes, including planets.nu/* will work, but you will keep getting error messages on any part of the old website.

It appears that the problem is tampermonkey not liking the '#' in include tags...
2212 days, 0 hours, 58 minutes ago
View veldan's profile
veldan
RE: Hover Tenacity Breakdown Utility Script RequestWrite Reply
Thanks Beefer! Gives me an idea of what I need to work on.
2211 days, 12 hours, 36 minutes ago
View figak's profile
figak
RE: Hover Tenacity Breakdown Utility Script RequestWrite Reply
Thank you for this, very useful.

Could it be expanded to also give information on the officer rank of a profile? Or would that be a separate Script?

At the moment we see under http://planets.nu/#/account/*/officers

For each race in order of higer rank:

Left side:

Rank + Name
Race
Month Start

Right side:
Turns played total
Achievement points total

I miss this information:

Achievement increment since last run

Total and last increment of:
Experience
Sunk tonage
Capured tonage
Defenses destroyed

More importantly: What is the ranking of this officer

Finally a reminder of what is the gap for the next officer rank.

This could be displayed partly as hover box or filling the white space in the middle of each officer "row".
2210 days, 0 hours, 45 minutes ago
View big beefer's profile
big beefer
RE: Hover Tenacity Breakdown Utility Script RequestWrite Reply
Mjs, give the new version 0.3 a shot. I haven't actually installed chrome/tampermonkey to see, but if the # was the problem, maybe it works now? Also, I notice on my system it often doesn't work the first time I go to a profile. But if I refresh the page it seems to work OK. Not sure why that is, but might try that too.

Figak, I'll take a look at that... sometime... unless Kedalion or somebody would like to first. I think it would be best as a separate script since it would work on different pages.
2210 days, 0 hours, 45 minutes ago
View big beefer's profile
big beefer
RE: Hover Tenacity Breakdown Utility Script RequestWrite Reply
Mjs, give the new version 0.3 a shot. I haven't actually installed chrome/tampermonkey to see, but if the # was the problem, maybe it works now? Also, I notice on my system it often doesn't work the first time I go to a profile. But if I refresh the page it seems to work OK. Not sure why that is, but might try that too.

Figak, I'll take a look at that... sometime... unless Kedalion or somebody would like to first. I think it would be best as a separate script since it would work on different pages.
2209 days, 23 hours, 56 minutes ago
View mjs68508's profile
mjs68508
RE: Hover Tenacity Breakdown Utility Script RequestWrite Reply
Nope. 0.3 doesn't work. Right now, I have 3 others and they work:

1. improved hover text
2. enemy ship list plug in
3. territory map plug in
2209 days, 17 hours, 42 minutes ago
View veldan's profile
veldan
RE: Hover Tenacity Breakdown Utility Script RequestWrite Reply
Wow, Mike was right about my little finding working for chrome + tampermonkey. I tried monkeying with the script, but the only include line that works is '// @include http://planets.nu/*'.

I tried several other combos to get it to be more specific (like what you were doing beefer), but the only way I got the script to run is with that (more generic) include line. I'm not too sure if it may interfere with other scripts.

As a side question, is it possible to see what games are being included in your calculations? I have a hunch that rescue factor is not being calculated correctly. I should have 5 games that qualify for the bonus being factored in, but it seems that only 2 are. This may require a separate query page I guess...
2209 days, 16 hours, 28 minutes ago
View figak's profile
figak
RE: Hover Tenacity Breakdown Utility Script RequestWrite Reply
Thanks for considering it Big Beefer, I like to research my opponents and at the moment the info is all over the place.
2209 days, 9 hours, 13 minutes ago
View big beefer's profile
big beefer
RE: Hover Tenacity Breakdown Utility Script RequestWrite Reply
OK, one more try to get it to work with this dang tampermonkey. I've posted version 0.4, which uses the super generic include lines. I also tried to put in a test to see if we're on a history page, and not bother to do anything if not. Anyways, hopefully it will work.

Veldan, I don't actually calculate anything in this script. I just display some data that was already computed and available. I don't think there is public info on which games are being included in your tenacity score. Or at least I haven't seen it.
2209 days, 8 hours, 30 minutes ago
Profile Image
kedalion
RE: Hover Tenacity Breakdown Utility Script RequestWrite Reply
Just updated in tampermonkey and it works.

And yes, there is no detailed information available yet as to what goes into these scores.
2209 days, 5 hours, 29 minutes ago
View mjs68508's profile
mjs68508
RE: Hover Tenacity Breakdown Utility Script RequestWrite Reply
Yup. Version 0.4 Works fine in Chrome/Tampermonkey.

Thanks.
2209 days, 5 hours, 21 minutes ago
View mjs68508's profile
mjs68508
RE: Hover Tenacity Breakdown Utility Script RequestWrite Reply
Although, it only works with my own stats. That is all I really wanted (when I wasn't in the top 100).

But, the final stat is on other people's pages. So, as possibly an exercise into the possible, I wonder if it could be done to look at anyone's breakdown?
2206 days, 4 hours, 57 minutes ago
View emork the lizard king's profile
emork the lizard king
RE: Hover Tenacity Breakdown Utility Script RequestWrite Reply
Hi Big B,

I have installed version 0.4 on Windows 7 with the newest Firefox 22.0.
I don't see a tool tip when hovering over my or someone other's tenacity rating on the history page.
Any idea?

Greetings, Emork

2206 days, 4 hours, 26 minutes ago
View veldan's profile
veldan
RE: Hover Tenacity Breakdown Utility Script RequestWrite Reply
I run into this from time to time Emork, usually a ctrl + F5 resolves it... not optimal, but it works.
2205 days, 18 hours, 48 minutes ago
View emork the lizard king's profile
emork the lizard king
RE: Hover Tenacity Breakdown Utility Script RequestWrite Reply
Thx Veldan, this has helped. I also found out that I have to move the mouse pointer a bit right of the percentage display to make the tool tip appear.
2205 days, 18 hours, 48 minutes ago
View emork the lizard king's profile
emork the lizard king
RE: Hover Tenacity Breakdown Utility Script RequestWrite Reply
And thx, Big B, for another helpful add-on.
2205 days, 18 hours, 26 minutes ago
View sjharley's profile
sjharley
RE: Hover Tenacity Breakdown Utility Script RequestWrite Reply
off topic so apologies but I can find no way to message players in the new system outside of the game - but Emork I just wanted to thankyou for your help in our recently completed campaign, without your sage advice the crystals would've had me in a tight spot. Apologies I dind't get a chacne to say thanks in game as I was on holiday and access was limited !
2205 days, 17 hours, 25 minutes ago
View emork the lizard king's profile
emork the lizard king
RE: Hover Tenacity Breakdown Utility Script RequestWrite Reply
Hi SJ, yeah, we were a good team. Thx for that and c u again in space!

To send a personal message to a player you have to access his profil via the old site - quite laborious.