Jump to content

OSD pls


Recommended Posts

Posted

Whot you think? I get OSD now?

package com;

import javax.swing.*;

import org.osbot.script.*;
import org.osbot.script.rs2.model.RS2Object;

@ScriptManifest(name = "WCer", author = "Some Guy", version = 1D, info = "A WCer")
public class WoodCutter extends Script {

    private int AXE_ID = Integer.parseInt(JOptionPane.showInputDialog(null, "Enter your axe ID. You can use itemdb.biz for this"));

    private States currentState;

    enum States {
        Mining, Dropping;
    }

    public int onLoop() throws InterruptedException {

        if (!client.getMyPlayer().isUnderAttack() &&
                !client.getInventory().isFull()) {
            currentState = States.Mining;
        } else
            currentState = States.Dropping;

        switch (currentState) {
            case Mining:
                return mine();
            case Dropping:
                return drop();
        }

        return random(20, 25);
    }

    public int mine() throws InterruptedException {
        while (!client.getMyPlayer().isAnimating()) {
            RS2Object Tree = closestObjectForName("Tree");
            Tree.interact(true, "Chop");
        }
        return random(2000, 2500);
    }

    public int drop() throws InterruptedException {
        client.getInventory().dropAllExcept(AXE_ID);
        return random(2000, 2500);
    }
}

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...