Jump to content

interacting with interface


Recommended Posts

Posted

 i looked up some posts but still couldnt get it to work

case CRAFT:
			if (!smeltarea.contains(myPlayer().getPosition())) {
				getWalking().webWalk(smeltarea);
			} else {	
				RS2Object Furnace = getObjects().closest("Furnace");
				RS2Widget smeltinterface = widgets.get(446, 1);
				if (smeltinterface != null && smeltinterface.isVisible()) {
					smeltinterface.interact("Make-All");
				} else {
					if (Furnace != null && Furnace.exists()) {
						Furnace.interact("Smelt");
					}
				}
			}
			break;

then i tried something like "RS2Object kek = widgets.getWidgetContainingText("Make-All")"

then kek.interact("Make-All" etc etc doesnt work.... (IM TRYING TO SMELT GOLD BARS INTO GOLD RINGS IN AL-KHARID"

Posted (edited)
1 hour ago, Deceiver said:

add the 2 classes, just copy n paste them.

then follow the example tom put and change it to what ur doing when u interact with the furnace :)

okay! added them like this: 

https://ibb.co/ebdOx7

then got this: 

https://ibb.co/iJxDVS

and in the actual .java file where my script is written i get this:

https://ibb.co/mxXGH7

.......................................... 

why doesn't this interaction work? why is all this shittt needed

				RS2Widget smeltinterface = widgets.get(446, 1);
				smeltinterface.interact("Make-All");

 

Edited by alkku15
Posted (edited)
2 hours ago, alkku15 said:

okay! added them like this: 

https://ibb.co/ebdOx7

then got this: 

https://ibb.co/iJxDVS

and in the actual .java file where my script is written i get this:

https://ibb.co/mxXGH7

.......................................... 

why doesn't this interaction work? why is all this shittt needed


				RS2Widget smeltinterface = widgets.get(446, 1);
				smeltinterface.interact("Make-All");

 

idk man i tried it myself too before i added it  and its like it doesnt exist really

 

edit; for the fix change it to this in utilwidget;

public static RS2Widget getWidget(Script i, String action, String spellName) {
        List<RS2Widget> widg = i.getWidgets().filter(new WidgetActionFilter(action), new WidgetSpellFilter(spellName));
        if (widg != null) {
            return widg.get(0);
        }
        return null;
    }

 

Edited by Deceiver

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