Don't like ads? PRO users don't see any ads ;-)
Guest

MiningClass

By: a guest on Apr 28th, 2012  |  syntax: None  |  size: 0.50 KB  |  hits: 18  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. public class Mining implements Task, Condition{
  2.                
  3.                 @Override
  4.                 public void run() {
  5.                         for(int a : ROCK_ID){
  6.                                 SceneObject rock = SceneEntities.getNearest(a);
  7.                                 if(rock.isOnScreen() && rock.validate()){
  8.                                         rock.interact("Mine");
  9.                                         Timer t = new Timer(1000);
  10.                                         while(t.isRunning()){
  11.                                                 if(Players.getLocal().getAnimation() != -1){
  12.                                                         t.reset();
  13.                                                 }
  14.                                         }
  15.                                 }
  16.                         }
  17.                 }
  18.                
  19.                
  20.                 @Override
  21.                 public boolean validate() {
  22.                         return Inventory.getCount() < 28;
  23.                 }
  24.         }