Jump to content
View in the app

A better way to browse. Learn more.

OSBot :: 2007 OSRS Botting

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

When you level Wc Stuck.

Featured Replies

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.

It should ignore the level up widget... Post your code where it gets stuck

  • Author

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 by Mocro

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 by Woody

  • Author

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 by Mocro

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.

  • Author

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

i know what a try catch is i always use it i just forgot for that one tongue.png

 

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 by Woody

  • Author

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 :)

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.