Doobie's Hospital Attack Button Bypass Script

Enables attack button even if the target is in the hospital and changes icon to red

Per 13-11-2024. Zie de nieuwste versie.

// ==UserScript==
// @name         Doobie's Hospital Attack Button Bypass Script
// @namespace    http://tampermonkey.net/DoobiesHospitalBypass
// @version      1.0
// @description  Enables attack button even if the target is in the hospital and changes icon to red
// @match        https://www.torn.com/profiles.php*
// @grant        none
// ==/UserScript==

(function(){
    'use strict';
    window.onload=function(){
        let attackButton=document.querySelector('.profile-button-attack.disabled');
        if(attackButton){
            attackButton.classList.remove('disabled');
            attackButton.classList.add('active');
            attackButton.style.pointerEvents='auto';
            attackButton.style.opacity='1';
            attackButton.setAttribute('aria-label','Attack (Bypass Hospital Restriction)');
            let svgIcon=attackButton.querySelector('svg');
            if(svgIcon){
                svgIcon.style.filter='none';
                svgIcon.style.fill='#cf3b13';
            }
            attackButton.addEventListener('click',function(e){
                e.preventDefault();
                window.location.href=attackButton.getAttribute('href');
            });
        }
    };
})();
//Made with Love by DoobieSuckin [3255641]