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

Question How to buy/sell things using interfaces?

Discussion in 'Developer Support' started by TheFollow3r, May 5, 2016.

  1. TheFollow3r

    Joined:
    Apr 21, 2016
    Messages:
    2
    Likes Received:
    0
    Used Partyshankeds's advise and edited code. But script bot still dont buy things. I noticed that he tries target NPC behind shop interface and open it again. So maybe there is problem with opening the shop?
    Code (Text):
    1.  
    2.  
    3.      
    4.         InterfaceComponentQueryResults shoplangas = Interfaces.newQuery().texts("Auburys's Rune Shop.").results();
    5.  
    6.         if (!shoplangas.isEmpty()) {
    7.             InterfaceComponentQueryResults validFlourInterfaces = Interfaces.newQuery().names("Fire rune").results();
    8.             if (!validFlourInterfaces.isEmpty()) {
    9.                 InterfaceComponent flourInterface = validFlourInterfaces.first();
    10.                 if (flourInterface != null) {
    11.  
    12.                     if (flourInterface.interact("Buy 10")) {
    13.                         Execution.delay(1200, 1600);
    14.                         if (Menu.isOpen()) {
    15.                             Menu.close();
    16.                         }
    17.                     }
    18.                 }
    19.             }
    20.  
    21.         }
    22.  
    Solved in Slack Ty to Partyshanked. Can be closed now
     
    #1 TheFollow3r, May 5, 2016
    Last edited: May 5, 2016
  2. Party

    Party Client Developer

    Joined:
    Oct 12, 2015
    Messages:
    3,708
    Likes Received:
    1,606
    Just a note, you can shorten this:
    Code (Text):
    1. InterfaceComponentQueryBuilder shoplangas = Interfaces.newQuery().texts("Auburys's Rune Shop");
    2.         InterfaceComponentQueryResults validShopInterfaces = shoplangas.results();
    To:
    Code (Text):
    1. InterfaceComponentQueryResults shoplangas = Interfaces.newQuery().texts("Auburys's Rune Shop").results();
    2.  
    Also the issue is the typo in Auburys's Rune Shop. It's Aubury's, and because those results are not returning anything, the rest of the query won't execute :)
    --- Double Post Merged, May 5, 2016, Original Post Date: May 5, 2016 ---
    Also another note, you should join the #development chat on Slack. Normally people in there that are willing to help :)

    Join Developer Chat | RuneMate
     

Share This Page

Loading...