AutoRelic

automatically rolls on <T6 mods.

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

You will need to install an extension such as Tampermonkey to install this script.

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği indirebilmeniz için ayrıca Tampermonkey gibi bir eklenti kurmanız gerekmektedir.

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==UserScript==
// @name         AutoRelic
// @namespace    http://tampermonkey.net/
// @version      1.1
// @description  automatically rolls on <T6 mods.
// @author       Cascade
// @match        https://ironwoodrpg.com/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=ironwoodrpg.com
// @require      https://code.jquery.com/jquery-3.6.4.min.js
// @grant        none
// @license MIT
// ==/UserScript==
function holup(delay) {
  return new Promise((resolve, reject) => {
    setTimeout(() => {
      resolve();
    }, delay);
  });
}

holup(50).then(() => {
    clearInterval(checkit);
    setInterval(checkit, 100);
});

function checkit(){
    if(window.location.href.indexOf("quests") == -1) return;
    let q = $('div.name:contains("Create Random Mod")');
    if(q.length > 0){
        doit(q[0]);
    }
}

function num(str){return Number((str.replace(/\D/g, '') || 0))}

let lastModID = "_"

function doit(q){
    let APCounter = $('div.card').find('div.header').find('div.name:contains("Modifier")').parent().find('div.amount').text();

    let curAP = num(APCounter.split("/")[0].trim())
    let maxAP = num(APCounter.split("/")[1].trim());

    let AP = maxAP - curAP;

    let modID = findModID()
    let modTier = findModTier()
    //console.log("curAP/maxAP", curAP + "/" + maxAP + ", " + AP + " remain. modTier: " + modTier +  ", modID: " + modID)

    if(lastModID != modID){
        lastModID = modID
        if(AP > 0 && modTier < 6) {
            $('div.name:contains("Create Random Mod")').click()
        }
    }
}

function findModTier(){
    let tierText = $('div.card').find('div.header').find('div.name:contains("Modifier")').parent().parent().find('div.stat').find('span.tier').text()

    return num(tierText.trim())
}
function findModID(){
    return $('div.card').find('div.header').find('div.name:contains("Modifier")').parent().parent().find('div.stat').text()
}