1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Resolved How to check for open interface?

Discussion in 'Client & Site Support' started by Rambo501, Jan 12, 2019.

  1. Rambo501

    Joined:
    Dec 24, 2018
    Messages:
    28
    Likes Received:
    2
    Let's say I wanted to detect this interface.

    [​IMG]

    This is what I tried:

    interface = Interfaces.newQuery().texts("Congratulations").results().first();

    But it just returns null, while being logged in with the above interface visible. What am I doing wrong here? Do ChatboxInterfaces use a different class?

     
  2. Best Answer:
    Post #4 by Gengsta, Jan 13, 2019
  3. Wet Rag

    Wet Rag easily triggered ✌

    Joined:
    Dec 31, 2015
    Messages:
    4,449
    Likes Received:
    1,692
    Try interface components
     
  4. Rambo501

    Joined:
    Dec 24, 2018
    Messages:
    28
    Likes Received:
    2
    That's... what I'm doing? What do you mean exactly?
     
  5. Gengsta

    Gengsta Community Manager

    Joined:
    Apr 7, 2015
    Messages:
    1,392
    Likes Received:
    763
    You'd have to get the full text for the component if you want to use .texts, try using .textContains instead.
    Also you should get the type of component for speed/efficiency with your querys.
     
    Rambo501 likes this.
  6. Rambo501

    Joined:
    Dec 24, 2018
    Messages:
    28
    Likes Received:
    2
    Thanks! Works perfectly.
     
  7. Jhinn

    Joined:
    Jun 9, 2015
    Messages:
    3,643
    Likes Received:
    1,337
    If you're specifically looking for that interface, you can use:
    Code (Text):
    1. ChatDialog.getContinue()
    ChatDialog

    If not, you can do what the others suggested.
     
    #6 Jhinn, Jan 13, 2019
    Last edited: Jan 13, 2019
    Rambo501 likes this.
  8. Gengsta

    Gengsta Community Manager

    Joined:
    Apr 7, 2015
    Messages:
    1,392
    Likes Received:
    763
    He said in his first post, "Let's say I wanted to detect this interface.". So I was pretty sure this was a question about interfaces in general, not just ChatDialog.
     
  9. Jhinn

    Joined:
    Jun 9, 2015
    Messages:
    3,643
    Likes Received:
    1,337
    .
     
    #8 Jhinn, Jan 13, 2019
    Last edited: Jan 13, 2019
  10. Makutu

    Makutu The Omen

    Joined:
    Dec 27, 2018
    Messages:
    159
    Likes Received:
    132
    I can think of two reasons as to why you are looking to detect this interface.

    1) If your intention is to notify the user of a level up and extra the information from that notification then you should look at querying via the Interfaces api. By doing a new query with the interface container, type, and actions (if appropriate), you can extra the exact component you wish to find.

    2) If you're interested in finding this interface so that you can continue skilling, your best bet is to use the ChatDialog api, more specifically the ChatDialog#getContinue method. This returns the component that can be interacted with in order progress through the dialog by calling ChatDialog.Continue#select on it.
     
    Rambo501 likes this.
  11. auxi

    Joined:
    May 24, 2016
    Messages:
    1,113
    Likes Received:
    990
    MVP.
     
    A Savage likes this.
  12. Rambo501

    Joined:
    Dec 24, 2018
    Messages:
    28
    Likes Received:
    2
    Not specifically, but this is really helpful as well! Thank you.
    ChatDialog.getContinue() returns a Continue object, I assume you can cast this to InterfaceComponent? It doesn't help that there isn't much explanation in the API.
    --- Double Post Merged, Jan 13, 2019, Original Post Date: Jan 13, 2019 ---
    It was a question in general, but his suggestion is still very welcome.
    --- Double Post Merged, Jan 13, 2019 ---
    I was mostly just wondering what I was doing wrong with my interfaces query, but yeah the goal was to continue skilling after leveling up. This is great to know! Thanks for the explanation.
     

Share This Page

Loading...