Jump to content

Woodcutting spam clicking


Recommended Posts

Posted (edited)

I was quite bored yesterday and decided to create a woodcutting script (yeah, I didn't start with woodcutting like normal people). However, I couldn't tackle one thing - when it has recognized a tree and clicks on the tree to cut, it spamclicks (not excessively, but quite crazy) on the tree untill it starts cutting it.  This also results that if it has more than one 'closest trees', it spamclicks between those two untill it finally gets to one by accident and starts chopping it. How could I make it to click the tree not so commonly? I've added my snippet below :)

	private void chop() throws InterruptedException {
		Entity tree = objects.closest(chopArea, "Tree");
		if (!chopArea.contains(myPlayer())) {
			walking.webWalk(chopArea);
		}
		if (tree != null) {
			Script.sleep(Script.random(775, 975));
			if (!myPlayer().isAnimating()){
			tree.interact("Chop Down");
			new ConditionalSleep(10000) {
			public boolean condition() {
				return !tree.exists() || !myPlayer().isAnimating();
				}
					}.sleep();
		}
		}
	}

 

Edited by Magerange

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...