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

Untitled

By: a guest on May 5th, 2012  |  syntax: None  |  size: 1.11 KB  |  hits: 11  |  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. import com.quirlion.script.Script;
  2. import com.quirlion.script.types.Thing;
  3.  
  4.  
  5. public class ironpower extends Script {
  6.  
  7.     int ironOre = 440;
  8.     public int[] ironRock = { 11954, 11955, 11956, 9717, 9718, 9719, 37307, 37308, 37309 };
  9.        
  10.        
  11.         public boolean mine() {
  12.                 Thing rock = things.getNearest(ironRock);
  13.                 if(rock != null) {
  14.                         rock.click("Mine");
  15.                         return true;
  16.                 }
  17.                 if(rock == null) {
  18.                         return false;
  19.                 }
  20.                 return true;
  21.         }
  22.        
  23.         public int loop() {
  24.         if(players.getCurrent().getEnergy() >= random(30, 55)) {
  25.             if (!walker.isRunning()) {
  26.                players.getCurrent().run(true);
  27.             }
  28.          }
  29.  
  30.          if(players.getCurrent().isMoving()) {
  31.             return(random(350, 400));
  32.          }
  33.  
  34.          if(players.getCurrent().getAnimation() != -1) {
  35.             return(random(450, 600));
  36.          }
  37.          if(!inventory.isFull()) {
  38.                  mine();
  39.                  return(random(450, 550));
  40.          }
  41.          if(inventory.isFull()) {
  42.                  inventory.dropAll(ironOre);
  43.                  return(random(450, 550));
  44.          }
  45.                 return(random(300, 450));
  46.         }
  47.  
  48. }