1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Question Magic Tree

Discussion in 'Developer Support' started by RSWilliam, Aug 30, 2018.

  1. RSWilliam

    Joined:
    Apr 1, 2018
    Messages:
    72
    Likes Received:
    9
    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.");
    }
     
  2. Derk

    Derk 12 year old normie

    Joined:
    Jan 8, 2015
    Messages:
    2,766
    Likes Received:
    1,339
  3. RSWilliam

    Joined:
    Apr 1, 2018
    Messages:
    72
    Likes Received:
    9
    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.
    --- Double Post Merged, Aug 30, 2018, Original Post Date: Aug 30, 2018 ---
    @Override
    public void onStart(String... a) {
    logText("Starting bot ...");
    setTreeName("MagicTree");
    LogoutOnStop = true;
    setLoopDelay(100, 300);
    Execution.delayUntil(RuneScape::isLoggedIn, 100, 6000);
    }
     

Share This Page

Loading...