December 11, 20196 yr 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, 20196 yr by t0r3
December 11, 20196 yr 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
December 11, 20196 yr Author 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?
December 11, 20196 yr 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
December 11, 20196 yr Author 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
December 11, 20196 yr 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.
December 11, 20196 yr 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 😛
December 11, 20196 yr 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.
December 14, 20196 yr 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, 20196 yr by BravoTaco
Create an account or sign in to comment