您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Highlights weapon slot when enemy HP is below % threshold - configurable
当前为
// ==UserScript== // @name Attack Percentage Notifier - modded for easier configuration // @namespace https://torn.com/ // @version 0.2 // @description Highlights weapon slot when enemy HP is below % threshold - configurable // @author Null[2042113] - mod by GFOUR // @match https://www.torn.com/loader.php* // @run-at document-idle // @grant GM_getValue // @grant GM_setValue // ==/UserScript== (function() { 'use strict'; // Default: 60% if not set before let target_health_percent = GM_getValue("target_health_percent", 0.6); console.log("[Attack % Notifier] Current threshold: " + (target_health_percent * 100) + "%"); function doShit() { let health_arr = document.querySelectorAll('[id^=player-health-value]'); if (!health_arr || health_arr.length < 2) return; let current = health_arr[1].innerText.split("/")[0].replace(/,/g,''); let max = health_arr[1].innerText.split("/")[1].replace(/,/g,''); if (parseInt(current) / parseInt(max) <= target_health_percent) { let weapon = document.getElementById('weapon_second'); if (weapon) weapon.style.background = 'red'; } } setInterval(doShit, 500); // Optional: Allow changing value via console without editing script window.setAttackThreshold = function(percent) { GM_setValue("target_health_percent", percent); console.log("[Attack % Notifier] Threshold updated to " + (percent * 100) + "%"); }; })();