- Joined
- Jun 20, 2015
- Messages
- 279
- Thread Author
- #1
@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);
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);