Jump to content

Woodcutting Axe Enum [Snippet]


Recommended Posts

Posted (edited)


package org.bjornkrols.woodcutting;

import org.osbot.rs07.api.ui.Skill;

import org.osbot.rs07.script.Script;

/**

* @author Bjorn Krols (Botre)

* @version 0.1

* @since March 15, 2015

*/

public enum Axe {

BRONZE(1, 1),

IRON(1, 1),

STEEL(6, 5),

BLACK(6, 10),

MITHRIL(21, 20),

ADAMANT(31, 30),

RUNE(41, 40),

DRAGON(61, 60);

private final String name;

private final int requiredWoodcuttingLevel;

private final int requiredAttacklevel;

private Axe(final int requiredWoodcuttingLevel, final int requiredAttacklevel) {

String temp = super.toString().toLowerCase().concat(" axe");

name = Character.toUpperCase(temp.charAt(0)) + temp.substring(1);

this.requiredWoodcuttingLevel = requiredWoodcuttingLevel;

this.requiredAttacklevel = requiredAttacklevel;

}

public String getName() {

return name;

}

public int getRequiredWoodcuttingLevel() {

return requiredWoodcuttingLevel;

}

public boolean canUse(Script script) {

return requiredWoodcuttingLevel <= script.getSkills().getDynamic(Skill.WOODCUTTING);

}

public int getRequiredAttackLevel() {

return requiredAttacklevel;

}

public boolean canWield(Script script) {

return requiredAttacklevel <= script.getSkills().getDynamic(Skill.ATTACK);

}

@Override

public String toString() {

return getName();

}

}

Edited by Botre
Posted

I got them from another site and it seems like they haven't changed in ages so I think they are relatively safe to use. isAnimating() isn't specific enough for some of my need so... tongue.png

care to explain more.

 

Because i know for my plunder its enough. Since there is a underAttack(), all the other animation is him thieving.

  • 2 weeks later...

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