t0r3 Posted December 11, 2019 Share Posted December 11, 2019 (edited) I'm back into scripting a bit, and when I'm trying one of my old scripts I can't get it to interact. I've made a ring smelting script, - this is the part where I interact with the "ringButton"-widget. When it click nothing happens! I don't understand why... RS2Widget ringButton = getWidgets().get(446,7); if (!getInventory().contains("Emerald") && getInventory().contains("Ring mould") && inventoryHasGoldBars() && ringButton != null && ringButton.interact("Make")) { sleep(random(710, 1130)); getMouse().moveOutsideScreen(); log("Smelting Gold rings, sleeps till finishedSmelting"); SleepEasy.sleepUntil(() -> !getInventory().contains("Gold bar") || getDialogues().isPendingContinuation(), 30000); } Edited December 11, 2019 by t0r3 Quote Link to comment Share on other sites More sharing options...
Chris Posted December 11, 2019 Share Posted December 11, 2019 6 minutes ago, t0r3 said: I'm back into scripting a bit, and when I'm trying one of my old scripts I can't get it to interact. I've made a ring smelting script, - this is the part where I interact with the "ringButton"-widget. When it click nothing happens! I don't understand why... RS2Widget ringButton = getWidgets().get(446,7); if (!getInventory().contains("Emerald") && getInventory().contains("Ring mould") && inventoryHasGoldBars() && ringButton != null && ringButton.interact("Make")) { sleep(random(710, 1130)); getMouse().moveOutsideScreen(); log("Smelting Gold rings, sleeps till finishedSmelting"); SleepEasy.sleepUntil(() -> !getInventory().contains("Gold bar") || getDialogues().isPendingContinuation(), 30000); } You need to find the right widget maybe 446, 7 is outdated or the wrong one. Use the client widget debugger Quote Link to comment Share on other sites More sharing options...
t0r3 Posted December 11, 2019 Author Share Posted December 11, 2019 3 minutes ago, Chris said: You need to find the right widget maybe 446, 7 is outdated or the wrong one. Use the client widget debugger I checked it It's the right one. Debugged the mouse position, and the mouse hovers over aswell, - so it finds the correct widget. Idk why it won't click it. Any ideas? Quote Link to comment Share on other sites More sharing options...
Czar Posted December 11, 2019 Share Posted December 11, 2019 If it's hovering correctly, then it can't find the specified action that you set, so in your case it is failing to interact("Make"). Try it with just an empty parameter so: .interact(); and it will automatically select the first action, or try and debug the exact option from the Widget Debugger, it may have some <col=#####> tags in there Quote Link to comment Share on other sites More sharing options...
t0r3 Posted December 11, 2019 Author Share Posted December 11, 2019 4 minutes ago, Czar said: If it's hovering correctly, then it can't find the specified action that you set, so in your case it is failing to interact("Make"). Try it with just an empty parameter so: .interact(); and it will automatically select the first action, or try and debug the exact option from the Widget Debugger, it may have some <col=#####> tags in there Thanks! It only has the option to "Make", so just using .interact() worked Why didn't it work though, so wierd haha Quote Link to comment Share on other sites More sharing options...
Czar Posted December 11, 2019 Share Posted December 11, 2019 2 minutes ago, t0r3 said: Thanks! It only has the option to "Make", so just using .interact() worked Why didn't it work though, so wierd haha My guess is that there are more characters in that string, so perhaps it is Make [diamond necklace] or something? I will double check. All I know is that I do an overkill filter of checking the string, the item id and the spellname for some reason Have you had a chance to look at the widget debugger regarding the widget action text? It's in settings -> debug -> widget debugger button -> enter 446 first box, then 7 second box, and then hit apply, it will show you the contents of that widget including actions. 1 Quote Link to comment Share on other sites More sharing options...
Rick Posted December 11, 2019 Share Posted December 11, 2019 13 minutes ago, Czar said: If it's hovering correctly, then it can't find the specified action that you set, so in your case it is failing to interact("Make"). Try it with just an empty parameter so: .interact(); and it will automatically select the first action, or try and debug the exact option from the Widget Debugger, it may have some <col=#####> tags in there that was my issue with a plough script in Hosi lol , stupid rs Quote Link to comment Share on other sites More sharing options...
Gunman Posted December 11, 2019 Share Posted December 11, 2019 1 hour ago, t0r3 said: Thanks! It only has the option to "Make", so just using .interact() worked Why didn't it work though, so wierd haha In a script of mine I have "Make Gold ring" I don't remember why but I am gonna assume it's because you have to put the entire name like that for each ring or some shit. The script is like 4 months old tho so you can try it if you want. Quote Link to comment Share on other sites More sharing options...
FuryShark Posted December 11, 2019 Share Posted December 11, 2019 "Make <col=ff9040>Emerald ring</col>" @T0r Quote Link to comment Share on other sites More sharing options...
BravoTaco Posted December 14, 2019 Share Posted December 14, 2019 (edited) If you dont care about performance you can loop through all the widgets and check the actions to see if the string contains the action than cache that widget so you dont have to re-loop when you interact with it again. IE. If widgetvar is null Loop through widgets than set the widgetvar. Else interact with the widgetvar Edited December 14, 2019 by BravoTaco Quote Link to comment Share on other sites More sharing options...