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 Bot not detecting GameObjects?

Joined
Jun 20, 2015
Messages
279
@Cloud I noticed that with my Portable Planker bot, it is no longer detecting the portable sawmill; instead, it is just hovering over it. Once I click on the GameObject (Sawmill) manually, then everything else works as expected. I have tested this a few times, and came to the conclusion that this may be a bug in the GameObject detection. Below, I have listed two different variables tested for the GameObject declaration:

GameObject sawmill = GameObjects.getLoaded("Portable sawmill").nearest();
OR
GameObject sawmill = GameObjects.newQuery().names("Portable sawmill").results().first();

I have even used the IDs in place of the names, to no avail.

Below, is the method for clicking the sawmill:


if (sawmill != null ) {
if (sawmill.isVisible() && Inventory.contains("Oak logs")) {
sawmill.interact("Make planks");
}
}

In order for it to click the sawmill, instead of sawmill.interact("Make planks");,I had to use this workaround:

sawmill.hover();
Mouse.click(Mouse.Button.LEFT);
 
Engineer
Joined
Jul 28, 2013
Messages
2,776
The fact that you can hover it and get a non-null instance proves that it's detecting it fine. In regards to it not clicking, my assumption is that you didn't type the action exactly the way that it's displayed in the menu. Use the miscellaneous tab in the dev toolkit to find out what it is exactly.
 
Joined
Jun 20, 2015
Messages
279
Is it possible that the action would have changed ? Reason I'm asking is because this all of a sudden happened.
 
Joined
Jun 20, 2015
Messages
279
That's the miscellaneous tab. I'm seeing it's the same :/ Unless my sight has failed me lol
 

Attachments

  • 12.png
    12.png
    522.8 KB · Views: 6
Top