User:ByteFoolish: Difference between revisions

From Melvor Idle
mNo edit summary
(Auto pick correct slayer tier)
Line 4: Line 4:


  <nowiki>
  <nowiki>
var count = 30;
var tier = -1;
var costCoins = 0;
var monsID = 10;
var monsID = 10;
var count = 30;
while(count > 1 && combatManager.slayerTask.monster.id != monsID) {
while(count > 1 && combatManager.slayerTask.monster.id != monsID) {
     // selectTask(tier, costCoins, render, fromClick)
     if (MONSTERS[monsID] && MONSTERS[monsID].canSlayer) {
     combatManager.slayerTask.selectTask(0,0,true,true);
        for (i in CONSTANTS.slayerTier) {
            if (combatManager.slayerTask.getMonsterSelection(CONSTANTS.slayerTier[i]).some(e => e.id === monsID)) {
                tier = CONSTANTS.slayerTier[i]
            }
        }
        if (tier == -1) {
            console.log("Unable to find correct slayer tier.");
            break;
        }
    } else {
        console.log("Not a slayer monster.");
        break;
    }
 
     combatManager.slayerTask.selectTask(tier,costCoins,true,true);
     console.log(count);
     console.log(count);
     count = count - 1;
     count = count - 1;

Revision as of 17:19, 11 September 2021

In-game Functions

combatManager.slayerTask.killsLeft = 99999

var count = 30;
var tier = -1;
var costCoins = 0;
var monsID = 10;
while(count > 1 && combatManager.slayerTask.monster.id != monsID) {
    if (MONSTERS[monsID] && MONSTERS[monsID].canSlayer) {
        for (i in CONSTANTS.slayerTier) {
            if (combatManager.slayerTask.getMonsterSelection(CONSTANTS.slayerTier[i]).some(e => e.id === monsID)) {
                tier = CONSTANTS.slayerTier[i]
            }
        }
        if (tier == -1) {
            console.log("Unable to find correct slayer tier.");
            break;
        }
    } else {
        console.log("Not a slayer monster.");
        break;
    }

    combatManager.slayerTask.selectTask(tier,costCoins,true,true);
    console.log(count);
    count = count - 1;

    var now = new Date().getTime();    
    if (combatManager.slayerTask.monster.id == monsID) {
        console.log("Found monster!");
        combatManager.slayerTask.jumpButton.click();
    } else {
        while(new Date().getTime() < now + 1500){ /* Do nothing */ }
    }
}