Jump to content
Frequently Asked Questions
  • Are you not able to open the client? Try following our getting started guide
  • Still not working? Try downloading and running JarFix
  • Help! My bot doesn't do anything! Enable fresh start in client settings and restart the client
  • How to purchase with PayPal/OSRS/Crypto gold? You can purchase vouchers from other users
  • Try asking for help in the chatbox
  • Trying to make a basic woodcut then run back to lumbridge and chop more trees


    lolnyancats
     Share

    Recommended Posts

    here is the code i have so far, it chops the trees and when the inventory is full, it runs to the bank, deposits it, then sits there. And I'm trying to have it walk back to Lumbridge and chop more trees across the river, where the goblins are.

    //import org.dreambot.api.methods.Calculations;
    import org.dreambot.api.methods.map.Area;
    import org.dreambot.api.methods.map.Tile;
    //import org.dreambot.api.methods.map.Tile;
    import org.dreambot.api.script.AbstractScript;
    import org.dreambot.api.script.Category;
    import org.dreambot.api.script.ScriptManifest;
    import org.dreambot.api.wrappers.interactive.GameObject;
    
    @ScriptManifest(category = Category.MISC, author = "Jakey G", name = "Farm all the Trees", version = 1.0, description = "Fish Grabber from PowerFishers")
    public class Main extends AbstractScript {
    	@Override
    	public int onLoop() {
    		if (!getLocalPlayer().isAnimating()) {
    			if (getInventory().isFull()) {
    				GameObject lumbybb = getGameObjects().closest("Bank booth");
    				if (!getBank().isOpen()) {
    					ClosestBank b = new ClosestBank();
    					Area closestBankArea = b.getClosestBank(getLocalPlayer());
    					getWalking().walk(closestBankArea.getRandomTile());
    				}
    				if (lumbybb != null) {
    					lumbybb.interact("Bank");
    					if (getBank().isOpen()) {
    						getBank().depositAllExcept("Bronze axe");
    						getBank().close();
    					}
    				}
    			} else {
    				log("running to tree");
    				GameObject tree = getGameObjects().closest("Tree");
    				Tile treeTile = new Tile(tree.getX(),tree.getY());
                  	//part im messing up, it doesnt run back to the closest tree
    				if (tree != null) {
    					getWalking().walk(treeTile);
    					if (getMap().canReach(tree)) {
    						tree.interact("Chop down");
    					}
    				}
    			}
    		}
    		return 1000;
    	}
    }

     

    Link to comment
    Share on other sites

    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now
     Share

    ×
    ×
    • Create New...

    Important Information

    We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.