Approved : Battle Report Enhancer (BRE) - version 2

Discussion in 'Scripts & independent tools' started by cheesasaurus, Jul 3, 2011.

Share This Page

  1. cheesasaurus

    cheesasaurus <img src="

    Jul 26, 2009
    Likes Received:
    What this does:
    Enhances the page with tools and extra information

    1) Configure display. Unchecked boxes will not be displayed in the display area.
    2) Export links to "attack again with the same troops"

    you can copy the BB code text presented to create links in the notebook

    or copy the HTML text presented into a new html file

    most browsers can read this file and create bookmarks from it
    (screenshot from internet explorer)
    3) Report display. Shows extended information about reports that were renamed by the BRE.
    4) Report selector bar.
    - select all reports
    - deselect all reports
    - select green-dotted reports
    - select yellow-dotted reports
    - select red-dotted reports
    - select blue-dotted reports
    - select forwarded reports
    - select reports where the attacking troops did not haul to their full abilities
    - select reports where the attacking troops did haul to their full abilities
    - select reports where the attacker only sent a small army
    - select reports where an attacking nobleman died
    - select reports where the defender's loyalty decreased
    - select reports where the defender has no remaining units stationed in their village
    - select reports where the report name contains user-specified text
    - select reports with a user-specified attacker
    - select reports with a user-specified defender
    - select reports with a user-specified attacking village
    - select reports with a user-specified defending village
    5) Mass Renamer. This will rename all selected reports to a format readable by the BRE
    6) Symbols.
    grey dot - signifies that the attack only had a small amount of troops
    cross - signifies that an attacking nobleman died. If it was your nobleman, you can click the cross and you'll be taken to his village's academy, where you can educate another one.
    crown - signifies that an attacking nobleman successfuly lowered the defending village's loyalty
    7) links to "attack again with the same troops"
    The axe on the left links to the screen where you can "attack again with the same troops" from your current village.
    The axe on the right links to the screen where you can "attack again with the same troops" from the original attacking village.
    Extra information will be added to the report:
    *remaining defense
    *population summary
    *time the attacker launched the attack
    *time the attacking troops return
    *Opponents Defeated information
    *Predicted Loyalty (@current time, and @time of arrival if you were to send a noble from your current village)
    *JSON representation of the report, to copy somewhere for other scripts to use (hint hint. I might be planning something :icon_cool:)
    Tools will be added, above the report:
    *raiding calculator
    *report renamer
    *demolition suggestions (first row is to demolish the scouted buildings, second row is to demolish scouted buildings + 1 upgrade)
    note: the 'send troops' link only links to the rally point. The script won't do the dirty work for you :p
    -Siege damage is now incorporated when determining remaining building levels.
    -uses a different renamer (renames reports to be interpreted and then presented by the BRE)
    -also works with classic graphics enabled
    The script:
    javascript:$.getScript('');void 0;

    current version: 2.2_08
    game compatibility: version 17647 8.11

    This is supported for the latest versions of the following browsers:
    -Internet Explorer

    note: some features are only available for premium accounts
    A look to the future:

    Version 2 focuses on improving reports folders. Version 3 will focus on improvement of sharing reports with tribemates. But until then...

    -improved visuals for tools included while viewing a report
    -use localStorage instead of cookies
    -defense summary column(s)
    -selector option: by defense summary attribute
    -configure display: vertical scroll [on|off]
    to do
    license information:
    /*    twcheese_BRE.js
     *    Battle Reports Enhancer
     *    version 2.0
     *    game compatability: version 12761 7.2
     *    market: uk
     *    author Nick Toby (
     ==== when viewing a report ====
     *    use script on: game.php?screen=report&view=x (a report)
     *    effect: include some extra features on the page:
        -loyalty calculations
        -raiding calculator
        -demolition calculator
        -remaining defense
        -opponents defeated
        -population summary
        -timing summary
        -twcheese's json encoded representation of the report (for copy+pasting somewhere that other scripts would interpret it)
        -renamer (limit of 256 characters?)
     ==== when viewing the reports folder, with the 'Attacks' or 'Defenses' filter on ====
     *    use script on:    game.php?screen=report&mode=attack || game.php?screen=report&mode=defense
     *    effects:
            -include some extra features on the page:
                - selector bar (has options to select reports based on various criteria)
                - mass renamer (renames all selected reports to a format readable by the BRE)
                - extended report information (information displayed can be customized to the user's preferences)
                - links to "attack again with the same troops"
                - text that can be copied to create "attack again with the same troops" links that can be saved in notebook or bookmarked in browser;
    *    todo:
            -fix layout problem with "defense remaining" headers
            -fix layout problem with scrolling (happens when columns are hidden)
     ==== license ====
     *    Copyright (C) 2011  Nick Toby
        This program is free software: you can redistribute it and/or modify
        it under the terms of the GNU General Public License as published by
        the Free Software Foundation, either version 3 of the License, or
        (at your option) any later version.
        This program is distributed in the hope that it will be useful,
        but WITHOUT ANY WARRANTY; without even the implied warranty of
        GNU General Public License for more details.
        You should have received a copy of the GNU General Public License
        along with this program.  If not, see
    GNU General Public License
    Last edited by a moderator: Jul 7, 2015
  2. SlowTarget

    SlowTarget Guest

    Approved - Cheeseasaurus' Battle Report Evaluator 2 - 13/07/2011

    Please can you simplify the caller routine - the default behaviour of getScript is to tag the resource being fetched with a random number, so you don't have to.

    Do you need to provide a credit to fluffy for the report filtering idea? If not why not, or did I miss it?

    Other than that it looks fine.

    As a development could you add a third row to the demolition table for the numbers needed to completely destroy a building?
    Also the text 'defenseless' could be replaced by a greyed out support symbol - similar to the way villages with no resources are represented with a greyed out resources symbol.
    I think the way you have the wall levels displayed is great. How about something similar for remaining troops? A support icon in the header and a number with 1 d.p. representing the number of complete defences remaining in the village.

    Thanks for a great post and a great script.
    Last edited by a moderator: Jul 13, 2011
  3. cheesasaurus

    cheesasaurus <img src="

    Jul 26, 2009
    Likes Received:
    Ah, I didn't know that. Thanks :)

    But I don't want it reloaded every time. I want the browser to read it from cache (very important) and reload it once a week (not so important to me personally, but helpful to those players who have low computer-literacy or don't check forums for updates). I've modified the launcher: it doesn't use the jquery getScript and is a bit more lengthy now.

    one week = 7 days
    7 days = 168 hours
    168 hours = 10080 minutes
    10080 minutes = 604800 seconds
    604800 seconds = 604800000 milliseconds
    the expression Math.floor((new Date()).valueOf()/604800000) will change its result once every week.

    I yearned for report queries years ago. I'm sure I'm not the first person that had the need to search for reports based on specific criteria and I doubt fluffy was either (not saying that the BRE anywhere near fills those needs, but it's a step closer for this server. On I sent reports to my own database using a script and just queried on my server when needed.) I didn't use his code and if it shares similarities, its purely by coincidence. But I'll throw in some recognition for his awesome folder add-on: It looked awesome! Fluffy inspired me to present the query feature as a toolbar that checkmarks results instead of hiding non-results.

    The first row is supposed to show the amount of siege to send to destroy the detected levels completely (assuming the village is undefended) and the second row is supposed to show the amount of siege to send to destroy detected levels, that might have been upgraded, completely. I haven't yet used the BRE in gameplay since I designed it to aid in managing large accounts and I haven't really played since its release - so if this isn't working correctly, I need to fix it. But from the testing I did, it suggests the correct numbers. If I've misunderstood what you want, just beat me over the head with it until it sinks in. I can be dull at times lol.

    I prefer symbols to words when possible. Thargoran had mentioned the possibility of hosting some small icons and sprites for scripts. Would this still be an option?

    Remaining troops in defender's village are already a display option - so a summary column will be trivial to add in.
  4. BangersNMash

    BangersNMash Guest

    Awesome tool Cheese! just a quick one, how do you go about editing what you want included in the "renamed reports", as the drop down options from version 1 are not present now.

    At the moment i got the following output: twCheese: Jackcrop (490|459,2487)---(490|456,2745)_t:1310935751. _d[0,0,0,0,0,0,0,0,0,0,0,0] _b[1,0,0,0,0,0,0,0,1,0,0,7,7,6,1,4,1,0] _r[248,248,210]

    However i dont really want the building levels, troop numbers, attack id or seperate resource levels (just total).

    A pointer in the right direction will be appreciated, thanks

    Last edited by a moderator: Jul 17, 2011
  5. cheesasaurus

    cheesasaurus <img src="

    Jul 26, 2009
    Likes Received:

    I intentionally submitted this as a new thread instead of overwriting the old one because of the change in the renaming system. If you want it renamed the old way, use version 1.

    But... there should really be no need for the old version imo. Just click the 'configure display' tab that appears on the top of the reports display and uncheck anything that you don't want to see.

  6. Phlipster

    Phlipster Active Member

    Sep 16, 2009
    Likes Received:
    Epic cheese, just epic!!!
  7. SlowTarget

    SlowTarget Guest

    Thank you for the explanation - I can be a bit dull at times - sorry
    absolutely - not a problem.
    cool :)
  8. Mikek

    Mikek Member

    Sep 6, 2009
    Likes Received:
    hi - this has stopped working for me?

    have tried both opera and chrome but have the same output

  9. cheesasaurus

    cheesasaurus <img src="

    Jul 26, 2009
    Likes Received:
    renaming reports now uses "ajaxaction" instead of "action" as a parameter in the url. I've fixed this for the BRE and our host should update it soon.
  10. Dark Ryder

    Dark Ryder Guest

    I've got a question Cheese?

    Maybe I'm been stupid, but how do I use the html format, to import the bookmarks/favourites into a browser,

    Cause currently I don't have a clue how to create a new html file.

    Oh and by the way a very IMPRESSIVE Script
  11. cheesasaurus

    cheesasaurus <img src="

    Jul 26, 2009
    Likes Received:
    Most operating systems come with some type of word processor. In windows you can open up notepad, paste the text into it, and choose "save as"

    choose the type all files (*.*)

    and when you name the file end it with .html
  12. Dark Ryder

    Dark Ryder Guest

    Wow thank you so much Cheese!

    Could I be cheeky and ask is there any way of getting the script to export the repeat attack links as co-ordinates of the village that the attack is been sent to.

    The reason for this is, cause when I farm I tend to name my bookmarks by co-ords, so if A farm gets taken I can easily delete it from my bookmarks with the "ctrl + f" function.

    Thanks for your help
  13. cheesasaurus

    cheesasaurus <img src="

    Jul 26, 2009
    Likes Received:
    So the bookmark would be named, something like this?

    Repeat Attack 123456 from (500|500) to (501|502)

    I can do that.

    edit: and I did
    Last edited: Aug 24, 2011
  14. Dark Ryder

    Dark Ryder Guest

    I was thinking more along the lines of Repeat Attack to (501|502)

    But your way does that too, once again cheese thanks for your work!

  15. onetruth

    onetruth Guest

    This really does look impressive, great job.
  16. zarddeath200

    zarddeath200 Guest

    make it show attacking and defending village IDs.
  17. SlowTarget

    SlowTarget Guest

    Why do you want it to show those id's? I'm sure it can be easily done, but it might happen sooner if cheese can see why its wanted.

    I'd like to be able to remove those horizontal and vertical scrollbars that took such effort to add ... can that be an option in the configure display dialog? Its fine on the laptop but on my big screen it's like looking at reports through a postage stamp sized window.

    Some more information highlighted 'above the fold' when looking at attack reports would be good too ... distance, losses, original troops and send again links etc - ie. just the info you want to see when farming.
  18. zarddeath200

    zarddeath200 Guest

    I'm using it in conjunction with some other tools, and him giving village IDs (which are already in the BRE renamed report) lets me not have to download world data to farm.
  19. megaduu

    megaduu Guest

    Me too [​IMG]
  20. Zarkov

    Zarkov Guest

    Sorry Cheesasaurus This is not working properly on V8 UK11.

    When i click to rename the reports i get this error on Opera 11.6

    error renaming report:
    TypeError: Cannot convert 'this.espionageTable.rows[3].getElementsByTagName('table')[0]' to object

    In IE i get

    error renaming report:
    TypeError: Unable to get value of teh property 'rows': object is null or undefined

    Hope you can resolve mate.