- Thread Author
- #1
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.");
}
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.");
}