Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

Sign up now!

Resolved Not interacting with nearest object

Author of MaxiBots
Joined
Dec 3, 2013
Messages
7,032
Screenshot 2016-03-04 21.20.34.png

It tried to interact with the tree in the circle by clicking where the red x is, when there was clearly a much closer tree... @Cloud
 
Author of MaxiBots
Joined
Dec 3, 2013
Messages
7,032
Varrock west near the oak trees. Pretty simple really. Don't know if it's easy to replicate or not.
Code:
GameObjects.newQuery().names("Tree").actions("Chop down", "Chop").surroundingsReachable().within(
new Area.Rectangular(new Coordinate(3160, 3387), new Coordinate(3173, 3418))
).results().nearest().interact("Chop down"(or Chop depending on the thing you're chopping))
 
Engineer
Joined
Jul 28, 2013
Messages
2,776
If it was going after the other tree then it is likely because the "base position" or center coordinate was closer or the same distance (if same distance, then player sense is used as the tie breaker)
 
Mod Automation
Joined
Jul 26, 2013
Messages
3,053
If it was going after the other tree then it is likely because the "base position" or center coordinate was closer or the same distance (if same distance, then player sense is used as the tie breaker)
Taking a north oriented screenshot would help deduce if that is the case @Aidden.
 
Author of MaxiBots
Joined
Dec 3, 2013
Messages
7,032
So here you can see that the tree it went for is clearly further away. I tried it again while i was there and again it went for a tree other than the one it should have. This is shown in the second image. In both images it went for the circled tree on the right.Screenshot 2016-03-07 10.27.32.png Screenshot 2016-03-07 10.32.27.png
 
If it was going after the other tree then it is likely because the "base position" or center coordinate was closer or the same distance (if same distance, then player sense is used as the tie breaker)
These are normal trees which only have an area of 1x1
 
Top