crazykid080 14 Share Posted September 30, 2020 I'm not 100% sure this works with how it acts when in the banking state but I want to share it and ask if I'm doing something wrong. For this I'm using the lumbridge bank at the top of the stairs. case BANKING: while (bankArea.contains(Players.localPlayer().getTile())) { Walking.walk(bankArea.getRandomTile()); sleepUntil(new Condition() { @Override public boolean verify() { return Players.localPlayer().isMoving(); } }, 3000); } Bank.openClosest(); sleepUntil(new Condition() { @Override public boolean verify() { return Bank.isOpen(); } }, 1000); Bank.depositAllItems(); Bank.close(); Walking.walk(stairsTile); Walking.walk(workingArea.getRandomTile()); return Calculations.random(300, 600); And to decide to bank is simply a Inventory.isFull() check. I probably haven't done something correctly and that's part of why I'm posting it. Please let me know what I'm doing wrong (constructively) so I can improve this and learn more Link to comment Share on other sites More sharing options...
LordJashin32 54 Share Posted September 30, 2020 the walking always has to be looped. You can't just call Walking.walk once and expect it to get there. This is to allow u ur own loop implementation (think wildy walking). You might be able to turn lots of these into lambdas. Should have a sleep between bank deposit and close i think. Also u want to walk to the bank if it doesn't contain the player. Right now u are walking if it does. Link to comment Share on other sites More sharing options...
Uplift 7 Share Posted September 30, 2020 I would stay away from using while loops, it makes stopping script hard, and can cause scripts to get stuck if you don't have a fail safe implemented. A script is already a loop, with your while loop you are limiting what you can do as the while loop will keep going until the player is in the banking area, what happens if the player never gets there? I would structure is that as; - Check to see if the player is in the bank area, - If not should I walk to the next tile in the path to the bank? (Hint, look at Walking#shouldWalk()) - If I should, walk to the next tile - Else if the player is in the bank are - Open Bank, etc. Even then I would split that case up to multiple cases, one for walking to the bank, one for opening the bank, one for depositing items, one for withdrawing items. That will make the script a bit more reliable overall, and make troubleshooting a little bit eaiser. Link to comment Share on other sites More sharing options...
crazykid080 14 Author Share Posted September 30, 2020 21 minutes ago, LordJashin32 said: Also u want to walk to the bank if it doesn't contain the player. Right now u are walking if it does. Shoot. Well that explains the weird behavior that looked like it was indecisive about what it wanted to do! Link to comment Share on other sites More sharing options...
crazykid080 14 Author Share Posted September 30, 2020 Just tested it after fixing that oversight and it actually worked out! Thanks for the help! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.