Jump to content

Can't interact with smelting widget


Recommended Posts

Posted (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 by t0r3
Posted
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

Posted
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?

Posted

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: 

Posted
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

Posted
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
Posted
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 😛 

Posted
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.

Posted (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 by BravoTaco

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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