Question Interfaces.

Discussion in 'Developer Support' started by Constantijn Floris, Oct 5, 2016.

  1. I've been browsing around the forums looking for an answer but nothing did really help, it's about this code:

    Code (Text):
    1. final InterfaceComponent smithInterface = Interfaces.newQuery().containers(1371).actions("Close").results().first();
    2. if (smithInterface != null) {
    3.     System.out.println(smithInterface.getName());
    4.     System.out.println("Test: " + smithInterface);
    6.     return State.closeSmithing;
    7. }
    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!
  2. Do you just want to close the interface if it misclicks on it?
  3. 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.
    #4 SlashnHax, Oct 5, 2016
    Last edited: Oct 5, 2016
  4. Couldn't you have let me answer the one question I could have? damnit slash
  5. Yes, I want it to close it.

    Can you show me an example?
  6. Code (Text):
    1. if (MakeXInterface.isOpen()) {
    2.   MakeXInterface.close();
    3. }
    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
    #7 Gengsta, Oct 5, 2016
    Last edited: Oct 5, 2016
  7. I adjusted it a bit, missed one ) and a semicolons, and now it works. Thanks gee!
  8. Gl with your bot m8 :>

Share This Page