1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

First script - please give me feedback!

Discussion in 'Projects' started by Remco1337, Nov 11, 2015.

  1. Remco1337

    Joined:
    Nov 6, 2015
    Messages:
    506
    Likes Received:
    11
    Hey, I have started to work on this essense miner for like 6-8 hours, it runs nicely now but it still needs some improvements.

    Things which I can't fix:

    1. Open a wrong door(Used the dooropener to open the door to get to Aubury)
    2. Will be updated.
    [V1]

    Code (Text):
    1. package com.remco.bots.EssenseMiner;
    2.  
    3. import com.runemate.game.api.hybrid.entities.GameObject;
    4. import com.runemate.game.api.hybrid.entities.Npc;
    5. import com.runemate.game.api.hybrid.entities.Player;
    6. import com.runemate.game.api.hybrid.local.Camera;
    7. import com.runemate.game.api.hybrid.local.hud.interfaces.Bank;
    8. import com.runemate.game.api.hybrid.local.hud.interfaces.Inventory;
    9. import com.runemate.game.api.hybrid.location.Area;
    10. import com.runemate.game.api.hybrid.location.Coordinate;
    11. import com.runemate.game.api.hybrid.location.navigation.Path;
    12. import com.runemate.game.api.hybrid.location.navigation.Traversal;
    13. import com.runemate.game.api.hybrid.location.navigation.basic.BresenhamPath;
    14. import com.runemate.game.api.hybrid.location.navigation.web.WebPath;
    15. import com.runemate.game.api.hybrid.region.GameObjects;
    16. import com.runemate.game.api.hybrid.region.Npcs;
    17. import com.runemate.game.api.hybrid.region.Players;
    18. import com.runemate.game.api.script.Execution;
    19. import com.runemate.game.api.script.framework.LoopingScript;
    20. import com.runemate.game.api.script.framework.listeners.ChatboxListener;
    21. import com.runemate.game.api.script.framework.listeners.events.MessageEvent;
    22.  
    23. /**
    24. * PowerMiner for RuneMate tutorial
    25. * Created by SlashnHax
    26. */
    27. public class EssenceMiner extends LoopingScript implements ChatboxListener {
    28.  
    29.     private final static Player player = Players.getLocal();
    30.     private final static Area bankArea = new Area.Rectangular(new Coordinate(3249, 3415, 0), new Coordinate(3257, 3424, 0));
    31.     private final static Area teleportArea = new Area.Rectangular(new Coordinate(3255, 3399, 0), new Coordinate(3252, 3404, 0));
    32.  
    33.     private static boolean isInBank() {
    34.         return bankArea.contains(player);
    35.     }
    36.     private static boolean isAtAubury() {
    37.         Npc aubury = Npcs.newQuery().filter(Npcs.getNameFilter("Aubury")).results().nearest();
    38.         if (aubury != null) {
    39.             return true;
    40.         }
    41.         return false;
    42.     }
    43.     private boolean DoorClosed = false;
    44.     GameObject rocks;
    45.  
    46.     private enum State{
    47.         MINE, Banking, WAIT, WalkingToBank, WalkingToMine, TeleportingToMine, OpenDoor;
    48.     }
    49.  
    50.  
    51.     @Override
    52.     public void onStart(String... args){
    53.         setLoopDelay(2000, 3000);
    54.     }
    55.  
    56.     @Override
    57.     public void onLoop() {
    58.         switch(getCurrentState()){
    59.             case MINE:
    60.                 rocks = GameObjects.newQuery().names("Rune Essence").results().nearest();
    61.                 if(rocks != null && rocks.getDefinition() != null){
    62.                     if(!rocks.isVisible()){
    63.                         Camera.turnTo(rocks);
    64.                     }
    65.                     if(rocks.interact("Mine")){
    66.                         Execution.delayUntil(()->Players.getLocal().getAnimationId() != -1, 500, 5000);
    67.                     }
    68.                 }
    69.                 break;
    70.             case OpenDoor:
    71.  
    72.             break;
    73.             case WalkingToBank:
    74.                 Npc exitPortal = Npcs.newQuery().filter(Npcs.getNameFilter("Portal")).results().nearest();
    75.                 if (exitPortal != null) {
    76.                     if (!exitPortal.isVisible()) {
    77.                         Camera.turnTo(exitPortal);
    78.                     }
    79.                     Path p = BresenhamPath.buildTo(exitPortal);
    80.                     if (p != null)
    81.                     {
    82.                         p.step();
    83.                         Camera.turnTo(exitPortal);
    84.                         Execution.delay(3000, 4000);
    85.                     }
    86.  
    87.                     if (exitPortal.click())
    88.                     {
    89.                         System.out.println("Left the mining area!");
    90.                         Execution.delay(6000, 7000);
    91.                     }
    92.                     else
    93.                     {
    94.                         System.out.println("We failed leaving the mining area!");
    95.                         exitPortal.click();
    96.                         Execution.delay(6000, 7000);
    97.                     }
    98.  
    99.                     GameObject door = GameObjects.newQuery().names("Door").visible().actions("Open").results().nearest();
    100.                     if (door != null) {
    101.                         Camera.turnTo(door);
    102.                         if (!door.isVisible()) {
    103.                             Camera.turnTo(door);
    104.                         } else if (door.interact("Open")) {
    105.                             System.out.println("Opened the door!");
    106.                             Execution.delay(2000, 3000);
    107.                         }
    108.                     }
    109.  
    110.                     Coordinate coord = new Coordinate(3253, 3420, 0);
    111.                     for(int i = 0; i < 2; i++) {
    112.                         System.out.println("Walking to the bank!");
    113.                         final WebPath path = Traversal.getDefaultWeb().getPathBuilder().buildTo(coord);
    114.                         path.step();
    115.                         Execution.delay(7500, 9000);
    116.                     }
    117.  
    118.                 }
    119.                 break;
    120.             case WAIT:
    121.                 break;
    122.  
    123.             case Banking:
    124.                 System.out.println("Banking!");
    125.                 if (Bank.isOpen()) {
    126.                     Bank.depositInventory();
    127.                     Bank.close();
    128.                 }
    129.                 else {
    130.                     Bank.open();
    131.                     Bank.depositInventory();
    132.                     Bank.close();
    133.                 }
    134.  
    135.                 break;
    136.                 case WalkingToMine:
    137.                     Coordinate coord = new Coordinate(3253, 3401, 0);
    138.                     for(int i = 0; i < 2; i++) {
    139.                         System.out.println("Walking to the mine!");
    140.                         final WebPath path = Traversal.getDefaultWeb().getPathBuilder().buildTo(coord);
    141.                         path.step();
    142.                         Execution.delay(8000, 10000);
    143.                     }
    144.  
    145.  
    146.  
    147.                 break;
    148.                 case TeleportingToMine:
    149.                     Npc aubury = Npcs.newQuery().filter(Npcs.getNameFilter("Aubury")).results().nearest();
    150.                     if (aubury != null) {
    151.                         Camera.turnTo(aubury);
    152.  
    153.                         GameObject door = GameObjects.newQuery().names("Door").visible().actions("Open").results().nearest();
    154.                         if (door != null) {
    155.                             Camera.turnTo(door);
    156.                             if (!door.isVisible()) {
    157.                                 Camera.turnTo(door);
    158.                             } else if (door.interact("Open")) {
    159.                                 System.out.println("Opened the door!");
    160.                                 Execution.delay(2000, 3000);
    161.                             }
    162.                         }
    163.  
    164.                         if (!aubury.isVisible()) {
    165.                             Camera.turnTo(aubury);
    166.                         }
    167.                         if (!aubury.isVisible()) {
    168.                             Path p = BresenhamPath.buildTo(aubury);
    169.                             if (p != null)
    170.                                 p.step();
    171.                         }
    172.                         if (aubury.interact("Teleport")) {
    173.                             System.out.println("Went to the mining area!");
    174.                         } else {
    175.                             System.out.println("We failed entering the mining area!");
    176.                             aubury.interact("Teleport");
    177.                         }
    178.                     }
    179.                 break;
    180.         }
    181.     }
    182.  
    183.     @Override
    184.     public void onStop(){
    185.  
    186.     }
    187.  
    188.     public void onMessageReceived(MessageEvent message) {
    189.         /*
    190.  
    191.         Not working!
    192.  
    193.  
    194.         String msg = message.getMessage();
    195.         System.out.println(msg);
    196.         if (message.getSender().equals("") && msg.contains("You can't reach that")) {
    197.             DoorClosed = true;
    198.         }
    199.         */
    200.     }
    201.  
    202.  
    203.     private State getCurrentState() {
    204.         System.out.println(DoorClosed);
    205.         if (isInBank() && !Inventory.isEmpty()) {
    206.             return State.Banking;
    207.         }
    208.  
    209.         else if (DoorClosed) { // Unused!
    210.             return State.OpenDoor;
    211.         }
    212.  
    213.         else if (isAtAubury() && Inventory.isEmpty())
    214.         {
    215.             System.out.println("Called tp to mine");
    216.             return State.TeleportingToMine;
    217.         }
    218.         else if (isInBank() && Inventory.isEmpty()) {
    219.             return State.WalkingToMine;
    220.         }
    221.         else if(Inventory.isFull() && !isInBank()){
    222.             return State.WalkingToBank;
    223.         } else if (Players.getLocal().getAnimationId() == -1 || rocks == null || !rocks.isValid()) {
    224.             return State.MINE;
    225.  
    226.         } else {
    227.             return State.WAIT;
    228.         }
    229.     }
    230. }
    231.  
    [V2]

    Code (Text):
    1. package com.remco.bots.EssenseMiner;
    2.  
    3. import com.runemate.game.api.client.paint.PaintListener;
    4. import com.runemate.game.api.hybrid.RuneScape;
    5. import com.runemate.game.api.hybrid.entities.GameObject;
    6. import com.runemate.game.api.hybrid.entities.Npc;
    7. import com.runemate.game.api.hybrid.entities.Player;
    8. import com.runemate.game.api.hybrid.entities.definitions.ItemDefinition;
    9. import com.runemate.game.api.hybrid.local.Camera;
    10. import com.runemate.game.api.hybrid.local.Skill;
    11. import com.runemate.game.api.hybrid.local.hud.interfaces.Bank;
    12. import com.runemate.game.api.hybrid.local.hud.interfaces.InterfaceWindows;
    13. import com.runemate.game.api.hybrid.local.hud.interfaces.Inventory;
    14. import com.runemate.game.api.hybrid.location.Area;
    15. import com.runemate.game.api.hybrid.location.Coordinate;
    16. import com.runemate.game.api.hybrid.location.navigation.Path;
    17. import com.runemate.game.api.hybrid.location.navigation.Traversal;
    18. import com.runemate.game.api.hybrid.location.navigation.basic.BresenhamPath;
    19. import com.runemate.game.api.hybrid.location.navigation.web.WebPath;
    20. import com.runemate.game.api.hybrid.region.GameObjects;
    21. import com.runemate.game.api.hybrid.region.Npcs;
    22. import com.runemate.game.api.hybrid.region.Players;
    23. import com.runemate.game.api.hybrid.util.StopWatch;
    24. import com.runemate.game.api.script.Execution;
    25. import com.runemate.game.api.script.framework.LoopingScript;
    26. import com.runemate.game.api.script.framework.listeners.InventoryListener;
    27. import com.runemate.game.api.script.framework.listeners.SkillListener;
    28. import com.runemate.game.api.script.framework.listeners.events.ItemEvent;
    29. import com.runemate.game.api.script.framework.listeners.events.MessageEvent;
    30. import com.runemate.game.api.script.framework.listeners.events.SkillEvent;
    31.  
    32. import java.awt.*;
    33. import java.util.Random;
    34.  
    35. /**
    36. * PowerMiner for RuneMate tutorial
    37. * Created by SlashnHax
    38. */
    39. public class EssenceMiner extends LoopingScript implements PaintListener, InventoryListener, SkillListener {
    40.  
    41.     private final static Player player = Players.getLocal();
    42.     private final static Area bankArea = new Area.Circular(new Coordinate(3253, 3421, 0), 5);
    43.     private final static Area teleportArea = new Area.Rectangular(new Coordinate(3255, 3399, 0), new Coordinate(3252, 3404, 0));
    44.     private final static Area doorArea = new Area.Circular(new Coordinate(3253, 3401, 0), 6);
    45.  
    46.     private final static StopWatch runtime = new StopWatch();
    47.  
    48.     private static boolean isInBank() {
    49.         return bankArea.contains(player);
    50.     }
    51.     private static boolean isNearDoor() {
    52.         return doorArea.contains(player);
    53.     }
    54.     private static boolean isAtAubury() {
    55.         Npc aubury = Npcs.newQuery().filter(Npcs.getNameFilter("Aubury")).results().nearest();
    56.         if (aubury != null) {
    57.             return true;
    58.         }
    59.         return false;
    60.     }
    61.  
    62.     public static int toHour(double detail){
    63.         long difference = System.currentTimeMillis() - runtime.getRuntime();
    64.         double xpH = (3600000 * detail) / difference;
    65.         return (int)xpH;
    66.     }
    67.  
    68.     private String Status = "Starting up";
    69.     private boolean DoorClosed = false;
    70.  
    71.  
    72.     private static int oreCount = 0;
    73.     private static int orePrice = 0;
    74.     private static int levelsGained = 0;
    75.  
    76.     private boolean isIdle() {
    77.         return player.getAnimationId() == -1 && !player.isMoving();
    78.     }
    79.  
    80.     GameObject rocks;
    81.  
    82.     private enum State{
    83.         MINE, Banking, WAIT, WalkingToBank, WalkingToMine, TeleportingToMine, OpenDoor, ExitingMine;
    84.     }
    85.  
    86.  
    87.     @Override
    88.     public void onPaint(Graphics2D g){
    89.         Color transBlack = new Color(0, 0, 0, 150);
    90.         //Draw trans rect
    91.         g.setColor(transBlack);
    92.         g.fillRect(0, 0, 215, 115);
    93.         //Draw border of rect
    94.         g.setColor(Color.red);
    95.         g.drawRect(0, 0, 215, 115);
    96.         //Draw green underline under title
    97.         g.drawLine(5, 20, 195, 20);
    98.         //Draw text
    99.         g.setColor(Color.white);
    100.         // Text
    101.         g.drawString("Essence Miner", 80, 15);
    102.         g.drawString("Run time: " + runtime.getRuntimeAsString(), 5, 35);
    103.         if (RuneScape.isLoggedIn()) {
    104.             g.drawString("Mining level: " + Skill.MINING.getCurrentLevel() + " + " + levelsGained, 5, 50);
    105.             g.drawString("Experience to level: " + Skill.MINING.getExperienceToNextLevel(), 5, 65);
    106.             g.drawString("Ores mined: " + oreCount + " (" + toHour(oreCount) + "/H)", 5, 80);
    107.             g.drawString("Money gained: " + orePrice * oreCount + "(" + toHour(oreCount) + "/H)", 5, 95);
    108.             g.drawString("Status: " + Status, 5, 110);
    109.         }
    110.     }
    111.  
    112.  
    113.  
    114.  
    115.     @Override
    116.     public void onStart(String... args){
    117.         setLoopDelay(2000, 3000);
    118.         getEventDispatcher().addListener(this);
    119.         runtime.start();
    120.     }
    121.  
    122.     public static int randInt(int min, int max) {
    123.  
    124.  
    125.         Random rand = new Random();
    126.         int randomNum = rand.nextInt((max - min) + 1) + min;
    127.  
    128.         return randomNum;
    129.     }
    130.  
    131.     @Override
    132.     public void onLoop() {
    133.         switch(getCurrentState()){
    134.             case MINE:
    135.                 int antibanType = randInt(0, 5);
    136.                 rocks = GameObjects.newQuery().names("Rune Essence").results().nearest();
    137.                 if(rocks != null && rocks.getDefinition() != null){
    138.                     if(!rocks.isVisible()){
    139.                         Path p = BresenhamPath.buildTo(rocks);
    140.                         if (p != null)
    141.                         {
    142.                             p.step();
    143.                             Camera.turnTo(rocks);
    144.                             Execution.delayUntil(()->Players.getLocal().getAnimationId() != -1, 3000, 3500);
    145.                         }
    146.                     }
    147.                     if(rocks.interact("Mine")){
    148.                         Status = "Mining!";
    149.                         Execution.delayUntil(()->Inventory.isFull(), 20000, 25000);
    150.                         // Bit antiban
    151.  
    152.                         switch(antibanType) {
    153.                             case 0:
    154.                                 Status = "Some anticheat";
    155.                                 if (!InterfaceWindows.getInventory().isOpen()) {
    156.                                     InterfaceWindows.getInventory().open();
    157.                                     if (!Inventory.isEmpty()) {
    158.  
    159.                                     }
    160.                                 }
    161.                                 else
    162.                                 {
    163.                                     InterfaceWindows.getSkills().open();
    164.  
    165.                                 }
    166.  
    167.                             break;
    168.                             case 1:
    169.  
    170.                             break;
    171.                         }
    172.                     }
    173.                 }
    174.                 break;
    175.             case OpenDoor:
    176.                 GameObject door = GameObjects.newQuery().names("Door").within(doorArea).actions("Open").results().nearest();
    177.                 if (door != null) {
    178.                     System.out.println("Door selected");
    179.                     Camera.turnTo(door);
    180.                     if (!door.isVisible()) {
    181.                         Camera.turnTo(door);
    182.                     } else if (door.interact("Open")) {
    183.                         Status = "Opened the closed door!";
    184.                         Execution.delay(2000, 3000);
    185.                     }
    186.                 }
    187.             break;
    188.             case ExitingMine:
    189.                 Npc exitPortal = Npcs.newQuery().filter(Npcs.getNameFilter("Portal")).results().nearest();
    190.                 if (exitPortal != null) {
    191.                     Camera.turnTo(exitPortal);
    192.                     Path p = BresenhamPath.buildTo(exitPortal);
    193.                     if (p != null) {
    194.                         p.step();
    195.                         Camera.turnTo(exitPortal);
    196.                         Execution.delayUntil(() -> Players.getLocal().getAnimationId() != -1, 3000, 3500);
    197.                     }
    198.  
    199.                     if (exitPortal.interact("Enter")) {
    200.                         Status = "Left the mine through the portal.";
    201.                         Execution.delayUntil(() -> isNearDoor(), 8000);
    202.                     } else {
    203.                         Status = "We seem to have failed leaving the mine.";
    204.                         Path pa = BresenhamPath.buildTo(exitPortal);
    205.                         if (pa != null) {
    206.                             pa.step();
    207.                             Camera.turnTo(exitPortal);
    208.                             Execution.delayUntil(() -> Players.getLocal().getAnimationId() != -1, 4000, 4500);
    209.                         }
    210.                         exitPortal.click();
    211.                         Execution.delayUntil(() -> isNearDoor(), 8000);
    212.                     }
    213.                 }
    214.                 break;
    215.             case WalkingToBank:
    216.                     GameObject backdoor = GameObjects.newQuery().names("Door").within(doorArea).actions("Open").results().nearest();
    217.                     if (backdoor != null) {
    218.                         Status = "Door is locked! Time to unlock it!";
    219.                         Camera.turnTo(backdoor);
    220.                         if (!backdoor.isVisible()) {
    221.                             Camera.turnTo(backdoor);
    222.                         } else if (backdoor.interact("Open")) {
    223.                             Status = "Door has been opened";
    224.                             Execution.delayUntil(()->Players.getLocal().getAnimationId() != -1, 2000, 3000);
    225.                         }
    226.                     }
    227.  
    228.  
    229.                     Status = "Walking to the Bank";
    230.                     Coordinate coord = new Coordinate(3254, 3423, 0);
    231.                     for(int i = 0; i < 2; i++) {
    232.  
    233.                         final WebPath path = Traversal.getDefaultWeb().getPathBuilder().buildTo(coord);
    234.                         path.step();
    235.                         Execution.delay(5000, 6000);
    236.                     }
    237.  
    238.                     if (!isInBank()) {
    239.                         Path pa = BresenhamPath.buildTo(coord);
    240.                         if (pa != null) {
    241.                             pa.step();
    242.                             Execution.delayUntil(() -> isInBank(), 5000);
    243.                         }
    244.                     }
    245.  
    246.  
    247.                 break;
    248.             case WAIT:
    249.                 break;
    250.             case Banking:
    251.                 Status = "Banking";
    252.  
    253.                 if (Bank.isOpen()) {
    254.                     Execution.delayUntil(Bank::isOpen, 250, 2000);
    255.                     Bank.depositInventory();
    256.                     Bank.close();
    257.                 }
    258.                 else {
    259.                     Bank.open();
    260.                     Execution.delayUntil(Bank::isOpen, 250, 2000);
    261.                     Bank.depositInventory();
    262.                     Bank.close();
    263.                 }
    264.  
    265.                 break;
    266.                 case WalkingToMine:
    267.                     Coordinate coordToMine = new Coordinate(3253, 3398, 0);
    268.  
    269.                     for(int i = 0; i < 2; i++) {
    270.                         Status = "Walking to the Mine";
    271.                         final WebPath path = Traversal.getDefaultWeb().getPathBuilder().buildTo(coordToMine);
    272.                         path.step();
    273.                         Execution.delayUntil(() -> isIdle(), 7000);
    274.                     }
    275.  
    276.  
    277.  
    278.                 break;
    279.                 case TeleportingToMine:
    280.                     Npc aubury = Npcs.newQuery().filter(Npcs.getNameFilter("Aubury")).results().nearest();
    281.                     if (aubury != null && Inventory.isEmpty()) {
    282.                         Camera.turnTo(aubury);
    283.  
    284.  
    285.  
    286.                         if (!aubury.isVisible()) {
    287.                             Camera.turnTo(aubury);
    288.                         }
    289.                         if (!aubury.isVisible()) {
    290.                             Path p = BresenhamPath.buildTo(aubury);
    291.                             if (p != null)
    292.                                 p.step();
    293.                         }
    294.                         if (aubury.interact("Teleport")) {
    295.                             Status = "Speaking to Aubury";
    296.                             Execution.delayUntil(() -> isIdle(), 2000, 3000);
    297.                         } else {
    298.                             Status = "Failed talking to Aubury, let's try again.";
    299.                             aubury.interact("Teleport");
    300.                             Execution.delayUntil(() -> isIdle(), 2000, 3000);
    301.                         }
    302.                     }
    303.                 break;
    304.         }
    305.     }
    306.  
    307.     @Override
    308.     public void onStop(){
    309.  
    310.     }
    311.  
    312.     @Override
    313.     public void onItemAdded(ItemEvent event) {
    314.         ItemDefinition definition = event.getItem().getDefinition();
    315.  
    316.         if (definition != null && definition.getName().equals("Rune essence") || definition.getName().equals("Pure essence")) {
    317.             oreCount++;
    318.         }
    319.     }
    320.  
    321.  
    322.  
    323.     @Override
    324.     public void onLevelUp(SkillEvent event) {
    325.         if (event.getSkill().equals(Skill.MINING)) {
    326.             ++levelsGained;
    327.         }
    328.     }
    329.  
    330.     public void onMessageReceived(MessageEvent message) {
    331.         /*
    332.  
    333.         Not working!
    334.  
    335.  
    336.         String msg = message.getMessage();
    337.         System.out.println(msg);
    338.         if (message.getSender().equals("") && msg.contains("You can't reach that")) {
    339.             DoorClosed = true;
    340.         }
    341.         */
    342.     }
    343.  
    344.  
    345.     private State getCurrentState() {
    346.         System.out.println(isNearDoor());
    347.         if (isInBank() && !Inventory.isEmpty()) {
    348.             return State.Banking;
    349.         }
    350.  
    351.         else if (isNearDoor() && Inventory.isFull()) { // Unused!
    352.             GameObject backdoor = GameObjects.newQuery().names("Door").within(doorArea).actions("Open").results().nearest();
    353.             if (backdoor != null && Inventory.isFull()) {
    354.                 return State.OpenDoor;
    355.             }
    356.             else
    357.             {
    358.                 return State.WalkingToBank;
    359.             }
    360.  
    361.         }
    362.         else if (isNearDoor() && Inventory.isEmpty()) {
    363.             GameObject backdoor = GameObjects.newQuery().names("Door").within(doorArea).actions("Open").results().nearest();
    364.             if (backdoor != null) {
    365.                 return State.OpenDoor;
    366.             }
    367.             else
    368.             {
    369.                 return State.TeleportingToMine;
    370.             }
    371.         }
    372.  
    373.         else if (isNearDoor() && Inventory.isEmpty())
    374.         {
    375.             System.out.println("Called tp to mine");
    376.             return State.TeleportingToMine;
    377.         }
    378.         else if (isInBank() && Inventory.isEmpty()) {
    379.             return State.WalkingToMine;
    380.         }
    381.         else if(Inventory.isFull() && isNearDoor()) {
    382.             return State.WalkingToBank;
    383.         }
    384.         else if(Inventory.isFull() && !isInBank()){
    385.             return State.ExitingMine;
    386.         }
    387.          else if (Players.getLocal().getAnimationId() == -1 || rocks == null || !rocks.isValid()) {
    388.             return State.MINE;
    389.  
    390.         } else {
    391.             return State.WAIT;
    392.         }
    393.     }
    394. }
    395.  
    '
    Updated to V2.
     
    #1 Remco1337, Nov 11, 2015
    Last edited: Nov 12, 2015
    Who USAF likes this.

Share This Page

Loading...