Advertisement
Guest User

BHide Looter

a guest
Mar 26th, 2015
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package pony.dreambot.goblinkiller;
  2.  
  3. import java.awt.Graphics;
  4.  
  5. import org.dreambot.api.methods.Calculations;
  6. import org.dreambot.api.methods.map.Area;
  7. import org.dreambot.api.methods.map.Tile;
  8. import org.dreambot.api.methods.walking.path.impl.LocalPath;
  9. import org.dreambot.api.script.AbstractScript;
  10. import org.dreambot.api.script.Category;
  11. import org.dreambot.api.script.ScriptManifest;
  12. import org.dreambot.api.utilities.impl.Condition;
  13. import org.dreambot.api.wrappers.items.GroundItem;
  14.  
  15. @ScriptManifest(author = "Pony", category = Category.MISC, description = "Loots Blue Dragon Dhide" , name = "BHide Looter", version = 0 )
  16. public class goblinkiller extends AbstractScript{
  17.  
  18.    
  19.     private final Area BANK_AREA = new Area(2943,3373, 2949, 3368, 0);
  20.     private final Area BLUE_DRAGON_AREA = new Area();
  21.     private final Tile IN_FRONT_OF_DOOR = new Tile();
  22.     private final Tile FALLY_BANK = new Tile();
  23.    
  24.     private LocalPath pathFromBank;
  25.    
  26.     private State state;
  27.    
  28.    
  29.     private enum State{
  30.         BANK, WALK_TO_BANK, WALK_TO_BLUE_DRAGONS, PICK_UP;
  31.     }
  32.    
  33.     private State getState(){
  34.         if(getInventory().isFull()){
  35.             if(BANK_AREA.contains(getLocalPlayer())){
  36.                 return State.BANK;
  37.             }
  38.             else{
  39.                 return State.WALK_TO_BANK;
  40.             }
  41.         }
  42.         else{
  43.             if(BLUE_DRAGON_AREA.contains(getLocalPlayer())){
  44.                 return State.PICK_UP;
  45.             }
  46.             else{
  47.                 return State.WALK_TO_BLUE_DRAGONS;
  48.             }
  49.         }
  50.     }
  51.    
  52.    
  53.    
  54.     public void onStart(){
  55.         pathFromBank = new LocalPath(getClient().getMethodContext());
  56.        
  57.        
  58.        
  59.     }
  60.    
  61.         @Override
  62.         public int onLoop() {
  63.             state = getState();
  64.             switch(state){
  65.                 case BANK: 
  66.                     if(getBank().isOpen()){
  67.                        
  68.                         getBank().depositAllItems();
  69.                         sleepUntil(new Condition(){
  70.                             public boolean verify(){
  71.                                 return getInventory().isEmpty();
  72.                             }
  73.                        
  74.                     },Calculations.random(900,1200));
  75.                        
  76.                    
  77.                     else{
  78.                         getBank().open();
  79.                        
  80.                         sleepUntil(new Condition(){
  81.                             public boolean verify(){
  82.                                 return getBank().isOpen();
  83.                             }
  84.                                
  85.                            
  86.                         },Calculations.random(900,1200));
  87.                    
  88.                     }
  89.                      break;
  90.                 case PICK_UP:
  91.                    
  92.                     GroundItem hide = getGroundItems().closest("Blue Dragonhide");
  93.                    
  94.                     if(hide != null){
  95.                         if(hide.interact("Take")){
  96.                        
  97.                         sleepUntil(new Condition(){
  98.                             public boolean verify(){
  99.                                 return !hide.exists();
  100.                             }
  101.                         },Calculations.random(1000,2400));
  102.                        
  103.                         }
  104.                     }
  105.                     break;
  106.                 case WALK_TO_BANK:
  107.                    
  108.                     if (getLocalPlayer().getTile().getZ() == 2){
  109.                         getWalking().walk(BankLocation.FALADOR.getCenter());
  110.                    
  111.                        
  112.                     }
  113.                     else if(getLocalPlayer().getTile().getZ() == 1){
  114.                        
  115.                     }
  116.                     else{
  117.                         if(BLUE_DRAGON_AREA.contains(getLocalPlayer())){
  118.                            
  119.                         }
  120.                         else{
  121.                             getWalking().walk(FALLY_BANK);
  122.                         }
  123.                        
  124.                     }
  125.                     break;
  126.                 case WALK_TO_BLUE_DRAGONS:
  127.                    
  128.                     if (getLocalPlayer().getTile().getZ() == 2){
  129.                        
  130.                     }
  131.                     else if(getLocalPlayer().getTile().getZ() == 1){
  132.                        
  133.                     }
  134.                     else{
  135.                         if(getLocalPlayer().getTile().distance(IN_FRONT_OF_DOOR) > 6){
  136.                             getWalking().walk(IN_FRONT_OF_DOOR);
  137.                         }
  138.                    
  139.                        
  140.                     }
  141.                    
  142.                     break;
  143.            
  144.            
  145.             return Calculations.random(2898,9766);
  146.         }
  147.            
  148.             return 0;
  149.         }
  150.        
  151.         private void sleepUntil(Condition condition, int random) {
  152.             // TODO Auto-generated method stub
  153.            
  154.         }
  155.  
  156.  
  157.  
  158.         public void onPaint(Graphics g){
  159.        
  160. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement