Teamwork Posted June 2, 2022 Share Posted June 2, 2022 Hello guys, I'm currently trying to code a script to craft gold necklace at a furnace and need some help. The problem is that my script can't seem to get a hold of the gold necklace widget. Here's the code. private int goldBarID = 2357; private int goldNecklaceID = 1654; RS2Widget furnaceCraftWidget = getWidgets().singleFilter(446 , rs2Widget -> rs2Widget != null && rs2Widget.getItemId() == goldNecklaceID); if (furnaceCraftWidget != null) { log("test"); } if (furnaceCraftWidget != null && furnaceCraftWidget.interact("Make")) { log("it works"); new ConditionalSleep(90000) { @Override public boolean condition() { return !inventory.contains(goldBarID) || getDialogues().isPendingContinuation(); } }.sleep(); } At first I thought it might be the interact method that didn't work so I added the first test to check if I could get a hold of any widget at all but still nothing prints to the logger. The other thing I tried is using this instead of the singleFilter function RS2Widget furnaceCraftWidget = getWidgets().get(446, 22); But even by using childID i couldn't get a hold of the right widget. Only "test" printed in the logger, but the script didn't interact to craft gold necklaces. When I tried this I also got this error with many more all related to awt and swing which I am not using. Unless it's the in game interface that is using awt and swing? ERROR][06/02 05:19:55 PM]: Uncaught exception! java.awt.IllegalComponentStateException: component must be showing on the screen to determine its location I tried searching on the forum and couldn't find anything to understand what I'm doing wrong. Thanks for the help guys. Quote Link to comment Share on other sites More sharing options...
abc3 Posted June 3, 2022 Share Posted June 3, 2022 If you use the widget debugger, you'll find it's child ID 23 not 22 Quote Link to comment Share on other sites More sharing options...
Teamwork Posted June 3, 2022 Author Share Posted June 3, 2022 Wow I didn't know that debugger existed thanks a lot. I tried 23 also and it only printed "test", but the debugger listed the action as "Make Gold necklace" and not just "Make" like I initially thought so changing this fixed it. I'll figure something so I don't have to hard code all the values though. Thanks Quote Link to comment Share on other sites More sharing options...
Czar Posted June 3, 2022 Share Posted June 3, 2022 Slightly unrelated but a quick tip: you could optionally do myWidget.interact(); and give no parameters to select the first option that it has, can help in some situations 1 Quote Link to comment Share on other sites More sharing options...
Teamwork Posted June 3, 2022 Author Share Posted June 3, 2022 3 hours ago, Czar said: Slightly unrelated but a quick tip: you could optionally do myWidget.interact(); and give no parameters to select the first option that it has, can help in some situations Thanks I'll keep that in mind, it could be a potential fix for some things later on haha. Quote Link to comment Share on other sites More sharing options...