joedezzy1

Fletcher

Mar 4th, 2014
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 3.85 KB | None | 0 0
  1. package scripts.Woodcutter;
  2.  
  3. import org.tribot.api.input.Keyboard;
  4. import org.tribot.api2007.Banking;
  5. import org.tribot.api2007.Interfaces;
  6. import org.tribot.api2007.Inventory;
  7. import org.tribot.api2007.Player;
  8. import org.tribot.api2007.WebWalking;
  9. import org.tribot.api2007.types.RSInterfaceChild;
  10. import org.tribot.api2007.types.RSItem;
  11. import org.tribot.script.Script;
  12.  
  13. public class Fletcher extends Script {
  14.    
  15.    
  16.     public static RSItem[] Logs;
  17.     public RSItem[] knife = Inventory.find("Knife");
  18.     public int FlaxCount;
  19.     public int AmountToPick;
  20.     public static boolean PickFlax = false;
  21.     public static boolean WeWantToFletch = false;
  22.     public boolean WeFletchedThem = false;
  23.     public static int LogCount;
  24.    
  25.      public Fletcher() {
  26.          Fletch();
  27.     }
  28.  
  29.     private void Fletch() {
  30.            
  31.             Flax();
  32.                 CutLogs(); 
  33.     }
  34.  
  35.     private void CutLogs() {
  36.        
  37.         sleep(300, 2104);
  38.        
  39.         while(WeNeedToFletch())
  40.        
  41.             if(WeCanFletch())
  42.                
  43.                 if(NotFletching())
  44.                     { KnifeToLog();
  45.                        
  46.                         if(MakeXisUp())
  47.                             { Keyboard.typeSend("28");
  48.                                 WeFletchedThem = true;
  49.                                     sleep(1000, 3000); }
  50.                        
  51.                                             StringBows(); }
  52.        
  53.     }
  54.    
  55.     private boolean WeCanFletch() {
  56.        
  57.         if(Logs.length > 20 && Inventory.find("Knife").length > 0)
  58.             return true;
  59.        
  60.         else {
  61.             GetSupplies();
  62.                 if(WeCanFletch())
  63.                     return true;
  64.                         else return false;
  65.         }
  66.     }
  67.  
  68.     private void GetSupplies() {           
  69.            
  70.             while(!AtBank())
  71.                 { WebWalking.walkToBank();
  72.                      sleep(300); }
  73.            
  74.             Banking.openBank();
  75.                 Banking.depositAll();
  76.            
  77.             if(Inventory.find("Knife").length == 0)
  78.                 Banking.withdraw(1, "Knife");
  79.            
  80.             if(Logs.length <= 20)
  81.                 Banking.withdraw(27, Chopper.LogType);
  82.        
  83.     }
  84.  
  85.     private boolean AtBank() {
  86.        
  87.         for(int x = 0; x <= BankSquares.length - 1; x++)
  88.             for(int y = 0; y <= BankLocations; y++)
  89.                 if(BankTile[x][y].isOnScreen)
  90.                     return true;
  91.     }
  92.  
  93.     private void Flax() { //have to change GUI to get these values
  94.        
  95.         while(PickFlax && FlaxCount < AmountToPick)
  96.            
  97.             { GetToFlaxField();
  98.                 PickFlax();
  99.                     GetToStringRoom();
  100.                         StringFlax();
  101.                                 BankFlax();
  102.                                     FlaxCount += AmountToPick;}
  103.        
  104.     }
  105.  
  106.  
  107.     private void BankFlax() {
  108.         WebWalking.walkToBank();
  109.        
  110.         Banking.depositAllExcept("Knife");
  111.     }
  112.  
  113.     private void StringFlax() {
  114.         // TODO Auto-generated method stub
  115.        
  116.     }
  117.  
  118.  
  119.     private void GetToStringRoom() {
  120.         // TODO Auto-generated method stub
  121.        
  122.     }
  123.  
  124.  
  125.     private void PickFlax() {
  126.         // TODO Auto-generated method stub
  127.        
  128.     }
  129.  
  130.  
  131.     private void GetToFlaxField() {
  132.         // TODO Auto-generated method stub
  133.        
  134.     }
  135.  
  136.  
  137.     private boolean WeNeedToString() {
  138.        
  139.         if(Chopper.StringBows && WeFletchedThem)
  140.             return true; else return false;
  141.     }
  142.  
  143.  
  144.     private void StringBows() {
  145.        
  146.         if(WeNeedToString())
  147.             { GetBowStrings();
  148.                 AttachThemToBow(); }
  149.        
  150.     }
  151.  
  152.  
  153.     private void AttachThemToBow() {
  154.         WeFletchedThem = false;
  155.        
  156.     }
  157.  
  158.  
  159.     private void GetBowStrings() {
  160.         // TODO Auto-generated method stub
  161.        
  162.     }
  163.  
  164.  
  165.     private boolean NotFletching() {
  166.        
  167.         for(int x = 0; x <= 5; x++)
  168.             { sleep(100);
  169.                 if(Player.getAnimation() == 1248)
  170.                     return true; }
  171.        
  172.         return false;
  173.     }
  174.  
  175.     static boolean WeNeedToFletch() {
  176.        
  177.         if(LogCount > 27 && WeWantToFletch) return true;
  178.        
  179.         else return false;
  180.     }
  181.  
  182.     private boolean MakeXisUp() {
  183.        
  184.         if(Interfaces.isInterfaceValid(304)) //make x screen
  185.             { RSInterfaceChild shortbow = Interfaces.get(304, 8);
  186.                  shortbow.click("Make X");
  187.                      sleep(1000, 3000);            
  188.                         if(Interfaces.isInterfaceValid(137)) return true;  
  189.                             else return false; }
  190.        
  191.         return false;
  192.     }
  193.  
  194.     private void KnifeToLog() {
  195.        
  196.         if(Logs.length > 0)
  197.             { knife[0].click();
  198.                 sleep(140, 840);
  199.                     Logs[0].click();
  200.                         sleep(2000, 4000); }
  201.     }
  202.    
  203.    
  204.     @Override
  205.     public void run() {
  206.         // TODO Auto-generated method stub
  207.        
  208.     }
  209. }
Advertisement
Add Comment
Please, Sign In to add comment