I loved how you used to be able to tag people by their difficulty (green, yellow, or red). Really helped to keep track of who you can beat and who can beat you. If you do implement this, I would only suggest that you add more tags; i. e. light green, dark green, yellow, orange, light red, dark red, etc.
[script] War Base Filters
Started by tos [1976582] on in Tutorials & Guides.
Posts archived: 52 / 52 posts (100%) · the total is Torn's reply count + the opening post at the last fetch
I loved how you used to be able to tag people by their difficulty (green, yellow, or red). Really helped to keep track of who you can beat and who can beat you. If you do implement this, I would only suggest that you add more tags; i. e. light green, dark green, yellow, orange, light red, dark red, etc.
but that would be unfair for color blind people, use difficulty rating instead ranging from 1 to 10
I am aware of the issue with the "Territories on top" check box being checked and unchecked by local storage settings as it should but not applying on page load. I have a fix for it ready but no war base to test it on :(
If anyone has both territory and respect wars open and would like to test it for me I can release the update sooner.
In the old script it was easy enough to add your own tags. If/when he re-adds this functionality I'll post an explanation on how to add more difficulties.
Was still undecided on if I wanted to do that or make it a standalone script. Working tonight but I will find you on discord this week and ask about it ;)
Thank you. The script is fantastic, and if you end up adding the difficulty rating it will be leagues ahead of the old one.
Filter container can now be collapsed and added difficulty selectors only red, yellow and green for now. I felt more would just be clutter but it wouldn't be hard to do...
thanks!! love the new filter
Awesome job! Is there a way you can add "In hospital" to the hide menu?
http://puu.sh/wIMpF/a881be1ea5.png
Shows only users with hospital times under two minutes, I assume 0.1 would also work.
As promised, an explanation on how to edit the default difficulties is here!
You'll scroll down to lines 190-194, which will show this:
difficulty_select.innerHTML = `
Select Difficulty
Easy
Med
Hard`
What you'll want to do is add further options to this dropdown list. The only one that absolutely has to stay as it is would be the initial option, so that people are not automatically tagged before you know their difficulty.
For example, I already had custom tags set up through the old War Base Extended script, which I will list here for your convenience.
var TAGS = { // Feel free to add additional tags as needed.
tbd: {text: 'Difficulty', color: 'inherit'},
easy: {text: 'Easy', color:'rgba(161, 248, 161, 1)'},
moderate: {text: 'Moderate', color:'rgba(153, 255, 102, 1)'},
medium: {text: 'Medium', color:'rgba(231, 231, 104, 1)'},
hard: {text: 'Hard', color:'rgba(255, 153, 51, 1)'},
impossible: {text: 'Impossible', color:'rgba(242, 140, 140, 1)'}
};
Unfortunately, the old tags use RGBA and the new tags use Hex. Not to worry, we have an rgb to hex converter available for our use. We'll simply discard the '1' at the end since that's not terribly important for what we are doing.
We will enter the values left to right into the website, and the website will spit out a hex code that we will use soon, so write them down.
I typed in red: 161, green: 248, blue: 161 and was given #A1F8A1. It also shows you what the color looks like. Write down the following so we know what tag it's for:
Easy: #A1F8A1
We will do this for every tag first, so we have all the data available when we go to edit the new script. Once we have done that, then we will add to the list.
difficulty_select.innerHTML = `
Select Difficulty
Easy`
The option tag creates a dropdown entry. The value, in this case, determines the cell's color. And the text in between the > and the backticks (aka the ` mark). This is necessary so that the whole list is considered to be a single entity, otherwise you won't get your whole list of tags.
I have added a guide on how to add and edit difficulties to TornStats, please upvote if it's helpful or mail me if you need help.
Torn Warbase Filter - Difficulty Editing
Ok that'll do :D
Not sure if anyone has brought this to your attention yet. But it seems the Difficulty drop down bar goes away if too many icons are next to a players name.
[image: image.ibb.co]
Yeah, someone did. Unfortunately don't have a war base atm to test it. Can try changing it to "difficulty" instead of "select difficulty" when I get home and see if that does it.
I've updated the difficulty selectors to None -> Easy -> Med -> Hard in an effort to keep it short for now. Will look at it further when I have a war base again.
Another great update - thanks.
Posted an update, any difficulties you had set before are no longer set. If there is a need for it I can make something to transfer them into the new format. The filters that were in the "hide" section before are now in the show section. Their function has been inverted so you will likely need to flip all check boxes except hosp/jail and level. And speaking of hosp/jail jail check box is gone entirely.
-Click the little red bar-
Edit: Background behind chain icon is gone in favor of a purple color on the faction name similar to a visited link. Also to ease loading all factions, when extended option is on the factions no longer expand they are only added to the warbase extended wrap.
In case of confusion with the update, make your check boxes look like this then play with it:
[image: i.imgur.com]
For those that are installing the script for the first time this will be the default, otherwise your settings are already in local storage and will be loaded from there.
Seems the recent update caused some confusion. Sent a further update that will clear your stored filter settings and set them to the new defaults. Also added chain icon fade back as a color blind option.