Mocro Posted October 1, 2015 Share Posted October 1, 2015 i was Woodcutting and i did when you hit lvl 31 you need to go to willows but its stuck on the dialog screen when you level up on lvl 31 and the bot just gives me nulls because it cant move when i click it away the bot goes on and works fine. i tryed with this: this.dialogues.completeDialogue(); but no effect. Quote Link to comment Share on other sites More sharing options...
Woody Posted October 1, 2015 Share Posted October 1, 2015 It should ignore the level up widget... Post your code where it gets stuck Quote Link to comment Share on other sites More sharing options...
Mocro Posted October 1, 2015 Author Share Posted October 1, 2015 (edited) It should ignore the level up widget... Post your code where it gets stuck After i click the level up away it works fine this code happens then -> if(level >= 31 && this.myPosition().getY() > 3402) try{ inventory.dropAll("Oak logs"); this.localWalker.walkPath(PathWillows); }catch(Exception e){ } and if the level up dialogues is there this happend and there is no willow tree in sight so thats why the error. -> if (level >= 31){ if ((!this.inventory.isFull()) && (!myPlayer().isAnimating())) { Entity tree = this.objects.closest(11755); for (int i = 0; i < Willow.length; i++) { if(tree.isVisible() && tree.getY() == Willow[i]) try{ tree.interact("Chop Down"); status = "Cutting Willow."; sleep(random(75, 150)); }catch(Exception e){ } } } } i got it need to call it before cutting in loop :p Edited October 1, 2015 by Mocro Quote Link to comment Share on other sites More sharing options...
Woody Posted October 1, 2015 Share Posted October 1, 2015 (edited) If you fixed it, then great. However, why are you a for loop here? for (int i = 0; i < Willow.length; i++) { // why? } Also, you don't really need to try and catch when doing an action. Just make sure the object is not null. Edited October 1, 2015 by Woody 1 Quote Link to comment Share on other sites More sharing options...
Mocro Posted October 1, 2015 Author Share Posted October 1, 2015 (edited) If you fixed it, then great. However, why are you a for loop here? for (int i = 0; i < Willow.length; i++) { // why? } Also, you don't really need to try and catch when doing an action. Just make sure the object is not null. cords dont want all tree's just 2 i always use try and catch i just forgot on that one lol anyway its fixed now i put it at the first line of the loop before cutting the tree Edited October 1, 2015 by Mocro Quote Link to comment Share on other sites More sharing options...
Woody Posted October 1, 2015 Share Posted October 1, 2015 Make a filter to only get the 2 desired willow trees. I would not recommend using a for loop like you did. Btw, do you know what try & catch is for? If not, read it up and you'll then understand why you don't have to use it like you are now. Quote Link to comment Share on other sites More sharing options...
Chris Posted October 1, 2015 Share Posted October 1, 2015 GetDialoug.clickContinue Quote Link to comment Share on other sites More sharing options...
Mocro Posted October 1, 2015 Author Share Posted October 1, 2015 Make a filter to only get the 2 desired willow trees. I would not recommend using a for loop like you did. Btw, do you know what try & catch is for? If not, read it up and you'll then understand why you don't have to use it like you are now. i know what a try catch is i always use it i just forgot for that one :P can you send me a example with a filter please? never did that before Quote Link to comment Share on other sites More sharing options...
Woody Posted October 1, 2015 Share Posted October 1, 2015 (edited) i know what a try catch is i always use it i just forgot for that one can you send me a example with a filter please? never did that before Dude, I am suggesting to NOT use try & catch like how you are using it. Try something like this: RS2Object tree = getObjects().closest(new Filter<RS2Object>() { @Override public boolean match(RS2Object obj) { return obj.getPosition().equals(WILLOW_POSITION_1) || obj.getPosition().equals(WILLOW_POSITION_2); } }); then check if tree != null and do action. Play around with it and learn how to use filters; it will help you A LOT when using filters. Edited October 1, 2015 by Woody 1 Quote Link to comment Share on other sites More sharing options...
Mocro Posted October 1, 2015 Author Share Posted October 1, 2015 Dude, I am suggesting to NOT use try & catch like how you are using it. Try something like this: RS2Object tree = getObjects().closest(new Filter<RS2Object>() { @Override public boolean match(RS2Object obj) { return obj.getPosition().equals(WILLOW_POSITION_1) || obj.getPosition().equals(WILLOW_POSITION_2); } }); then check if tree != null and do action. Play around with it and learn how to use filters; it will help you A LOT when using filters. ow lmao soz why not though about the try and catch and thanks for the filter Quote Link to comment Share on other sites More sharing options...