Doobie's Hospital Attack Button Bypass Script

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

当前为 2024-11-13 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==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]