Misc NARR - Nineza's Awesome Report Renamer

DeletedUser110650

Guest
Author
Nineza
Contributors
N/A
Quickbar Entry
javascript: var format = "{DefName} {DefCoord} [{DefTroopsRemain}] Wall: {Wall}";
void($.getScript("http://pastebin.com/raw.php?i=TcBzhfKF", function(){ rename(format); }));
Public?
Public
Again, not really my idea (for the name)... Nineza is the name I tend to use for my usernames nowadays, but this account doesn't have that name.

Uh... Yeah. It's a report renamer. It should work... hasn't been tested extensively, but definitely works somewhat...

The tags:
{ReportID} - Report ID (e.g. 12221212)
{AtkName} - Attacker's Player Name (e.g. Nineza)
{AtkID} - Attacker's Player ID (e.g. 111223)
{AtkCoord} - Attacker's Village Coords (e.g. 555|444)
{AtkVilName} - Attacker's Village Name (e.g. 001)
{AtkVilID} - Attacker's village ID (e.g. 1221)
{AtkVilK} - Attacker's K/continent (e.g. K53)
{DefName} - Defender's Player Name (e.g. Throne3d)
{DefID} - Defender's Player ID (e.g. 222113)
{DefCoord} - Defender's Village Coords (e.g. 444|555)
{DefVilName} - Defender's Village Name (e.g. 002)
{DefVilID} - Defender's village ID (e.g. 2112)
{DefVilK} - Defender's K/continent (e.g. K51)
{Distance} - Distance between attacker and defender (e.g. 156.98)
{Resources} - Resources of the defending village (e.g. Wood:397400 Clay:397400 Iron:397440)
{Wood} - Wood of the defending village (e.g. 397400)
{Clay} - Clay of the defending village (e.g. 397400)
{Iron} - Iron of the defending village (e.g. 397440)
{AtkTroopsOriginal} - Attacker's original troops (e.g. Scouts:50 LC:25)
{AtkTroopsLoss} - Attacker's troop loss (e.g. Scouts:1 LC:3)
{AtkTroopsRemain} - Attacker's remaining troops (e.g. Scouts:49 LC:22)
{DefTroopsOriginal} - Defender's original troops (e.g. Spears:5 Scouts:10)
{DefTroopsLoss} - Defender's troop loss (e.g. Spears:5 Scouts:8)
{DefTroopsRemain} - Defender's remaining troops (e.g. Scouts:2)
{Cleared} - Whether the defender was cleared (e.g. Cleared; e.g. [blank])
{%Lost} - The percentage of troops the attacker lost (e.g. 5.3%)
{%Killed} - The percentage of troops the defender lost (e.g. 86.7%)
{%Hauled} - The percentage of resources taken versus those left in village (e.g. 0.1%) 1760/1192240
{%OfHaul} - The percentage hauled of maximum possible to haul with remaining troops (e.g. 100%)
{Wall} - The level of the wall (after the attack) (e.g. 2)
{Loyalty} - The loyalty of the defending village (after the attack, if visible) (e.g. 56 or ?)

The script
Code:
javascript: var format = "{DefName} {DefCoord} [{DefTroopsRemain}] Wall: {Wall}"; 
void($.getScript("http://pastebin.com/raw.php?i=TcBzhfKF", function(){ rename(format); }));

