Hello
I use this script to filter the hospital to online/idle ppl that have revives enabled. But theres two issues with it.
1 is that it only work properly if u click from last person to top person
2 is that it doesnt filter out ppl that have early discharge
Can someonee kindly fix these two issues.. thanks
Also I am on torn pda in case its important.
// ==UserScript==
// @name Remove Revives Below X%
// @namespace http://tampermonkey.net/
// @version 1.0
// @description try to take over the world!
// @author You
// @match https://www.torn.com/hospital*
// @grant none
// ==/UserScript==
(function () {
"use strict";
setInterval(() => {
let minChance = localStorage.getItem("RRBX_chance") || 80;
if (!document.querySelector(".rrbx")) {
document.querySelector("#top-page-links-list").appendChild(
Object.assign(document.createElement("button"), {
innerHTML: "% Setting",
className: "rrbx t-clear h c-pointer m-icon line-h24 right last",
onclick: () => {
minChance = parseFloat(prompt("Minimum revive chance to keep?", minChance))
localStorage.setItem("RRBX_chance", minChance);
},
})
);
}
let rows = document.querySelectorAll(".revive > li")
rows.forEach((row) => {
if(row.querySelector("a.reviveNotAvailable")) row.remove()
else if (row.querySelector("#iconTray > li").title.includes("Offline")) row.remove()
})
let rev = document.querySelectorAll("div.ajax-action");
if (!rev.length) return;
rev.forEach((el) => {
let succ = el.querySelector("b").textContent.replace("%", "");
if (parseFloat(succ) > minChance) return;
el.closest("li").remove();
});
}, 100);
})();