Advertisement
Guest User

Untitled

a guest
Jun 24th, 2013
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package scripts;
  2.  
  3. import org.tribot.script.Script;
  4. import org.tribot.script.ScriptManifest;
  5.  
  6. import org.tribot.api.input.Keyboard;
  7. import org.tribot.api.input.Mouse;
  8. import org.tribot.api2007.Banking;
  9. import org.tribot.api2007.Camera;
  10. import org.tribot.api2007.Constants;
  11. import org.tribot.api2007.GameTab;
  12. import org.tribot.api2007.GroundItems;
  13. import org.tribot.api2007.Inventory;
  14. import org.tribot.api2007.NPCs;
  15. import org.tribot.api2007.Player;
  16. import org.tribot.api2007.Walking;
  17. import org.tribot.api2007.Objects;
  18. import org.tribot.api2007.types.RSCharacter;
  19. import org.tribot.api2007.types.RSGroundItem;
  20. import org.tribot.api2007.types.RSNPC;
  21. import org.tribot.api2007.types.RSObject;
  22. import org.tribot.api2007.types.RSTile;
  23.  
  24. @ScriptManifest(authors = { "SockMonster" }, category = "Tools", name = "S-Willows")
  25. public class S_Willows extends Script {
  26.  
  27.     public final int ENT = 1736;
  28.     public final int CUTTING = 867;
  29.     public final int TREE = 1307;
  30.     public final int BANK = 25808;
  31.     public final int LOGS = 1519;
  32.     public final int NEST = 5073;
  33.     public final int[] AXE = {1351, 1349, 1353, 1361, 1355, 1357, 1359, 6739};     
  34.    
  35.     private RSTile[] PATHTO = {
  36.             new RSTile(2723, 3492, 0),
  37.             new RSTile(2719, 3503, 0),
  38.             new RSTile(2709, 3508, 0)};
  39.    
  40.     private RSTile[] PATHBACK = {
  41.              new RSTile(2709, 3508, 0),
  42.              new RSTile(2719, 3503, 0),
  43.              new RSTile(2723, 3492, 0)};
  44.    
  45.     RSObject[] Bank = Objects.findNearest(10, BANK );
  46.     RSObject[] Tree = Objects.findNearest(10, TREE );
  47.     RSGroundItem[] Nests = GroundItems.find(new int[] { 5073, 5074 });
  48.     RSNPC[] Ent = NPCs.findNearest(2, ENT);
  49.    
  50.     @Override
  51.     public void run()
  52.       {
  53.         boolean infinite = true;
  54.         Mouse.setSpeed(175);
  55.         println("Thank you for using S-Willows, please start in Seers Village Bank :)");
  56.         while (infinite)
  57.         {
  58.                
  59.                    // TODO Auto-generated method stub
  60.  
  61.              
  62.               {
  63.                 if (Player.getRSPlayer().isInCombat()) {
  64.                   walktobank();                                         //Keep
  65.                   sleep(20000, 30000);
  66.                
  67.                 }
  68.                 if (Player.getAnimation() != -1) {
  69.                   //Add antiban?                                           //Keep - Add antiban
  70.                   nests();
  71.                   ent();
  72.                   sleep(400, 600);
  73.                  
  74.  
  75.                 if (Player.isMoving()) {
  76.                   sleep(400, 600);                                       //Keep?
  77.                  
  78.                 }
  79.                 if (Inventory.isFull()){
  80.                     walktobank();                                       //When inv full bank, keep.
  81.                     sleep(400, 600);
  82.                  
  83.                   }
  84.                   openbank();
  85.                   sleep(400, 600);
  86.                
  87.                 }
  88.               {
  89.                 if (!Tree[0].isOnScreen()) {
  90.                   walktotrees();
  91.                   sleep(400, 600);
  92.                 } else {
  93.                   chop();
  94.                 }}}
  95.         }
  96.              
  97.               }
  98.               public boolean checkForCombat() {
  99.                 RSCharacter me = Player.getRSPlayer();
  100.                 if (me.isInCombat()) {
  101.                   return true;
  102.                 }
  103.                 return false;
  104.               }
  105.        
  106.      
  107.            
  108.            
  109.  
  110. //Opening Invent   
  111.         public void invent(){
  112.             if (GameTab.getOpen() != GameTab.TABS.INVENTORY) {
  113.                   GameTab.open(GameTab.TABS.INVENTORY);
  114.                   sleep(450, 550);}}
  115.            
  116. //Walking to Trees     
  117.         public void walktotrees(){
  118.         RSObject[] Tree = Objects.findNearest(10, TREE );
  119.             if (!Inventory.isFull() && !Tree[0].isOnScreen() && Tree.length > 0);
  120.                  Keyboard.pressKey('\021');
  121.                  Walking.walkPath(PATHTO);
  122.                  Keyboard.releaseKey('\021');
  123.                  sleep(600,900);}
  124.        
  125. //Cutting Tree
  126.         public void chop(){
  127.             if (!Inventory.isFull() && Tree.length > 0 && Player.getAnimation() != CUTTING){
  128.                 Camera.turnToTile(Tree[0].getPosition());
  129.                 Tree[0].click("Chop");
  130.                 sleep(800,1000);}}
  131.            
  132. //Checking for Nests
  133.         public void nests(){
  134.             if (Nests.length > 0){
  135.               Nests[0].click("Take");
  136.               sleep(450, 700);}}
  137.                
  138. //Checking for Ent 
  139.         public void ent(){
  140.             if (Tree[0].isOnScreen() && Player.getAnimation() == CUTTING && Ent.length > 0){
  141.                 Camera.turnToTile(Tree[0].getPosition());
  142.                 Tree[0].click("Chop");
  143.                 sleep(800,1000);}}
  144.            
  145. //Walking to Bank
  146.         public void walktobank(){
  147.             if (Inventory.isFull() && Bank.length == 0 && !Banking.isBankScreenOpen()){
  148.                 Keyboard.pressKey('\021');
  149.                 Walking.walkPath(PATHBACK);
  150.                 Keyboard.releaseKey('\021');
  151.                 sleep(600,900);}}
  152.            
  153. //Opening Bank 
  154.         public void openbank(){
  155.             if (Inventory.isFull() && Bank.length > 0 && !Banking.isBankScreenOpen()){
  156.                 Camera.turnToTile(Bank[0].getPosition());
  157.                 Bank[0].click("Bank");
  158.                 sleep(400,600);}}
  159.            
  160. //Depositing Items
  161.         public void depositeitem(){
  162.             if (Banking.isBankScreenOpen()){
  163.                 Banking.depositAllExcept(Constants.IDs.Items.hatchets);
  164.                 sleep(500,900);}}
  165.      
  166.        }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement