Advertisement
Guest User

Untitled

a guest
Oct 31st, 2014
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.96 KB | None | 0 0
  1. package scripts;
  2.  
  3. import java.util.ArrayList;
  4.  
  5. import org.tribot.api.Clicking;
  6. import org.tribot.api.input.Mouse;
  7. import org.tribot.api2007.Banking;
  8. import org.tribot.api2007.ChooseOption;
  9. import org.tribot.api2007.Inventory;
  10. import org.tribot.api2007.types.RSItem;
  11. import org.tribot.api2007.types.RSTile;
  12. import org.tribot.script.Script;
  13. import org.tribot.script.ScriptManifest;
  14.  
  15. @ScriptManifest (authors = {""}, category = "test", name = "CatherbyCooker")
  16. public class CatherbyCooker extends Script {
  17.    
  18.     ArrayList<Integer> fishIds = new ArrayList<Integer>();
  19.    
  20.     private void setupScript() {
  21.         fishIds.add(359); //Tuna
  22.         fishIds.add(377); //Lobster
  23.         fishIds.add(371); //Swords
  24.     }
  25.    
  26.     private boolean depositBank() {
  27.         if (!Banking.isBankScreenOpen()) {
  28.             Banking.openBank();
  29.         }
  30.        
  31.         Banking.depositAll();
  32.        
  33.         if (Inventory.getAll().length == 0 && Banking.isBankScreenOpen()) {
  34.             return true;
  35.         } else
  36.             return false;          
  37.     }
  38.    
  39.     private boolean widthdrawFish() {  
  40.        
  41.         while (!Inventory.isFull()) {
  42.             for (Integer id : fishIds) {
  43.                 Banking.withdraw(28, id);
  44.             }
  45.         }
  46.        
  47.         if (Inventory.isFull())
  48.             return true;
  49.         else
  50.             return false;      
  51.     }
  52.    
  53.     private boolean clickRange() {
  54.         boolean result = false;
  55.         RSTile rangeTile = new RSTile(2817, 3444);
  56.         Mouse.move(rangeTile.getX(), rangeTile.getY());
  57.         Mouse.click(3);
  58.         return true;
  59.  
  60.        
  61.        
  62.        
  63.     }
  64.    
  65.     private boolean initiateCooking() {
  66.         RSItem[] currentInventoryItems = Inventory.getAll();
  67.        
  68.         if (currentInventoryItems.length >= 0)
  69.             return false;
  70.        
  71.         Integer currentItemId = currentInventoryItems[0].getID();
  72.        
  73.         for (RSItem item : currentInventoryItems) {
  74.             if (fishIds.contains(item.getID())) {
  75.                 Clicking.click(item);
  76.             }
  77.         }
  78.         return false;
  79.     }
  80.    
  81.     private void waitForCooking() {
  82.        
  83.     }
  84.  
  85.     @Override
  86.     public void run() {
  87.         setupScript();
  88.         clickRange();
  89.         for (String option : ChooseOption.getOptions()) {
  90.             System.out.println(option);
  91.         }
  92.        
  93.     }
  94.  
  95. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement