Jump to content

F2P PowerChopper ( AUTO / OPEN SOURCE / WIP )


atoo

Recommended Posts

Made this for fun in 10 minutes.

Cuts tree & Oak.

Will add willow and more areas so it can do 1-99.

You need to have the axe in your inventory else it will stop script and logout.

download: https://www.sendspace.com/file/3bogau

Source:

@ScriptManifest(name = "cutter", info = "yes", author = "atoo", version = 0.2, logo = "")
public class main extends Script {
	
	Area treeArea = new Area(3204, 3256, 3193, 3239);
	Area oakArea = new Area(3124, 3217, 3132, 3211);

	@Override
	public int onLoop() throws InterruptedException {
		RS2Object tempTree = getObjects().closest(c -> c != null && c.getName().equals("Tree")), 
				tempOak = getObjects().closest(c -> c != null && c.getName().equals("Oak"));
	
		//ghett0
		if(!getInventory().contains(item -> item.getName().contains("axe"))){
			this.stop();
			return -1;
		}
		
		if(skills.getDynamic(Skill.WOODCUTTING) < 20){
			if(!treeArea.contains(myPlayer()) && !myPlayer().isAnimating()){
				getWalking().webWalk(treeArea.getRandomPosition());
			} else {
				if(!getInventory().isFull()) {
					if(!myPlayer().isAnimating() && !myPlayer().isMoving())
						tempTree.interact("Chop down");
					else {
						sleep(1000);
					}
				} else {
					getInventory().dropAllExcept(item -> item.getName().contains("axe"));
				}
			}
		} else {
			if(!oakArea.contains(myPlayer()) && !myPlayer().isAnimating() && tempOak == null){
				getWalking().webWalk(oakArea.getRandomPosition());
			} else {
				if(!getInventory().isFull()) {
					if(!myPlayer().isAnimating() && !myPlayer().isMoving())
						tempOak.interact("Chop down");
					else {
						sleep(1000);
					}
				} else {
					getInventory().dropAllExcept(item -> item.getName().contains("axe"));
				}
			}
		}

		return 700;
	}
	public void onPaint(Graphics2D g) {
		g.setColor(Color.white);
		g.setFont(new Font("Arial black", Font.PLAIN, 15));
		g.drawString("level: " + skills.getDynamic(Skill.WOODCUTTING), 10, 50);
	}
}

 

Edited by atoo
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...