Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package Woodcutter;
- import java.awt.Graphics;
- import org.osbot.script.Script;
- import org.osbot.script.ScriptManifest;
- import org.osbot.script.rs2.model.Entity;
- import org.osbot.script.rs2.model.Player;
- import org.osbot.script.rs2.ui.Bank;
- import org.osbot.script.rs2.ui.Inventory;
- import org.osbot.script.rs2.utility.Area;
- @ScriptManifest(author = "HighBall", info = "Chops willows at draynor", name = "Woodcutter", version = 0.1)
- public class Woodcutter extends Script {
- final String WILLOW_NAME = "Willow";
- final Area BANK_AREA = new Area(3092, 3240, 3097, 3246);
- final Area WILLOW_AREA = new Area(3081, 3223, 3092, 3239);
- final int BANK_BOOTH_ID = 23961;
- // code used at start
- public void onStart() {
- }
- // code to be executted at the end
- public void onExit() {
- }
- // code in loop
- public int onLoop() throws InterruptedException {
- Inventory inven = client.getInventory();
- Player player = client.getMyPlayer();
- Bank bank = client.getBank();
- if (!inven.isFull()) {
- // chop
- if(WILLOW_AREA.contains(player)){
- Entity willow = closestObjectForName(WILLOW_NAME);
- if (willow != null) {
- if (willow.isVisible()) {
- if (!player.isAnimating()) {
- if (!player.isMoving()) {
- willow.interact("Chop down");
- sleep(random(700, 800));
- }
- }
- } else {
- client.moveCameraToEntity(willow);
- }
- }
- }else{
- walk(WILLOW_AREA);
- }
- } else {
- // bank
- if (BANK_AREA.contains(player)) {
- Entity bankbooth = closestObject(BANK_BOOTH_ID);
- if (bank.isOpen()) {
- bank.depositAll();
- } else {
- if (bankbooth != null) {
- if (bankbooth.isVisible()) {
- bankbooth.interact("Bank");
- sleep(random(700, 800));
- }else{
- client.moveCameraToEntity(bankbooth);
- }
- }
- }
- } else {
- walk(BANK_AREA);
- }
- }
- return 50;
- }
- // paint
- public void onPaint(Graphics g) {
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment