ByteFoolish

Joined 10 January 2021
no edit summary
(Auto pick correct slayer tier)
No edit summary
 
Line 1: Line 1:
In-game Functions
In-game Functions


combatManager.slayerTask.killsLeft = 99999
game.combat.slayerTask.killsLeft = 99999


  <nowiki>
  <nowiki>
Line 7: Line 7:
var tier = -1;
var tier = -1;
var costCoins = 0;
var costCoins = 0;
var monsID = 10;
var monsID = game.combat.enemy.monster._localID;
while(count > 1 && combatManager.slayerTask.monster.id != monsID) {
while(count > 1 && game.combat.slayerTask.monster._localID != monsID) {
     if (MONSTERS[monsID] && MONSTERS[monsID].canSlayer) {
     if (game.combat.enemy.monster.canSlayer) {
         for (i in CONSTANTS.slayerTier) {
         for (const i in SlayerTierID) {
             if (combatManager.slayerTask.getMonsterSelection(CONSTANTS.slayerTier[i]).some(e => e.id === monsID)) {
             if (isNaN(i)) continue;
                 tier = CONSTANTS.slayerTier[i]
            if (game.combat.slayerTask.getMonsterSelection(i).some(e => e._localID === monsID)) {
                 tier = i
             }
             }
         }
         }
Line 24: Line 25:
     }
     }


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


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

edits