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 How to interact with Furnace interface ?

Joined
Jul 3, 2020
Messages
4
Hello im trying to make emerald necklace at furnace. After i click smelt on furnace i dont know how to click on option Make Emerald necklace.

upload_2020-7-4_15-12-4.png

public void execute() {

if(!Menu.isOpen()) {
Menu.open();
//InterfaceComponent furnaceInterface = Interfaces.newQuery().containers().actions("Emerald necklace").results().first();
final InterfaceComponent furnaceInterface = Interfaces.newQuery().actions("Emerald necklace").results().first();
getLogger().info("Found interfaces: " +furnaceInterface);

if (furnaceInterface != null)
furnaceInterface.click(); //tried .interact("Emerald necklace etc./Make")
else
getLogger().info("FurnaceInterface is null!");

}

I tried many queries not just with .actions but also texts(), tried to find "Make", "Make Emerald Necklace", "Emerald necklace" but i still gets null. Can someone please help ? Should i use different approach than InterfaceComponent? There is no viable learning video except the tree bot that i watched, because every other is outdated. And it also seems like this forum is not very alive. I hope my experience with RuneMate will get better. Thanks for help in advance.
 
big loser
Joined
Apr 13, 2020
Messages
51
If you're having troubles querying an interface, I recommend making use of either the DevKit++ bot on the botstore, or RuneLite's developer tools Widget Inspector. These will allow you to scan for interfaces and highlight components on your game screen when you select them in the interface explorer.

Using DevKit++ I managed to find the interface you are using, and the container ID is 446:

upload_2020-7-4_15-50-6.png

The interface explorer will provide information about the component:

upload_2020-7-4_15-51-12.png

You can then use this information to narrow down your search and make querying easier (with a filter, for example).

In your case, you might use the container ID to start off with, and then filter the components in that container to find the one you're looking for. You might use an action, text, spriteID, etc. You can use the index/ID, but I would try to avoid it if you can, because if the interface gets modified (which happens time to time), your bot might break. In some cases you might have to if the components are too similar.

Code:
InterfaceComponent makeEmeraldNecklace = Interfaces.newQuery().containers(446).filter(e -> e != null && e.getActions() != null && e.getActions().contains("Make Emerald necklace")).results().first();

Then you would null check and perhaps more importantly check visibility before going on to do any interaction. Sometimes an InterfaceComponent might 'exist' (not null), but won't be open/visible so a .isVisible() check should avoid any issues.

On a side note I'm unsure what you were trying to achieve with the Menu.isOpen() ... Menu.Open() code since that is to do with the right-click context menu not the furnace interface.

I hope this helped.

Edit: You should also try the discord or slack #development channels for help with stuff like this. I find it's more useful generally.
 
Last edited:
Joined
Jul 3, 2020
Messages
4
Thanks for the reply ill try that at home. I tried the development menu but i could not figure out how to find that interface Components since there was too many of them. I was trying furnace in edgeville
 
big loser
Joined
Apr 13, 2020
Messages
51
Thanks for the reply ill try that at home. I tried the development menu but i could not figure out how to find that interface Components since there was too many of them. I was trying furnace in edgeville
I was also using that furnace. You can use the filtering feature on the right side of the interface explorer to find the one you're after. For example if you searched for "Make" in the filter that container would probably pop up. Otherwise, you might just have to open each container and select a component until you see your interface highlighted in-game. Be sure to toggle the overlay on when you first start DevKit++.
 
Joined
Jul 3, 2020
Messages
4
If you're having troubles querying an interface, I recommend making use of either the DevKit++ bot on the botstore, or RuneLite's developer tools Widget Inspector. These will allow you to scan for interfaces and highlight components on your game screen when you select them in the interface explorer.

Using DevKit++ I managed to find the interface you are using, and the container ID is 446:

View attachment 10593

The interface explorer will provide information about the component:

View attachment 10594

You can then use this information to narrow down your search and make querying easier (with a filter, for example).

In your case, you might use the container ID to start off with, and then filter the components in that container to find the one you're looking for. You might use an action, text, spriteID, etc. You can use the index/ID, but I would try to avoid it if you can, because if the interface gets modified (which happens time to time), your bot might break. In some cases you might have to if the components are too similar.

Code:
InterfaceComponent makeEmeraldNecklace = Interfaces.newQuery().containers(446).filter(e -> e != null && e.getActions() != null && e.getActions().contains("Make Emerald necklace")).results().first();

Then you would null check and perhaps more importantly check visibility before going on to do any interaction. Sometimes an InterfaceComponent might 'exist' (not null), but won't be open/visible so a .isVisible() check should avoid any issues.

On a side note I'm unsure what you were trying to achieve with the Menu.isOpen() ... Menu.Open() code since that is to do with the right-click context menu not the furnace interface.

I hope this helped.

Edit: You should also try the discord or slack #development channels for help with stuff like this. I find it's more useful generally.

Hi i tried your code and it works thanks. But i have another issue idk if i can continue here in this post but i tried to set execution.DelayUntil like this:
Code:
    if(makeEmeraldNecklace.click()){
        Execution.delayUntil(() -> Inventory.getItems("Emerald necklace").size() == 13, 1000, 4000);
    }

To delay until i have 13 necklaces in inventory but it doesnt work at all. It keeps running the code and tries to click on the furnace again (start of the code) and it cancels the animation. So it keeps looping.
 
big loser
Joined
Apr 13, 2020
Messages
51
Hi i tried your code and it works thanks. But i have another issue idk if i can continue here in this post but i tried to set execution.DelayUntil like this:
Code:
    if(makeEmeraldNecklace.click()){
        Execution.delayUntil(() -> Inventory.getItems("Emerald necklace").size() == 13, 1000, 4000);
    }

To delay until i have 13 necklaces in inventory but it doesnt work at all. It keeps running the code and tries to click on the furnace again (start of the code) and it cancels the animation. So it keeps looping.

Firstly, you can use Inventory.getQuantity("Emerald necklace") to avoid having to directly handle a Collection.

Secondly, your time-out is too short. What your delay line is doing is waiting for your inventory to contain 13 necklaces, and if it doesn't within 1-4 seconds, the delay will "time out" (fail), and the bot will continue (which is what's causing it to click again).

