Jump to content

Woodcutting spam clicking


Magerange

Recommended Posts

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
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

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