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 Anyone got a basic 07 treebot i can look at?

Joined
Jan 6, 2020
Messages
2
CS student here who just got into scripting. Started writing my first bot but I think my life would be a lot easier to get over the learning barrier if i had a basic treebot bot to look at? Anyone got any of their beginer/first bot they wouldn't mind sharing (for me to learn from)? Would be greatly appreciated. I looked around on here for a bit but could only find examples of looping scripts.
 
cuppa.drink(java);
Joined
Mar 13, 2018
Messages
6,966
You can find some open source ones on the bot store I think.

I learned from Snufalufugus' YouTube video tutorial called runemate tree bot tutorial or something.
 
Joined
Feb 9, 2019
Messages
44
Cut and Drop? Follow Snufalufugus'zzz vid to set up your code and be able to debug. Then you can use the below as a basic chop and drop script.

Code:
final String dropList[] = {"Logs", "Oak logs", "Willow logs", "Maple logs", "Yew logs", "Magic logs", "Redwood logs"};
final String target_tree = "Maple tree";
final Coordinate coord_player = Players.getLocal().getPosition();
final boolean collect_birds_nest = true;

if (Inventory.isFull()) {
    //go through twice in case we miss any logs
    //shift drop all the logs...
    Keyboard.pressKey(KeyEvent.VK_SHIFT);
    for (int i = 0; i < 2; i++) {
        SpriteItemQueryResults items = Inventory.getItems(dropList);

        for (SpriteItem item: items) {
            item.click();
        }
    }
    Keyboard.releaseKey(KeyEvent.VK_SHIFT);
    return false;
}


if (collect_birds_nest) {
    GroundItem birdNest = GroundItems.newQuery().filter(o-> o.getDefinition() !=null && o.getDefinition().getName().contains("nest")).results().first();
    if (birdNest != null) {
        birdNest.interact("Take");
        return false;
    }
}

//get some more logs
GameObject targetTree = GameObjects.newQuery().names(target_tree).actions("Chop down").filter(o-> o.distanceTo(coord_player, Algorithm.EUCLIDEAN) < 4).results().nearest(Algorithm.EUCLIDEAN_SQUARED);
if (targetTree != null) {
    if (!targetTree.isVisible()) {
        BresenhamPath path = BresenhamPath.buildTo(targetTree.getPosition());
        if (path != null) {
            path.step();
            Execution.delayUntil(()-> Players.getLocal().isMoving(), 750, 1500);
            return false;
        }
    }

    //I had a few issues in the past where the target tree was right next to a bank and would try
    //to interact with the tree while the interface was still open...
    if (com.runemate.game.api.hybrid.local.hud.interfaces.Bank.isOpen())
        com.runemate.game.api.hybrid.local.hud.interfaces.Bank.close();
    else if (com.runemate.game.api.hybrid.local.hud.interfaces.DepositBox.isOpen())
        com.runemate.game.api.hybrid.local.hud.interfaces.DepositBox.close();

    //InteractablePoint inter = obj.getInteractionPoint();
    boolean res = targetTree.interact("Chop down");
    if (!res) {
        Camera.turnTo(targetTree);
        targetTree.interact("Chop down");
    }
    Execution.delayUntil(()->Players.getLocal().getAnimationId() != -1, 750, 1500);
}
 
Top