(It's been minified... so it looks ugly...)

Instructions
1. Copy the script somewhere (e.g. notepad).
2. Change the "format" variable as you please (the bit inside the quote marks after "var format = ") for what to rename the reports to.
3. Open up the reports (this thingy doesn't use AJAX itself, I'm afraid, so you'll have to open each report individually) - I suggest you use something like Opera Snaplinks to do this...
4. Run the script (from bookmark, quick-bar or console...).
5. See the report having been renamed (hopefully)

Extra notes
Uh... If you come across any bugs or issues or errors, please notify me of them! If it's due to it just not functioning, please open your console and then re-run it (Ctrl+Shift+I in Opera and Chrome... I assume the same for other browsers, otherwise F12 then Console?)...
If you wish for a feature to be added (such as another tag), go ahead and ask - I'll see if I can add it.

Changelog
1.0.1 - Updated to function on the beta world (or at least... function better), and added loyalty tag.
1.0.0 - First release? Seems to work... has quite a few tags for you to use...
 
Last edited by a moderator:
Upvote 0

NightWitch1

Guest
a nice renamer, i still had a old one who i could use. still this one works faster, the tag i would like to have added is the remaining troops outside the village


from my old script it was the tag
{outside troops}
 

Falcoskater

Guest
A tag for the loyalty of the village would be amazing... please and thank you
 

DeletedUser110650

Guest
Ok, I've updated it to have a loyalty tag, and it should be able to detect the wall and leftover resources levels with the new beta report layout as well. Unfortunately I don't currently seem to have access to any reports with outside troops scouted, so I can't add that tag, but if someone could make a report public and link me to it (probably via PM), that would definitely help. In the meantime I'll try to get a hold of one. (The world(s) I play on either don't have outside troop espionage or have 150% rules, meaning I can't get a hold of a report like that very easily)

... It's only been tested on the beta world with this release, so it may not work properly with regular worlds, but it definitely should. Do notify me if there are any errors though (and please do Ctrl+Shift+I and tell me if any errors appear there too).
 

DeletedUser

Guest
Is this an Approved Script? Shouldn't be a problem right?

Got the answer to my question when I checked the heading properly. Nevermind.

# What if I wanted to calculate and show the number of LC required to clear the outstanding resources in the village?

# Is this anyway to make this script work on the reports page rather than one report itself?
 
Last edited by a moderator:

Ibra Gonza II

Non-stop Poster
Reaction score
140
Is this an Approved Script? Shouldn't be a problem right?

Got the answer to my question when I checked the heading properly. Nevermind.

# What if I wanted to calculate and show the number of LC required to clear the outstanding resources in the village?

That is possible to make, depends if OP still works on the script. If not, I might take a chance to add it.

# Is this anyway to make this script work on the reports page rather than one report itself?

Possible, yes. But not legal. So we won't do it :D
 

DeletedUser

Guest
That is possible to make, depends if OP still works on the script. If not, I might take a chance to add it.

Possible, yes. But not legal. So we won't do it :D

Do post it here when you do. Its handy for players during startup who want to maximise efficiency.

Why is the second bit not legal? If you're allowed to Mass Rename Villages, Commands, Why not Reports?
 

Ibra Gonza II

Non-stop Poster
Reaction score
140
Why is the second bit not legal? If you're allowed to Mass Rename Villages, Commands, Why not Reports?

When renaming villages/commands you don't request data from other pages. And just rename them.

To rename a report, you need the data IN the report to rename it. So you need to make a request (fetch) for that data without being on the page.
I am not 100% sure about .net, but on most TW versions that is not allowed to do.
 

twenty-five

Guest
I can think of one script (fairly widely used, but broken now I believe) that did rename reports like that (infact it did a lot more with the data also) https://forum.tribalwars.net/showthread.php?256225-Battle-Report-Enhancer Script was used with a lot of languages (look at the bottom) so I would have thought such behaviour this was legal on most/all servers.

Requesting data without being on the page is legal on .net for sure anyway, I've had my scripts approved that do such things.. (Including several years ago one that did do things with reports).
 

DeletedUser

Guest
That would be really good then. Any WORKING scripts out there that do what I need them? :D I keep searching but come up with nothing.
 

Ibra Gonza II

Non-stop Poster
Reaction score
140
Since OP seems inactive I'll start work on the small modifications. Will let you know when finished.

If OP were to come online he can contact me here so I can hand over the project. (I obviously do not want to 'steal' his hard work)
 

Ibra Gonza II

Non-stop Poster
Reaction score
140
Haven't had much time yet, so added just the LC thingy you requested

Code:
javascript: var format = "{DefName} LC: {Farm} [{DefTroopsRemain}] Wall: {Wall}"; void($.getScript("https://dl.dropbox.com/s/hol0dhadhckmu32/reportrename.js", function(){ rename(format); }));

So I basically just added the {Farm} tag which will show you the amount of LC needed to clear the village. I'll have a look at the 'rename all reports' option later :)
 

DeletedUser110650

Guest
I'm responding a bit late here, but sure, feel free to screw around with my code. Attribution would be nice but that's basically the only requirement.

(I don't even recall writing this script, completely, so I have no idea if or how it still works. I'm probably not the best for consulting if you do get stuck, but I might be available to help.)
 

Debb123

Guest
Mods is this OK to use.. (Been away from the game for 4 years.. do not need trouble. lol )

Therefore before i even copy it.. I am asking.
 
Top