Guest User

OSBot - Tree Buddie BY Maguire - Wokie

a guest
Feb 25th, 2015
351
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.26 KB | None | 0 0
  1. package Woodcutter;
  2.  
  3. import org.osbot.rs07.api.model.Entity;
  4. import org.osbot.rs07.api.model.Player;
  5. import org.osbot.rs07.event.WalkingEvent;
  6. import org.osbot.rs07.script.Script;
  7. import org.osbot.rs07.script.ScriptManifest;
  8. import org.osbot.rs07.utility.Area;
  9.  
  10. @ScriptManifest(
  11. author = "Wokie",
  12. info = "Super Basic WoodCutter",
  13. logo = "",
  14. name = "Woodcuttie",
  15. version = 0.1)
  16. /*
  17.  * Bot by Maguire - Wokie
  18.  * Free to use and Edit
  19.  * Works for West Varrock tree's Only
  20.  * Banks, Cuts, with Lighting fast speeds!
  21.  * To start be near west varrock
  22.  * Enjoy!
  23.  * Speical Thanks to: Czar, TzTok Jad, 13371337 at osbots.org
  24.  */
  25.  
  26.  
  27. public class Woodbot extends Script{
  28.     //OSBOT Skeleton
  29.    
  30.     final String TREE_NAME = "Tree";
  31.    
  32.     final Area BANK_AREA = new Area(3180, 3433, 3185, 3447);
  33.    
  34.     final Area WESTV_TREES = new Area(3174, 3375, 3160, 3409);
  35.    
  36.     //Player player = myPlayer();
  37.    
  38.     final int BANK_BOOTH_ID = 11748;
  39.    
  40.     //code used on start
  41.     public void onStart() {
  42.         this.log("Script started!");
  43.        
  44.     }
  45.    
  46.     //Code that will be ran at the end.
  47.     public void onExit() {
  48.         this.log("Script stopped!");
  49.     }
  50.    
  51.    
  52.    
  53.     //Code in loop
  54.         @Override
  55.     public int onLoop() throws InterruptedException {
  56.        
  57.        
  58.            
  59.         if(!getInventory().isFull()){
  60.             //Chop
  61.             if(WESTV_TREES.contains(myPlayer())){
  62.             Entity tree = objects.closest(TREE_NAME);
  63.             if(tree != null) {
  64.                 if(tree.isVisible()){
  65.                     if(!myPlayer().isAnimating()){
  66.                         tree.interact("Chop down");
  67.                         sleep(random(700, 800));
  68.                     }
  69.                 }else {
  70.                     camera.toEntity(tree);
  71.                 }
  72.             }
  73.             }else {
  74.                 localWalker.walk(WESTV_TREES, true);
  75.             }
  76.         } else {
  77.             //bank
  78.             if(BANK_AREA.contains(myPlayer())){
  79.                 Entity bankbooth = objects.closest(BANK_BOOTH_ID);
  80.                
  81.                 if(bank.isOpen()){
  82.                     bank.depositAll();
  83.                 }else{
  84.                
  85.                     if(bankbooth != null) {
  86.                         if(bankbooth.isVisible()){
  87.                             bankbooth.interact("Bank");
  88.                             sleep(random(700, 800));
  89.                            
  90.                         }else{
  91.                             camera.toEntity(bankbooth);
  92.                         }
  93.                     }
  94.                 }
  95.             }else {
  96.                 localWalker.walk(BANK_AREA, true);
  97.             }
  98.            
  99.         }
  100.            
  101.             //Amount sleep
  102.         return 50;
  103.        
  104.     }
  105.    
  106.     public State getState() {
  107.        
  108.        
  109.        
  110.        
  111.         return State.IDLE;
  112.     }
  113.        
  114.        
  115.     public enum State {
  116.         DESPOSITE, CUTTING, IDLE
  117.     }
  118.        
  119.        
  120. }
Advertisement
Add Comment
Please, Sign In to add comment