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.

avoiding Ent?

Featured Replies

Anyone have a snippet to find an Ent (random wcing tree that damages your axe) and avoid it?

 

I tried many different ideas of how to make this work, they never seemed to be successful. Any suggestions?

 

 

 

 

 

 

 

EDIT: DUE TO A LAG, THIS WAS POSTED 3 TIMES. I APOLOGIZE.

Edited by filestealer

if (!myPlayer().isAnimating() || (myPlayer().getFacing() != null && !myPlayer().isUnderAttack())) {

}

Just place your woodcutting method inside there.

Edited by Illumi

What is the name of the ent, is it "Ent"?

 

Just do something like this:

 

 

if(myPlayer().getFacing() != null) {

if(myPlayer().getFacing().getName().equals("Ent") {

//chop a new tree

}

}

 

  • Author

What is the name of the ent, is it "Ent"?

 

Just do something like this:

 

 

if(myPlayer().getFacing() != null) {

if(myPlayer().getFacing().getName().equals("Ent") {

//chop a new tree

}

}

Thanks

What is the name of the ent, is it "Ent"?

 

Just do something like this:

 

 

if(myPlayer().getFacing() != null) {

if(myPlayer().getFacing().getName().equals("Ent") {

//chop a new tree

}

}

The name does not change.

  • Author

What is the name of the ent, is it "Ent"?

 

Just do something like this:

 

 

if(myPlayer().getFacing() != null) {

if(myPlayer().getFacing().getName().equals("Ent") {

//chop a new tree

}

}

Actually this did not work due to the fact that the name of the ent is the same as the tree.

  • Author
if (!myPlayer().isAnimating() || (myPlayer().getFacing() != null && !myPlayer().isUnderAttack())) {

}

Just place your woodcutting method inside there.

 

 

How would this fix the problem? The ent doesnt put you in combat. It just breaks your axe if you continue to try and chop it, and this does not identify if you are facing the ent or not.

 

What is the name of the ent, is it "Ent"?

 

Just do something like this:

 

 

if(myPlayer().getFacing() != null) {

if(myPlayer().getFacing().getName().equals("Ent") {

//chop a new tree

}

}

Actually this did not work due to the fact that the name of the ent is the same as the tree.

 

Okay well the ent is an NPC not an RSObject right? (yellow text instead of blue) so try:

 

if(myPlayer().getFacing() != null) {
if(myPlayer().getFacing().getName().equals("Tree") && myPlayer().getFacing() instanceof NPC) ) {
//chop a new tree
}
}
  • Author

 

 

What is the name of the ent, is it "Ent"?

 

Just do something like this:

 

 

if(myPlayer().getFacing() != null) {

if(myPlayer().getFacing().getName().equals("Ent") {

//chop a new tree

}

}

Actually this did not work due to the fact that the name of the ent is the same as the tree.

 

Okay well the ent is an NPC not an RSObject right? (yellow text instead of blue) so try:

 

if(myPlayer().getFacing() != null) {
if(myPlayer().getFacing().getName().equals("Tree") && myPlayer().getFacing() instanceof NPC) ) {
//chop a new tree
}
}

 

 

The text becomes yellow whenever the tree becomes an ent

 

using this code, i got an 2 errors

 

NPC cannot be resolved to a type

Incompatible conditional operand types Character<capture#3-of ?>

 

 

Edited by filestealer

 

 

 

What is the name of the ent, is it "Ent"?

 

Just do something like this:

 

 

if(myPlayer().getFacing() != null) {

if(myPlayer().getFacing().getName().equals("Ent") {

//chop a new tree

}

}

Actually this did not work due to the fact that the name of the ent is the same as the tree.

 

Okay well the ent is an NPC not an RSObject right? (yellow text instead of blue) so try:

 

if(myPlayer().getFacing() != null) {
if(myPlayer().getFacing().getName().equals("Tree") && myPlayer().getFacing() instanceof NPC) ) {
//chop a new tree
}
}

 

 

The text becomes yellow whenever the tree becomes an ent

 

Then it is an NPC and the code I posted should work.

  • Author

 

 

 

 

What is the name of the ent, is it "Ent"?

 

Just do something like this:

 

 

if(myPlayer().getFacing() != null) {

if(myPlayer().getFacing().getName().equals("Ent") {

//chop a new tree

}

}

Actually this did not work due to the fact that the name of the ent is the same as the tree.

 

Okay well the ent is an NPC not an RSObject right? (yellow text instead of blue) so try:

 

if(myPlayer().getFacing() != null) {
if(myPlayer().getFacing().getName().equals("Tree") && myPlayer().getFacing() instanceof NPC) ) {
//chop a new tree
}
}

 

 

The text becomes yellow whenever the tree becomes an ent

 

Then it is an NPC and the code I posted should work.

 

 

using this code, i got an 2 errors

 

NPC cannot be resolved to a type

Incompatible conditional operand types Character<capture#3-of ?>

 

I appreciate any help, I have been coding java for just over a year now, im just unfamiliar with osbot methods. I have coded about 12 basic scripts over the course of about 2 weeks of learning how to code on osbot. So any methods you can teach me to help figure this out would be very much appreciated.

Edited by filestealer

I did a bit of testing and it looks like the noun colour is the colour of the text and "<col=ffff00>" is the yellow colour and so we can use this to see if it is an NPC.

 

if(myPlayer().getFacing() != null) {
if(myPlayer().getFacing().getName().equals("Tree") && myPlayer().getFacing().nounColour().equals("<col=ffff00>"))  {
//chop a new tree
}
}

 

Edited by Diclonius

  • Author

Thank you so much for your help, I will monitor it and see how it works in the situation. I appreciate all your help.

Guest
This topic is now closed to further replies.

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.