keitaro 0 Share Posted October 18, 2015 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 More sharing options...
Dreamlicker 749 Share Posted October 18, 2015 (edited) 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. Edited October 18, 2015 by Dreamlicker keitaro 1 Link to comment Share on other sites More sharing options...
keitaro 0 Author Share Posted October 19, 2015 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 More sharing options...
Dreamlicker 749 Share Posted October 19, 2015 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. keitaro 1 Link to comment Share on other sites More sharing options...
keitaro 0 Author Share Posted October 21, 2015 (edited) 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? Edited October 21, 2015 by keitaro Link to comment Share on other sites More sharing options...
Zompies 20 Share Posted October 22, 2015 (edited) 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. Fill in what we know Area bankArea = new Area(3180, 3446, int x2, int y2, floorNumber); then go to the other corner 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. Edited October 22, 2015 by Zompies Link to comment Share on other sites More sharing options...
keitaro 0 Author Share Posted October 22, 2015 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 More sharing options...
Zompies 20 Share Posted October 22, 2015 (edited) Just have it on the onLoop Edited October 22, 2015 by Zompies Link to comment Share on other sites More sharing options...
Recommended Posts