Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Faction Hospital - Edited (Also hides offliners)
- // @namespace http://tampermonkey.net/
- // @version 1.4.1
- // @description Shows only faction members that are in the hospital and online, and hides the rest.
- // @author muffenman and help from Pi77Bull
- // @match https://www.torn.com/factions.php?step=profile&ID=*
- // @grant none
- // @run-at document-end
- // ==/UserScript==
- // What does this script do?
- // It hides all members on faction pages that are not in the hospital and displays the hospital time for those who are.
- $( ".faction-description" ).css("display", "none", "traveling"); //hides faction description
- $( "#war-react-root" ).css("display", "none"); //hides faction war list
- $('.member-list #icon2').parents("li").hide(); //hides offliners
- $('.member-list #icon62').parents("li").hide(); //hides idles
- $('.member-list > li:not(:contains("Hospital"))').css("display", "none"); //hides every member that is not in hospital
- $('.member-list > li:contains("Hospital")').each((i, j) => { //loops through every member that is in hospital
- $(j).find(".days").text($(j).find("#icon15").attr("title").substr(-16, 8)); //displays time that is found in the hospital icon
- var hours = Number($(j).find("#icon15").attr("title").substr(-16, 2)); //> Substr out the hours and convert to Int.
- if (hours <= 1) {
- $(j).css("display", "none"); //> Don't display users with less than an hour in the hospital.
- }
- $(".title .days").text("Time"); //changes Days column title to "Time"
- });
- //console.log("Made by muffenman [2002712] and Pi77Bull [2082618] . If you like it, send us a message or a gift either is fine :P \"I love your script!\".");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement