- Joined
- Aug 20, 2020
- Messages
- 1
- Thread Author
- #1
Hi guys, so I've been working on a gold bracelet making bot. Here is the function used to smelt once the bot has detected a full inventory of gold bars and a mould:
public void execute() {
GameObject furnace = GameObjects.newQuery().within(furnace_area).names("Furnace").results().nearest();
System.out.println(furnace);
if (furnace != null) {
if (furnace.isVisible()) {
furnace.interact("Smelt");
InterfaceComponent makegoldbracelet = Interfaces.getAt(446, 46);
if (makegoldbracelet.click()) {
Execution.delayUntil(() -> Inventory.getQuantity("Gold bracelet") == 27, 30000, 50000);
}
}
}
}
}
I keep getting a null pointed exception which I think is the fact that the makegoldbracelet variable is null until the interface is opened. How do I delay until the furnace interface is open? The bank has the .isOpen() function but I'm not sure how to apply that in this situation.
Many thanks.
public void execute() {
GameObject furnace = GameObjects.newQuery().within(furnace_area).names("Furnace").results().nearest();
System.out.println(furnace);
if (furnace != null) {
if (furnace.isVisible()) {
furnace.interact("Smelt");
InterfaceComponent makegoldbracelet = Interfaces.getAt(446, 46);
if (makegoldbracelet.click()) {
Execution.delayUntil(() -> Inventory.getQuantity("Gold bracelet") == 27, 30000, 50000);
}
}
}
}
}
I keep getting a null pointed exception which I think is the fact that the makegoldbracelet variable is null until the interface is opened. How do I delay until the furnace interface is open? The bank has the .isOpen() function but I'm not sure how to apply that in this situation.
Many thanks.