Greasy Fork is available in English.

Melvor Idle Force loading Hardcore-adventure savedata

【Script outdated. Please use the official mod manager. Only keep the historical code for reference.】Force loading Hardcore-adventure savedata after it expired.

// ==UserScript==
// @name                  Melvor Idle Force loading Hardcore-adventure savedata
// @name:zh-CN            Melvor Idle 强制读取2022愚人节模式存档
// @version               1.1
// @description:zh-CN     【脚本过期失效,请使用官方模组管理器,仅保留历史代码供参考】强制读取本已过期的2022愚人节模式存档
// @description           【Script outdated. Please use the official mod manager. Only keep the historical code for reference.】Force loading Hardcore-adventure savedata after it expired.
// @author                DreamNya
// @match                 *://melvoridle.com/*
// @match                 *://test.melvoridle.com/*
// @match                 *://www.melvoridle.com/*
// @icon                  https://www.google.com/s2/favicons?sz=64&domain=melvoridle.com
// @grant                 none
// @namespace https://greasyfork.org/users/809466
// ==/UserScript==
/* eslint no-undef:0, no-eval:0 */
(function() {
return 'Script outdated. Please use the official mod manager. Only keep the historical code for reference.'
    let timer = setInterval(()=>{
        if(typeof $=="function" && $("div[aria-label='Horizontal Primary']").length>0){
            clearInterval(timer)
            injectScript()
        }
    },200)
    let rawCode
    function injectScript(){
        rawCode=toggleCharacterSelectionView
        let Code=rawCode.toString().slice(0,-1)+'$("button[onclick=\\"showDiscontinuedModal(\'Hardcore Adventure Speedrun\')\\"]").each(function(){$(this).attr("onclick",`selectCharacter(${$(this).attr("id").slice(-1)}, false, 4)`)})}'
        window.eval(Code)
        main()
    }
    function main(){
        $("button[onclick=\"showDiscontinuedModal('Hardcore Adventure Speedrun')\"]").each(function(){
            $(this).attr("onclick",`selectCharacter(${$(this).attr("id").slice(-1)}, false, 4)`)
        })
    }
})();