Hi everyone, I am trying to create a function that determine the pickaxe the player is able to wield.
void determinePickaxe() {
String pickAxe = null;
int miningLvl = getSkills().getDynamic(Skill.MINING);
int attackLvl = getSkills().getDynamic(Skill.ATTACK);
String[] pickAxes = {
"Iron pickaxe",
"Mithril pickaxe",
"Adamant pickaxe",
"Rune pickaxe"
};
log("Player's Mining Level: " + miningLvl);
log("Player's Attack Level: " + attackLvl);
if(getInventory().contains(pickAxes)) {
log("Determining Which Pickaxe To Use..");
for (int i = 0; i < pickAxes.length; i++) {
log("Pickaxes Avaialble: " + pickAxes[i]);
}
if (getSkills().getDynamic(Skill.MINING) < 6) {
getInventory().interact("Wield", pickAxes[0]);
log("Using: " + pickAxes[0]);
pickAxe = pickAxes[0];
if (getSkills().getDynamic(Skill.MINING) < 21) {
log("HERE");
getInventory().interact("Wield", pickAxes[1]);
log("Using: " + pickAxes[1]);
pickAxe = pickAxes[1];
if (miningLvl < 31) {
inventory.interact("Wield", pickAxes[2]);
log("Using: " + pickAxes[2]);
if (miningLvl < 41) {
inventory.interact("Wield", pickAxes[3]);
log("Using: " + pickAxes[3]);
}
}
}
}
}
}
I later the function into
public void onStart() throws InterruptedException {
//Run Once Here, Variables Etc.
determinePickaxe();
}
It seems to be able to detect the inventory having the pickaxes but does not wield the pickaxes.. Anyone know why? Sorry if I did something stupid.