Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

Sign up now!

Question Magic Tree

Joined
Apr 1, 2018
Messages
72
I'm having trouble with a magic tree bot I'm making. I have tree name set to Magic Tree and when it's in the area it will say no Magic trees found and it will cut a near by oak tree.

GameObject MagicTree = GameObjects.newQuery().within(bot.getMagicsArea()).names(bot.getTreeName()).results().nearest();
if (MagicTree != null) {
bot.setWoodCuttingXPBefore(Skill.WOODCUTTING.getExperience());
if (!MagicTree.isVisible()) {
if (Camera.turnTo(MagicTree)) {
bot.logText("Turning camera to Magic");
Execution.delayUntil(MagicTree::isVisible, 100, 5000);
} else {
bot.logText("Failed to turn camera");
}
}

if (MagicTree.interact("Chop down")) {
// bot.logText("Cutting Magic");
Execution.delayWhile(() -> GameObjects.newQuery().on(MagicTree.getPosition()).names("Magic Tree").results().isEmpty() && !Inventory.isFull() && (ChatDialog.getContinue() == null), 300, 60000);
} else {
bot.logText("No chop down option found.");
}
} else {
bot.logText("No cutable Magics found.");
}
 
Joined
Apr 1, 2018
Messages
72
I used Silenced willow bot as a base to work off. In the code above where it says "magictree" it originally said cutableMagic, Still didn't work so I tried changing it to magictree and playing with it. I have the main class for Treename set to Magic tree also.
 
@Override
public void onStart(String... a) {
logText("Starting bot ...");
setTreeName("MagicTree");
LogoutOnStop = true;
setLoopDelay(100, 300);
Execution.delayUntil(RuneScape::isLoggedIn, 100, 6000);
}
 
Top