To fix, you can either simply increase the timeout to slightly more than the average time it takes to make the inventory, let's say 30 seconds or whatever. So you'd change 1000, 4000 to 30000, 35000. However, a better way might be to 'reset' the time-out with a condition. In this case, a sensible condition would be the player performing the emote for making the necklace. So your delay might look like this:

Code:
Execution.delayUntil(() -> Inventory.getQuantity("Emerald necklace") == 13, () -> Players.getLocal().getAnimationId() == CRAFT_ANIM, 3000, 5000);

So the bot will delay until you have 13 necklaces, but will stop if it has been delayed for 3-5 seconds since the last craft animation (each animation will reset the 3-5 sec timeout to 0).

Edit: You can use a devkit or runelite's player debugger to determine the craft anim.

Good luck!
 
Joined
Jul 3, 2020
Messages
4
Firstly, you can use Inventory.getQuantity("Emerald necklace") to avoid having to directly handle a Collection.

Secondly, your time-out is too short. What your delay line is doing is waiting for your inventory to contain 13 necklaces, and if it doesn't within 1-4 seconds, the delay will "time out" (fail), and the bot will continue (which is what's causing it to click again).

To fix, you can either simply increase the timeout to slightly more than the average time it takes to make the inventory, let's say 30 seconds or whatever. So you'd change 1000, 4000 to 30000, 35000. However, a better way might be to 'reset' the time-out with a condition. In this case, a sensible condition would be the player performing the emote for making the necklace. So your delay might look like this:

Code:
Execution.delayUntil(() -> Inventory.getQuantity("Emerald necklace") == 13, () -> Players.getLocal().getAnimationId() == CRAFT_ANIM, 3000, 5000);

So the bot will delay until you have 13 necklaces, but will stop if it has been delayed for 3-5 seconds since the last craft animation (each animation will reset the 3-5 sec timeout to 0).

Edit: You can use a devkit or runelite's player debugger to determine the craft anim.

Good luck!
I did thank you very much. I did not fully understood the delayUntil thanks for clarification. Again one step closer thanks again.
 
Top