Jump to content

Can't interact with smelting widget


t0r3

Recommended Posts

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 by t0r3
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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 :doge: 

Link to comment
Share on other sites

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 :doge: 

Thanks! It only has the option to "Make", so just using .interact() worked :D Why didn't it work though, so wierd haha

Link to comment
Share on other sites

2 minutes ago, t0r3 said:

Thanks! It only has the option to "Make", so just using .interact() worked :D 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 :doge: 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.

  • Like 1
Link to comment
Share on other sites

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 :doge: 

that was my issue with a plough script in Hosi lol , stupid rs 😛 

Link to comment
Share on other sites

1 hour ago, t0r3 said:

Thanks! It only has the option to "Make", so just using .interact() worked :D 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.

Link to comment
Share on other sites

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 by BravoTaco
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...