Jump to content
Frequently Asked Questions
  • Are you not able to open the client? Try following our getting started guide
  • Still not working? Try downloading and running JarFix
  • Help! My bot doesn't do anything! Enable fresh start in client settings and restart the client
  • How to purchase with PayPal/OSRS/Crypto gold? You can purchase vouchers from other users
  • Need help with banking on bot


    keitaro

    Recommended Posts

    hi I'm relatively new to scripting a rsbot. I have my script set up and all of it is working except when I try and use my alternating banking path It goes haywire and just drops all my inventory on the way to the bank1. to break it down more I am trying to get my mining bot to use a alternating banking system, between bank1 and bank2, about every 2 times of needing to bank or every time of needing to bank. if someone could help that would be very appreciated. 

    Link to comment
    Share on other sites

    hi I'm relatively new to scripting a rsbot. I have my script set up and all of it is working except when I try and use my alternating banking path It goes haywire and just drops all my inventory on the way to the bank1. to break it down more I am trying to get my mining bot to use a alternating banking system, between bank1 and bank2, about every 2 times of needing to bank or every time of needing to bank. if someone could help that would be very appreciated.

     

     

    public Enum bankRoute {
     
      ROUTE1(new Tile(x, y, z)), ROUTE2(new Tile(x, y, z));
     
    private Tile bankTile;
     
      public bankRoute(Tile bankTile) {
        this.bankTile = bankTile;
      }
     
      public Tile getBankTile() {
        return bankTile;
      }
    }
    
    Then just make a bankRoute object and set it to a route however you feel like. Then just do

    getWalking().walk(route.getBankTile());
    
    also if you give me your code ina pastebin I can help more.
    Link to comment
    Share on other sites

    alright I imputed this into the bot script, and its now running without dropping on the way to the bank. but its only using the bank/route 1 input and not alternating like Im after is there a time stamp or integer that i need to add?

    Link to comment
    Share on other sites

    alright I imputed this into the bot script, and its now running without dropping on the way to the bank. but its only using the bank/route 1 input and not alternating like Im after is there a time stamp or integer that i need to add?

    make an int in your class and increment it on every loop, then switch it after an amount of time

     

     

    int timer = 0;
     
    onLoop() {
    timer++
    other stuff;
    if (timer > 50) {
      if (route = bankRoute.ROUTE1) {
        route = bankRoute.ROUTE2;
      } else {
        route = bankRoute.ROUTE1;
      }
      timer = 0;
    };
    

     

    If you want to do it with a timer. Same idea applies to switch it other times.

    Link to comment
    Share on other sites

    this works great! 

     

    Another question though would a double traverse function also work? Someone i was talking with said it should but i thought i would ask here sense y'all have been doing this for a wile

     

    RSTile[] tilesToBank1 = {new RSTile(2977, 3248), new RSTile(2978, 3253),
    new RSTile (2991, 3250), new RSTile(2997, 3249), new RSTile(3005, 3251), 
    new RSTile(3013,3254), new RSTile(3020, 3260), new RSTile(3027, 3264), 
    new RSTile(3033, 3264), new RSTile(3040, 3264), new RSTile(3048, 3270),
    new RSTile(3055, 3274), new RSTile(3062, 3275), new RSTile(3069, 3276),
    new RSTile(3075, 3273), new RSTile(3075, 3269), new RSTile(3080, 3265), 
    new RSTile(3082, 3261), new RSTile(3082, 3254), new RSTile(3087, 3248),
    new RSTile(3092, 3247), new RSTile(3092, 3243) };
    RSTilePath pathToBank;
    

    or is that methad for traversing not accepted by DreamBot?

    Link to comment
    Share on other sites

     

    this works great! 

     

    Another question though would a double traverse function also work? Someone i was talking with said it should but i thought i would ask here sense y'all have been doing this for a wile

     

    RSTile[] tilesToBank1 = {new RSTile(2977, 3248), new RSTile(2978, 3253),
    new RSTile (2991, 3250), new RSTile(2997, 3249), new RSTile(3005, 3251), 
    new RSTile(3013,3254), new RSTile(3020, 3260), new RSTile(3027, 3264), 
    new RSTile(3033, 3264), new RSTile(3040, 3264), new RSTile(3048, 3270),
    new RSTile(3055, 3274), new RSTile(3062, 3275), new RSTile(3069, 3276),
    new RSTile(3075, 3273), new RSTile(3075, 3269), new RSTile(3080, 3265), 
    new RSTile(3082, 3261), new RSTile(3082, 3254), new RSTile(3087, 3248),
    new RSTile(3092, 3247), new RSTile(3092, 3243) };
    RSTilePath pathToBank;
    

    or is that methad for traversing not accepted by DreamBot?

     

     

    Too tedious. do this

    Area bankArea = new Area(int x1, int y1, int x2, int y2, floorNumber);

    Start at one corner of the room and get the coordinates.bCBWbw0.png

     

     

    Fill in what we know

    Area bankArea = new Area(3180, 3446, int x2, int y2, floorNumber);

    then go to the other corner

     

    yCNDuUn.png

     

    Fill in what we know

    Area bankArea = new Area(3180, 3446, 3185, 3443, floorNumber);

    the floor number is the 0 all the way on the right so all together its 

    Area bankArea = new Area(3180, 3446, 3185, 3443, 0);

    what this does is draw a square pretty much, drawing from corner1 to corner2.

     

    then all you do is add this code where need be.

    getWalking().walk(bankArea.getCenter());

    and it will walk you to the area no matter where you are at.

     

    That's it. DreamBot has the best and easier API. Never was script writing so easy. :D

    Link to comment
    Share on other sites

    Thanks so much!, 

    so with this method you just map out all the walk areas and then place them in the loop from above in alternating fashion to to complete the function correct?

    this is easy truthfully and such a helpful coding community i thank you all for your help and input. 

    this site 10/10

    Link to comment
    Share on other sites

    Archived

    This topic is now archived and is closed to further replies.

    ×
    ×
    • Create New...

    Important Information

    We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.