Jump to content

bobilly89

Members
  • Posts

    4
  • Joined

  • Last visited

  • Feedback

    0%

Posts posted by bobilly89

  1. First of all, don't use ID's as it can change when RS is updated. This also accounts for items as I see you're using ID's everywhere.

    Second, the API has bank areas already so you don't need to define them yourself.

    Area bankArea = Banks.YOUR_BANK;
    

    Next do something similar to this (might want to use sleep):

    if (getWalking().webWalk(bankArea)) {
      if (!getBank().isOpen()) {
        RS2Object bankbooth =  getObjects().closest("Bank booth);
    
        if (bankbooth != null && bankbooth.hasAction("Bank")) {
           bankbooth.interact("Bank");
        }
      }
    }
    
    

    Btw, use code tags so we can read your code more easily

     

    Thank you. How do i use the sleep method? I was having trouble with it and ended up giving up on it. :|

  2. My script has the player collect wood then he goes to the bank area to place it in the bank. He just stands in the bank area and never accomplishes anything. Help is appreciated :D. Im having trouble near the //bank section

     

     

    package Woodcutter;

    import java.awt.Graphics;
    import org.osbot.rs07.api.Inventory;
    import org.osbot.rs07.api.model.RS2Object;
    import org.osbot.rs07.script.Script;
    import org.osbot.rs07.script.ScriptManifest;

    import com.google.common.util.concurrent.Service.State;

    import org.osbot.rs07.api.model.Entity;
    import org.osbot.rs07.api.model.Player;
    import org.osbot.rs07.api.Bank;
    import org.osbot.rs07.api.Inventory;
    import org.osbot.rs07.api.map.Area;
    import org.osbot.rs07.script.MethodProvider;
    @ScriptManifest(author = "Me", info = "Chops willows", name = "woodcutter", version = 0.1, logo = "")
    public class Woodcutter extends Script
    {
        final Area BANK_AREA = new Area(3168,3492,3161,3487);
        final Area TREE_AREA = new Area(3150,3464,3172,3450);
        final int BANK_BOOTH_ID = 5453;
        final String Tree_Name = "Tree";
                public void onStart()
                {
        
                }
            public void onExit()
                {
        
                }
        //code in loop
        public int onLoop()
        {
            Inventory inven = getInventory();
            Player player = getObjects().myPlayer();
            Bank bank = getObjects().getBank();
        if(!inven.isFull())
        {
                //chop
                if(TREE_AREA.contains(player))
                {
                RS2Object willow =  getObjects().closest(Tree_Name);
                
                if(willow != null)
                {
                    if (willow.isVisible()) {
                        if (!player.isAnimating()) {
                            if (!player.isMoving()) {
                                willow.interact("Chop down");
                                
                            }
                        }
                    } else {
                        getCamera().toEntity(willow);
                    }
                       
                }
                }else{
                    getWalking().webWalk(TREE_AREA);
                }
                
                
                }else{
                    // bank
                    if (BANK_AREA.contains(player)) {
                    
                        RS2Object bankbooth =  getObjects().closest(BANK_BOOTH_ID, 5454, 5455, 5456);
                        
                        
                        
                        if (bank.isOpen()) {
                            bank.depositAll(1511);
                            bank.depositAll();
                        } else {
                            if (bankbooth != null) {
                                if (bankbooth.isVisible()) {
                                    bankbooth.interact("Bank");
                                    
                                }else{
                                    getCamera().toEntity(bankbooth);
                                }
                            }
                        }

                    } else {
                        getWalking().webWalk(BANK_AREA);
                    }
                }
            return 50;
        }//end int onloop
        
        
        //paint
        public void onPaint(Graphics g)
        {
            
        }
    }
     

×
×
  • Create New...