Greasy Fork is available in English.

Melvor Idle Super Auto Eat

【Script outdated. Please use the official mod manager. Only keep the historical code for reference.】Only for Melvor Idle V1.0.5, a super auto eat system designed to free your hands, also works in offline mode thus you can save computer resources and electricity.

질문, 리뷰하거나, 이 스크립트를 신고하세요.
// ==UserScript==
// @name                  Melvor Idle Super Auto Eat
// @name:zh-CN            Melvor Idle 超级自动进食
// @version               1.0.6
// @description:zh-CN     【脚本过期失效,请使用官方模组管理器,仅保留历史代码供参考】仅适配Melvor Idle V1.0.5,既可作用于在线模式,又可作用于离线模式的超级自动进食系统,旨在解放双手,节约电脑资源及电费。
// @description           【Script outdated. Please use the official mod manager. Only keep the historical code for reference.】Only for Melvor Idle V1.0.5, a super auto eat system designed to free your hands, also works in offline mode thus you can save computer resources and electricity.
// @author                DreamNya
// @match                 *://melvoridle.com/*
// @match                 *://www.melvoridle.com/*
// @icon                  https://www.google.com/s2/favicons?sz=64&domain=melvoridle.com
// @grant                 GM_setValue
// @grant                 GM_getValue
// @license               MIT
// @namespace https://greasyfork.org/users/809466
// ==/UserScript==
/* eslint no-undef:0,no-eval:0,dot-notation:0,no-loop-func:0 */

//该脚本已失效,请使用官方模组管理器,仅保留历史代码供参考
//This script is outdated, please use the official mod manager, only keep the historical code for reference

