Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private enum State {
- UNKNOWN, ANTIBAN, BANK, CONSTRUCT, TELE_TO_BANK, TELE_TO_HOUSE, OPENDOOR, REMOVE
- }
- public State getState() {
- RSObject portal = objects.getNearest(portalID);
- RSObject buildSpot = objects.getNearest(larderBuildSpot);
- RSObject removeSpot = objects.getNearest(larderRemoveSpot);
- RSNPC banker = npcs.getNearest(bankerID);
- try {
- if (inventory.containsOneOf(teleTab) && inventory.getCount(oakPlankID) >= 8 &&
- inventory.containsOneOf(sawID) && inventory.containsOneOf(hammerID)) {
- if (buildSpot == null) {
- if (removeSpot != null) {
- if (removeSpot.isOnScreen()) {
- return State.REMOVE;
- }
- }
- } else {
- if (buildSpot != null) {
- if (buildSpot.isOnScreen()) {
- if (buildSpot.isReachable()) {
- return State.CONSTRUCT;
- }
- }
- } else if (removeSpot == null) {
- return State.TELE_TO_HOUSE;
- }
- }
- } else if (banker != null) {
- return State.BANK;
- } else {
- return State.TELE_TO_BANK;
- }
- } catch (Exception e) {
- return State.UNKNOWN;
- }
- return State.ANTIBAN;
- }
Add Comment
Please, Sign In to add comment