Melvoridle Helper

Auto loot, and auto eat food. For Melvor Idle 1.0

目前为 2021-11-22 提交的版本。查看 最新版本

// ==UserScript==
// @name         Melvoridle Helper
// @namespace    https://github.com/lovedzc/
// @version      1.001
// @description  Auto loot, and auto eat food. For Melvor Idle 1.0
// @author       lovedzc
// @match        https://www.melvoridle.com/index_noads.php
// @icon         https://www.google.com/s2/favicons?sz=64&domain=melvoridle.com
// @grant        none
// @license MIT
// ==/UserScript==

// 自动捡拾所有
function AutoLoot()
{
    try {
        var text = document.getElementById("combat-loot-text").innerText;
        var a = text.indexOf("(");
        var b = text.indexOf("/");
        var num = text.substr(a+1, b-a-1);
        if (num > 0){
            document.getElementById("combat-btn-loot-all").click();
        }
    } catch (Exception) {
    }
}

// 自动吃食物
function AutoEatFood()
{
    try {
        var sHPCur = document.getElementById("combat-player-hitpoints-current").innerText;
        var sHPMax = document.getElementById("combat-player-hitpoints-max").innerText;

        var HPCur = parseInt(sHPCur.split(",").join(""));
        var HPMax = parseInt(sHPMax.split(",").join(""));

        while (HPCur / HPMax <= 0.8){
            document.getElementsByClassName("btn btn-outline-secondary text-combat-smoke font-size-sm")[0].click();
        }
    } catch (Exception) {
    }
}

function main() {
    AutoLoot();
    AutoEatFood();
}

function init() {
    window.setInterval(main, 20000);
}

init();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址