Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

Sign up now!

Question Interfaces.

Joined
Nov 6, 2015
Messages
583
I've been browsing around the forums looking for an answer but nothing did really help, it's about this code:

Code:
final InterfaceComponent smithInterface = Interfaces.newQuery().containers(1371).actions("Close").results().first();
if (smithInterface != null) {
    System.out.println(smithInterface.getName());
    System.out.println("Test: " + smithInterface);
    smithInterface.click();
    return State.closeSmithing;
}

I made a combat bot and it sometimes missclicks on a furnance, I want a way to let him find the interface, and if it's active it should close it, and return to combat.

Thanks in advance!
 
Community Manager
Joined
Apr 7, 2015
Messages
1,398
Do you just want to close the interface if it misclicks on it?
 
Joined
Dec 10, 2014
Messages
3,332
I've been browsing around the forums looking for an answer but nothing did really help, it's about this code:

Code:
final InterfaceComponent smithInterface = Interfaces.newQuery().containers(1371).actions("Close").results().first();
if (smithInterface != null) {
    System.out.println(smithInterface.getName());
    System.out.println("Test: " + smithInterface);
    smithInterface.click();
    return State.closeSmithing;
}

I made a combat bot and it sometimes missclicks on a furnance, I want a way to let him find the interface, and if it's active it should close it, and return to combat.

Thanks in advance!
For rs3, you could use the MakeXInterface class to check if it's open and close it. Since that's the interface in this case.
 
Last edited:
Community Manager
Joined
Apr 7, 2015
Messages
1,398
Can you show me an example?
Code:
if (MakeXInterface.isOpen()) {
  MakeXInterface.close();
}

Some shit like that, I am not at my computer though so I can't test if it's correct. Might be missing semicolons etc
 
Last edited:
Joined
Nov 6, 2015
Messages
583
Code:
if (MakeXInterface.isOpen() {
  MakeXInterface.close()
}

Some shit like that, I am not at my computer though so I can't test if it's correct. Might be missing semicolons etc
I adjusted it a bit, missed one ) and a semicolons, and now it works. Thanks gee!
 
Top