Arcanum AutoTreat

It clicks the Treat Ailments button every 1s (if it is enabled) and drains your mana down to stamToKeep% (adjust stamToKeep for a different amount). Based on lulero's AutoFocus script.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         Arcanum AutoTreat
// @version      0.12
// @author       Yoyó
// @description  It clicks the Treat Ailments button every 1s (if it is enabled) and drains your mana down to stamToKeep% (adjust stamToKeep for a different amount). Based on lulero's AutoFocus script.
// @match        http://www.lerpinglemur.com/arcanum/
// @match        https://game312933.konggames.com/gamez/0031/2933/*
// @namespace    https://greasyfork.org/users/390287
// ==/UserScript==

var stamToKeep = 85;

var autofocus = window.setInterval(function(){

    let focusXpath="//div[@class='main-actions']//button[text()='Treat Ailments']";
    let focusBtn = document.evaluate(focusXpath, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
    if(!focusBtn.disabled){
        let stamXpath="//div[@class='vitals']//table[@class='bars']//div[@class='stamina']//span[@class='bar-text']";
        let stamText = document.evaluate(stamXpath, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
        let stamValues = stamText.textContent.split("/");
        let currentStam = parseFloat(stamValues[0]);
        let maxStam = parseFloat(stamValues[1]);
        let stamToSpend = currentStam - maxStam*stamToKeep/100;
        while (stamToSpend > 0.1) {
            focusBtn.click();
            stamToSpend = stamToSpend - 0.2;
        }
    }

},1000);