(function () {
return 'Script outdated. Please use the official mod manager. Only keep the historical code for reference.'
    //compatible with non-tampermonkey version
    if (typeof GM_getValue == "undefined") {
        GM_getValue = function(key,defaultValue) {
            let value=JSON.parse(window.localStorage.getItem(key))
            return value || defaultValue
        }
    }

    if (typeof GM_setValue == "undefined") {
        GM_setValue = function(key,value) {
            window.localStorage.setItem(key,JSON.stringify(value))
        }
    }

    if (typeof unsafeWindow == "undefined") {
        unsafeWindow=window
    }
    const version = "v1.0.5 @2022.07.12"
    let PAGES_length
    let rawCode
    let codeInjected = false
    let Languages = ["zhCN", "English"]
    let Language
    let onlineMode = GM_getValue("onlineMode", false)
    let offlineMode = GM_getValue("offlineMode", false)
    let swapFood = GM_getValue("swapFood", false)
    let foodEfficiencys = [100, 80, 50]
    let foodEfficiency = GM_getValue("foodEfficiency", 100)
    let equipUnlockedFood = GM_getValue("equipUnlockedFood", false)
    let equipLockedFood = GM_getValue("equipLockedFood", false)
    let debugMode = GM_getValue("debugMode", false)
    let minThreshold = GM_getValue("minThreshold", 0)
    let autoLoot = GM_getValue("autoLoot", false)
    let rawCode_autoLoot
    let codeInjected_autoLoot = false
    let misae_version=GM_getValue("misae_version")

    ! function injectScript() {
        if (typeof isLoaded != "undefined" && isLoaded) {
            if (offlineMode) {
                injectCode()
            }
            if (autoLoot) {
                injectCode_autoLoot()
            }
            Language = GM_getValue("Language", setLang == "zh-CN" || setLang == "zh-TW" ? "zhCN" : "English")
            console.log(localization_minor[Language]["script-name"] + " version: " + version)
            injectMenu()

            if (misae_version != version){
                GM_setValue("misae_version", version)
                addModalToQueue({
                    title: localization_general[Language]["misae-update-title"],
                    imageUrl: "assets/media/shop/autoeat.svg",
                    imageHeight: 80,
                    imageWidth: 80,
                    html: localization_general[Language]["misae-update-html"],
                })
            }
        } else {
            setTimeout(injectScript, 50)
        }
    }()

    function injectCode() {
        if (!codeInjected) {
            rawCode = player.damage
            codeInjected = true
        }

        player.damage = function (amount, source, thieving = false, recordstat = true) {
            player.addHitpoints(-amount);
            player.splashManager.add({
                source: source,
                amount: -amount,
                xOffset: player.hitpointsPercent,
            });

            if (debugMode) {
                console.log("MISAE_log:player.hitpoints: " + player.hitpoints + " amount:" + amount);
            }
            let _minThreshold = minThreshold < player.stats.maxHitpoints ? minThreshold : player.stats.maxHitpoints-1
            if (player.stats.maxHitpoints > amount && ( player.hitpoints <= _minThreshold || player.hitpoints <= amount)) {
                const foodHealing = Math.floor(player.getFoodHealing(player.food.currentSlot.item) * foodEfficiency / 100);
                let foodQty = Math.max(Math.ceil((_minThreshold - player.hitpoints) / foodHealing) , Math.ceil((amount - player.hitpoints) / foodHealing));
                if (player.hitpoints < 1){
                    foodQty += 1
                }
                foodQty = Math.min(foodQty, player.food.currentSlot.quantity);
                if (debugMode) {
                    let debugText=localization_debug[Language]
                    console.log("MISAE_log:"+debugText["Current_Hitpoints"] + player.hitpoints + debugText["Damage_Taken"] + amount + debugText["Food_Healing"] + foodHealing + debugText["Eaten_Food_Quantity"] + foodQty+debugText["Minimum_Threshold"]+minThreshold);
                }
                player.eatFood(foodQty, false, foodEfficiency);
                if (player.food.currentSlot.quantity < 1 && swapFood) {
                    const nonEmptySlot = player.food.slots.findIndex((slot) => slot.item !== emptyFood);
                    if (nonEmptySlot >= 0) {
                        player.food.setSlot(nonEmptySlot);
                        if (player.hitpoints < 1) {
                            player.damage(-player.hitpoints + 1, source, thieving, false);
                        }
                    } else {
                        console.log("MISAE_log: nonEmptySlot == -1");
                        if (equipLockedFood || equipUnlockedFood) {
                            for (let bankItem of bank) {
                                if (((equipLockedFood == true && bankItem.locked == true) || (equipUnlockedFood == true && bankItem.locked == false)) && items[bankItem.id].healsFor > 0) {
                                    player.equipFood(bankItem.id, bankItem.qty);
                                    const _nonEmptySlot = player.food.slots.findIndex((slot) => slot.item !== emptyFood);
                                    const EmptySlot = player.food.slots.findIndex((slot) => slot.item === emptyFood);
                                    if (_nonEmptySlot >= 0) {
                                        player.food.setSlot(_nonEmptySlot);
                                        if (player.hitpoints < 1) {
                                            player.damage(-player.hitpoints + 1, source, thieving, false);
                                        }
                                    }
                                    if (EmptySlot < 0) {
                                        break;
                                    }
                                }
                            }
                        }
                    }
                }
            }

            if (player.hitpoints <= 0 && rollPercentage(player.modifiers.increasedRebirthChance)) {
                player.heal(player.stats.maxHitpoints);
            }
            player.rendersRequired.damageSplash = true;
            if (!thieving && recordstat) {
                player.manager.addMonsterStat(MonsterStats.DamageDealtToPlayer, amount);
                player.manager.addCombatStat(CombatStats.DamageTaken, amount);
                player.trackArmourStat(ItemStats.DamageTaken, amount);
            }
        }
    }

    function injectCode_autoLoot() {
        if (!codeInjected_autoLoot) {
            rawCode_autoLoot = game.combat.dropEnemyLoot
            codeInjected_autoLoot = true
        }
        unsafeWindow.eval(rawCode_autoLoot.toString().replace(/^(dropEnemyLoot)\(\)/,"this.$1=()=>").replace("this.player.modifiers.autoLooting","true").replace(/this/g,"game.combat"))
    }

    function disableOnline() {
        if (rawCode) {
            player.damage = rawCode
        }
    }

    function disable_autoLoot() {
        if (codeInjected_autoLoot) {
            game.combat.dropEnemyLoot = rawCode_autoLoot
        }
    }

    function injectMenu() {
        PAGES_length = Object.keys(PAGES).length
        PAGES[PAGES_length] = {
            get name() {
                return localization_minor[Language]["script-name"] + localization_minor[Language]["setting"];
            },
            media: "assets/media/main/settings_header.svg",
            isVisible: true,
            strID: "misae-settings",
            showInGameGuide: true,
        }

        if ($("#dreamnya-menu").length == 0) {
            $("#nav-skill-tooltip-18").after(`<li style="padding:1.375rem 1.25rem .375rem;font-size:.75rem;text-transform:uppercase;letter-spacing:.0625rem;color:rgba(255,255,255,.4);" id="dreamnya-menu">SCRIPT<i class="far fa-eye text-muted ml-1" id="dreamnya-menu-icon"></i></li>`)
        }
        $("#dreamnya-menu").after(`
  <li class="nav-main-item" id="misae-menu">
   <div class="nav-main-link nav-compact pointer-enabled">
    <img class="nav-img" src="assets/media/shop/autoeat.svg" />
    <span class="nav-main-link-name" id="misae-menu-name">超级自动进食</span>
    <small id="misae-status" class="text-danger">在线模式禁用</small>
   </div>
  </li>
`)
        $("#settings-container").after(`
  <div class="content d-none" id="misae-settings-container">
   <div class="row row-deck">
    <div class="col-md-12">
     <div class="block block-rounded block-link-pop border-top border-settings border-4x">
      <div class="block-content">
       <h2 class="content-heading border-bottom mb-4 pb-2" id="misae-script-switcher">脚本开关</h2>
       <div class="row">
        <div class="col-md-6 offset-md-3">
         <div class="mb-4">
          <div class="custom-control custom-switch custom-control-lg">
           <input type="checkbox" class="custom-control-input" id="misae-settings-toggle-onlineMode" name="misae-settings-toggle-onlineMode" checked="" />
           <label class="custom-control-label font-size-sm text-muted" for="misae-settings-toggle-onlineMode">启用在线模式(取代自动进食)</label>
          </div>
         </div>
        </div>
       </div>
       <h2 class="content-heading border-bottom mb-4 pb-2" id="misae-interface-settings">界面设置</h2>
       <div class="row">
        <div class="col-md-6 offset-md-3">
         <div class="form-inline mb-4 flex-wrap-reverse">
          <div class="dropdown">
           <button type="button" class="btn btn-secondary dropdown-toggle font-size-sm" id="misae-settings-dropdown-Language" data-toggle="dropdown" aria-expanded="false">简体中文</button>
           <div class="dropdown-menu font-size-sm" aria-labelledby="misae-settings-dropdown-Language" style="">
            <a class="dropdown-item" id="misae-settings-dropdown-Language-option-zhCN">简体中文</a>
            <a class="dropdown-item" id="misae-settings-dropdown-Language-option-English">English</a>
           </div>
          </div>
          <span class="font-size-sm text-muted ml-2" id="misae-script-language">本界面语言</span>
         </div>
        </div>
       </div>
       <h2 class="content-heading border-bottom mb-4 pb-2" id="misae-general-settings">通用设置</h2>
       <div class="row">
        <div class="col-md-6 offset-md-3">
         <div class="mb-4">
          <div class="custom-control custom-switch custom-control-lg">
           <input type="checkbox" class="custom-control-input" id="misae-settings-toggle-offlineMode" name="misae-settings-toggle-offlineMode" checked="" />
           <label class="custom-control-label font-size-sm text-muted" for="misae-settings-toggle-offlineMode">启用离线模式(下次登陆游戏会自动启用在线模式)<br><small>注意,读取游戏时需要保持前台,否则可能因为浏览器限制导致脚本注入失败进而使角色死亡。</small></label>
          </div>
         </div>
         <div class="mb-4">
          <div class="custom-control custom-switch custom-control-lg">
           <input type="checkbox" class="custom-control-input" id="misae-settings-toggle-swapFood" name="misae-settings-toggle-swapFood" checked="" />
           <label class="custom-control-label font-size-sm text-muted" for="misae-settings-toggle-swapFood">食物耗尽自动切换(未购买“副本内装备切换”亦可生效)</label>
          </div>
         </div>
         <div class="mb-4">
          <div class="custom-control custom-switch custom-control-lg">
           <input type="checkbox" class="custom-control-input" id="misae-settings-toggle-equipLockedFood" name="misae-settings-toggle-equipLockedFood" checked="" />
           <label class="custom-control-label font-size-sm text-muted" for="misae-settings-toggle-equipLockedFood">食物全部耗尽后自动从仓库中装备已锁定食物</label>
          </div>
         </div>
         <div class="mb-4">
          <div class="custom-control custom-switch custom-control-lg">
           <input type="checkbox" class="custom-control-input" id="misae-settings-toggle-equipUnlockedFood" name="misae-settings-toggle-equipUnlockedFood" checked="" />
           <label class="custom-control-label font-size-sm text-muted" for="misae-settings-toggle-equipUnlockedFood">食物全部耗尽后自动从仓库中装备未锁定食物</label>
          </div>
         </div>
         <div class="form-inline mb-4 flex-wrap-reverse">
          <div class="dropdown">
           <button type="button" class="btn btn-primary dropdown-toggle font-size-sm" id="misae-settings-dropdown-foodEfficiency" data-toggle="dropdown" aria-expanded="false">100%</button>
           <div class="dropdown-menu" aria-labelledby="misae-settings-dropdown-foodEfficiency" style="">
            <a class="dropdown-item" id="misae-settings-dropdown-foodEfficiency-option-100">100%</a>
            <a class="dropdown-item" id="misae-settings-dropdown-foodEfficiency-option-80">80%</a>
            <a class="dropdown-item" id="misae-settings-dropdown-foodEfficiency-option-50">50%</a>
           </div>
          </div>
          <span class="font-size-sm text-muted ml-2" id="misae-span-foodEfficiency">自动进食效率<br /><small>(不硬性设定,按需设置)。</small></span>
         </div>
         <div class="form-inline mb-4 flex-wrap-reverse">
          <input class="form-control" style="width:75px" id="misae-settings-input-minThreshold">
          <span class="font-size-sm text-muted ml-2" id="misae-span-minThreshold">自动进食阈值<br><small>(角色血量低于设定之阈值则自动进食,默认为0,即受到致命攻击时方才自动进食)</small></span>
         </div>
        </div>
       </div>
       <h2 class="content-heading border-bottom mb-4 pb-2" id="misae-extra-settings">额外设置</h2>
       <div class="row">
        <div class="col-md-6 offset-md-3">
         <div class="mb-4">
          <div class="custom-control custom-switch custom-control-lg">
           <input type="checkbox" class="custom-control-input" id="misae-settings-toggle-autoLoot" name="misae-settings-toggle-autoLoot" checked="" />
           <label class="custom-control-label font-size-sm text-muted" for="misae-settings-toggle-autoLoot">启用自动收集战利品(离线模式亦生效)</label>
          </div>
         </div>
        </div>
       </div>
       <h2 class="content-heading border-bottom mb-4 pb-2" id="misae-advanced-settings">高级设置</h2>
       <div class="row">
        <div class="col-md-6 offset-md-3">
         <div class="mb-4">
          <div class="custom-control custom-switch custom-control-lg">
           <input type="checkbox" class="custom-control-input" id="misae-settings-toggle-debugMode" name="misae-settings-toggle-debugMode" checked="" />
           <label class="custom-control-label font-size-sm text-muted" for="misae-settings-toggle-debugMode">Debug模式:控制台显示log记录</label>
          </div>
         </div>
         <div class="mb-4">
          <label></label>
         </div>
         <div class="mb-4">
          <label class="font-size-sm text-muted" id="misae-label-info">提示:点击标题栏齿轮图标可显示更多信息</label>
         </div>
        </div>
       </div>
      </div>
     </div>
    </div>
   </div>
  </div>
        `)
        $("#misae-settings-toggle-offlineMode").prop("checked", offlineMode)
        $("#misae-settings-toggle-swapFood").prop("checked", swapFood)
        $("#misae-settings-toggle-equipLockedFood").prop("checked", equipLockedFood)
        $("#misae-settings-toggle-equipUnlockedFood").prop("checked", equipUnlockedFood)
        $("#misae-settings-toggle-debugMode").prop("checked", debugMode)
        $("#misae-settings-toggle-autoLoot").prop("checked", autoLoot)
        $("#misae-settings-dropdown-Language").html($("#misae-settings-dropdown-Language-option-" + Language).html())
        $("#misae-settings-dropdown-foodEfficiency").html($("#misae-settings-dropdown-foodEfficiency-option-" + foodEfficiency).html())
        if (offlineMode && !onlineMode) {
            onlineMode = true
            GM_setValue("onlineMode", onlineMode)
        }
        $("#misae-settings-toggle-onlineMode").prop("checked", onlineMode)
        onlineModeStatus()

        $("#tutorial-page-3").after(`<div class="py-2 d-none" id="tutorial-page-${PAGES_length}">`)
        $("#tutorial-page-3-1").after(`<div class="py-2 d-none" id="tutorial-page-${PAGES_length}-1">`)

        $("#misae-settings-input-minThreshold").val(minThreshold)
        $("#misae-settings-input-minThreshold").on("input propertychange", function (){
            $(this).val($(this)[0].value.replace(/[^\d]/g, ""))
        })
        $("#misae-settings-input-minThreshold").on("blur", function (){
            minThreshold = $(this).val() * 1
            $(this).val(minThreshold)
            GM_setValue("minThreshold", minThreshold)
        })

        $("input[id*=misae-settings-toggle]").on("change", function () {
            let input_id = $(this).attr("id").split("-").reverse()[0]
            let _temp = eval(input_id)
            eval(`${input_id}=!${input_id}`)
            $("#misae-settings-toggle-" + input_id).prop("checked", !_temp)
            GM_setValue(input_id, !_temp)
            if (input_id == "onlineMode") {
                onlineModeStatus()
            }
            if (input_id == "autoLoot") {
                autoLootStatus()
            }
        })

        function onlineModeStatus() {
            if (onlineMode) {
                $("#misae-status").attr("class", "text-success").text(localization_minor[Language]["online-on"])
                injectCode()
            } else {
                $("#misae-status").attr("class", "text-danger").text(localization_minor[Language]["online-off"])
                disableOnline()
            }
        }

        function autoLootStatus() {
            if (autoLoot) {
                injectCode_autoLoot()
            } else {
                disable_autoLoot()
            }
        }

        $("#dreamnya-menu-icon").on("click", () => {
            $("#misae-menu").toggle()
            $("#dreamnya-menu-icon").toggleClass("fa-eye-slash")
        })

        $("#misae-menu").on("click", () => {
            changePage(PAGES_length)
            $("#header-icon").attr("src", "assets/media/main/settings_header.svg")
            $("#header-theme").attr("class", "content-header bg-settings")
            $("#page-header").attr("class", "bg-settings")
        })

        for (let _language of Languages) {
            $("#misae-settings-dropdown-Language-option-" + _language).on("click", () => {
                $("#misae-settings-dropdown-Language").html($("#misae-settings-dropdown-Language-option-" + _language).html())
                Language = _language
                GM_setValue("Language", Language)
                translate()
            })
        }

        for (let _foodEfficiency of foodEfficiencys) {
            $("#misae-settings-dropdown-foodEfficiency-option-" + _foodEfficiency).on("click", () => {
                $("#misae-settings-dropdown-foodEfficiency").html($("#misae-settings-dropdown-foodEfficiency-option-" + _foodEfficiency).html())
                foodEfficiency = _foodEfficiency
                GM_setValue("foodEfficiency", foodEfficiency)
            })
        }
        translate()
    }

    function translate() {
        for (let misae_id in localization_general[Language]) {
            $(`#${misae_id}`).html(localization_general[Language][misae_id])
        }

        for (let misae_toggle_id in localization_toggle[Language]) {
            $(`label[for=${misae_toggle_id}]`).html(localization_toggle[Language][misae_toggle_id])
        }

        if (onlineMode) {
            $("#misae-status").attr("class", "text-success").text(localization_minor[Language]["online-on"])
        } else {
            $("#misae-status").attr("class", "text-danger").text(localization_minor[Language]["online-off"])
        }

        if (currentPage == PAGES_length) {
            $("#header-title").html(localization_minor[Language]["script-name"] + localization_minor[Language]["setting"])
        }

        $(`#tutorial-page-${PAGES_length}`).html(localization_tutorial["English"])
        $(`#tutorial-page-${PAGES_length}-1`).html(localization_tutorial[Language])
    }
    const localization_minor = {
        "English": {
            'script-name': 'Melvor Idle Super Auto Eat',
            'setting': ' Settings',
            'online-off': 'Disabled',
            'online-on': 'Enabled'
        },
        "zhCN": {
            'script-name': 'Melvor Idle 超级自动进食',
            'setting': '设置',
            'online-off': '在线模式禁用',
            'online-on': '在线模式启用',
        }
    }
    const localization_general = {
        "English": {
            'misae-script-switcher': 'Script Switcher',
            'misae-menu-name': 'Super Auto Eat',
            'misae-interface-settings': 'Interface Settings',
            'misae-script-language': 'Script language displayed',
            'misae-general-settings': 'General Settings',
            'misae-span-foodEfficiency': 'Auto eat food efficiency<br /><small>(Change as your need)</small>',
            'misae-advanced-settings': 'Advanced Settings',
            'misae-label-info': 'Tip: Click the gear icon in header to reveal more information.',
            'misae-span-minThreshold': 'Auto eat food threshold<br /><small>(Auto eat food when your hitpoint is lower than the threshold you set,<br />default value is 0, that is, only eat when you take fatal damage)</small>',
            'misae-extra-settings': 'Extra Settings',
            'misae-update-title': 'Super Auto Eat Updated',
            'misae-update-html': `v1.0.5 Update Logs<div style="margin:0 0 0 20px;text-align:left;"><br><small>New extra addition: Auto Loot(Also works in offline mode)</small><br><div style="text-align:center"><small>Need to enable in MISAE settings</small></div><br><small>New extra addition: Show update logs once after every update</small></div>`,
        },
        "zhCN": {
            'misae-script-switcher': '脚本开关',
            'misae-menu-name': '超级自动进食',
            'misae-interface-settings': '界面设置',
            'misae-script-language': '脚本显示语言',
            'misae-general-settings': '通用设置',
            'misae-span-foodEfficiency': '自动进食效率<br /><small>(不硬性设定,按需设置)</small>',
            'misae-advanced-settings': '高级设置',
            'misae-label-info': '提示:点击标题栏齿轮图标可显示更多信息',
            'misae-span-minThreshold': '自动进食阈值<br /><small>(角色血量低于设定之阈值则自动进食,默认为0,即受到致命攻击时方才自动进食)</small>',
            'misae-extra-settings': '额外设置',
            'misae-update-title': '超级自动进食已更新',
            'misae-update-html': `v1.0.5更新日志<div style='margin:0 0 0 20px;text-align:left;'><br>新额外功能:自动收集战利品(离线模式亦可生效)<br><div style="text-align:center"><small>默认关闭需要在设置页面启用</small></div><br>新额外功能:初次更新显示更新日志弹窗</div>`,
        }
    }
    const localization_toggle = {
        "English": {
            'misae-settings-toggle-onlineMode': 'Enable Online Mode(Replace original Auto Eat system)',
            'misae-settings-toggle-offlineMode': 'Enable Offline Mode (Will automatically enable Online Mode the next time you load the game)<br><small>Note that you need to keep the game in the foreground while loading, otherwise the script injection may fail due to browser limitations and the character will die.</small>',
            'misae-settings-toggle-swapFood': 'Auto swap solts when food ran out (Also works without "Dungeon Equipment Swapping")',
            'misae-settings-toggle-equipLockedFood': 'Auto equip locked food from bank when all food ran out<br>(may cause inaccurate dispaly in offline mode, but no damage)',
            'misae-settings-toggle-equipUnlockedFood': 'Auto equip unlocked food from bank when all food ran out<br>(may cause inaccurate statistics in offline mode, but no damage)',
            'misae-settings-toggle-debugMode': 'Debug Mode: Show logs in console',
            'misae-settings-toggle-autoLoot': 'Enable Auto Loot(Not includes bones. Also works in offline mode)',
        },
        "zhCN": {
            'misae-settings-toggle-onlineMode': '启用在线模式(取代自动进食)',
            'misae-settings-toggle-offlineMode': '启用离线模式(下次登陆游戏会自动启用在线模式)<br><small>注意,读取游戏时需要保持前台,否则可能因为浏览器限制导致脚本注入失败进而使角色死亡。</small>',
            'misae-settings-toggle-swapFood': '食物耗尽自动切换(未购买“副本内装备切换”亦可生效)',
            'misae-settings-toggle-equipLockedFood': '食物全部耗尽后自动从仓库中装备已锁定食物(可能导致离线模式食物数量显示不准确,无实际影响)',
            'misae-settings-toggle-equipUnlockedFood': '食物全部耗尽后自动从仓库中装备未锁定食物(可能导致离线模式食物数量显示不准确,无实际影响)',
            'misae-settings-toggle-debugMode': 'Debug模式:控制台显示log记录',
            'misae-settings-toggle-autoLoot': '启用自动收集战利品(不包括骨头等祝祭物品. 离线模式亦可生效)',
        }
    }
    const localization_tutorial = {
        "English": `
            <h2 class="h1 mb-2  text-center"> <img class="m-2" src="assets/media/shop/autoeat.svg" height="64px" />Melvor Idle Super Auto Eat</h2>
            <h5 class="font-w400">【Features】<br />Replace the original auto eat system of the game. When you take damage from combat or thieving, the script will automatically eat food after detecting the amount of damage. The effect is equivalent to manual eat. <br />The script is designed to free your hands, and also works in offline mode thus you can save computer resources and electricity. <br />The principle of the script is to replace the original code directly instead of a timer(setTimeout or setInterval), so the script works in background tabs of browsers.<br />And no additional settings are required when you use the script like &quot;--disable-backgrounding-occluded-windows&quot; or &quot;Calculate window occlusion on Windows&quot;.<br /><span class="text-danger"><b>Tips: This script is only applicable to Melvor Idle V1.0.3, and may conflict to future Melvor updates. If there is a conflict, it is recommended disabling the script and wait for the update. </b></span></h5>
            <h5 class="mb-5 font-w400">【Disclaimer】<br />This script is completely free and open source. The author does not guarantee that the script is free of bugs. Any losses or disputes caused by bugs, improper use, etc. when using this script shall be borne by the user, otherwise please do not use this script. <span class="text-danger"><b>It's highly recommended to backup your savedata before using the script.</b></span> </h5>
            <h5 class="mb-2 font-w400">Script release: <a href="https://greasyfork.org/scripts/442367" target="_blank">https://greasyfork.org/scripts/442367</a><br /> Author: DreamNya(林夕.)<br />Feedback or bug submission is welcome. Also can contact me if you would like to provide localization.<br />The script designed in Chinese and translated into English by Google.<br /> @license: MIT </h5>
            <h5 class="mb-1 text-right" style="font-size:10px!important"> Version:${version} </h5>
        `,
        "zhCN": `
            <h2 class="h1 mb-2  text-center"> <img class="m-2" src="assets/media/shop/autoeat.svg" height="64px" />Melvor Idle 超级自动进食</h2>
            <h5 class="font-w400">【脚本功能】<br />替换原生自动进食系统,在受到战斗或扒窃伤害后检测伤害量自动吃食物,效果等同于手动进食,<br />旨在解放双手,亦可作用于离线模式,节约电脑资源及电费。<br />脚本原理为直接注入代码,而非计时器,在线模式后台标签亦可生效,<br />(使用本脚本)不需要额外设置--disable-backgrounding-occluded-windows或Calculate window occlusion on Windows。<br /><span class="text-danger"><b>提示:本脚本仅适用于Melvor Idle V1.0.3,后续更新可能有所冲突,若出现冲突建议禁用脚本等待更新。</b></span></h5>
            <h5 class="mb-5 font-w400">【免责声明】<br />本脚本完全免费、开源。作者不保证脚本不存在bug。如使用本脚本时因bug、使用不当等原因引起的任何损失、<br />纠纷需用户自行承担,否则请勿使用本脚本。<span class="text-danger"><b>使用脚本前建议备份存档。</b></span> </h5>
            <h5 class="mb-2 font-w400"> 脚本发布地址:<a href="https://greasyfork.org/scripts/442367" target="_blank">https://greasyfork.org/scripts/442367</a><br /> 作者:林夕.(DreamNya)<br /> 欢迎反馈任何建议、BUG<br /> @license: MIT </h5>
            <h5 class="mb-1 text-right" style="font-size:10px!important"> Version:${version} </h5>
        `
    }
    const localization_debug = {
        "English": {
            'Current_Hitpoints': ' Current Hitpoints: ',
            'Damage_Taken': ' Damage Taken: ',
            'Food_Healing': ' Food Healing: ',
            'Eaten_Food_Quantity': ' Eaten Food Quantity: ',
            'Minimum_Threshold': ' Minimum Threshold: '
        },
        "zhCN": {
            'Current_Hitpoints': ' 当前生命值: ',
            'Damage_Taken': ' 受到伤害量: ',
            'Food_Healing': ' 食物治疗量: ',
            'Eaten_Food_Quantity': ' 进食数量: ',
            'Minimum_Threshold': ' 进食阈值: '
        }
    }
    })();