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
  • Help with First Wood Chopper script (Lumbridge)


    RSboTTER9
     Share

    Recommended Posts

    Hello everyone, need some help for starters. 

    I am very familiar with Java, as I am a programmer myself. However, I wanted to know why my script doesn't walk back to the Lumbridge tree location? 

     

    It just keeps depositing? Am I missing anything? as I have a walk back to location parameter. Any help is appreciated. 

    import java.awt.*;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    
    import javax.swing.*;
    
    import org.dreambot.api.methods.container.impl.bank.BankLocation;
    import org.dreambot.api.methods.map.Tile;
    //import org.dreambot.api.methods.Calculations;
    import org.dreambot.api.script.AbstractScript;
    import org.dreambot.api.script.ScriptManifest;
    import org.dreambot.api.wrappers.interactive.GameObject;
    import org.dreambot.api.script.Category;
    //logs ID = 1511
    @ScriptManifest(author = "CENSOR", name = "Tree Chopper", version = 1.0, description = "Chops Only Regular Tree", category = Category.WOODCUTTING)
    public class main extends AbstractScript {
    
    	public void onStart() {
    		log("WoodChopper");
    		
    	}
    
    
    
    
    	public void onExit() {
    
    	}
    
    public static final Tile TreeLocation = new Tile(9752,7231);
    	@Override
    	public int onLoop() {
    	
    		GameObject Oak_tree = getGameObjects().closest("Tree");
    		
    			
    			 
    			  
    		
    		if(!getLocalPlayer().isAnimating() && !getLocalPlayer().isMoving()  ) {
    
    			if(getInventory().isFull()){
    				
    				getBank().open(BankLocation.LUMBRIDGE);
    				getBank().depositAllExcept("Bronze Axe");
    				getBank().depositAllExcept("Iron Axe");
    				getBank().depositAllExcept("Steel Axe");
    				getBank().depositAllExcept("Black Axe");
    				getBank().depositAllExcept("Mithril Axe");
    				getBank().depositAllExcept("Adamant Axe");
    				getBank().depositAllExcept("Rune Axe");
    				getBank().depositAllExcept("Dragon Axe");
    			
    				
    			
    				
    			}
    			else {
    					
    			if(Oak_tree != null) {
    				getWalking().walk(TreeLocation);
    				Oak_tree.interact("Chop Down");
    			}
    			
    			
    			
    		}
    		
    		
    	
    	
    }
    	return 1000;	
    }
    }
    	
    	
    
    

    image.png.d1a0dd42f6319d7ddf2fbf6144adbd90.png

    Link to comment
    Share on other sites

    When you're depositing into the bank, you're actually making the client deposit 8 times (once for each depositAllExcept call).

    You'd want to combine that into one, something like:

    getBank().depositAllExcept(item -> item.getName().contains("axe"));

     

    Link to comment
    Share on other sites

    5 minutes ago, Pandemic said:

    When you're depositing into the bank, you're actually making the client deposit 8 times (once for each depositAllExcept call).

    You'd want to combine that into one, something like:

    getBank().depositAllExcept(item -> item.getName().contains("axe"));

     

    Gotcha, Thanks!! I didn't know they detected that for one word "axe". As, for exiting the lumbridge castle, and going down stairs, how can I enable that? 

     

    Many thanks for the tip! 

    Link to comment
    Share on other sites

    12 minutes ago, RSboTTER9 said:

    Gotcha, Thanks!! I didn't know they detected that for one word "axe". As, for exiting the lumbridge castle, and going down stairs, how can I enable that?

    The tree location tile you're trying to walk to looks wrong to me, go back to that tree and try to get the correct one :)

    Link to comment
    Share on other sites

    11 hours ago, Pandemic said:

    The tree location tile you're trying to walk to looks wrong to me, go back to that tree and try to get the correct one :)

    Thank you good sir! It works perfect now! Mind removing my screenshot, please? I forgot to censor my game name.. (although its a throw away account lol) 

    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.