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 How to buy/sell things using interfaces?

Joined
Apr 21, 2016
Messages
2
Used Partyshankeds's advise and edited code. But script 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:
        InterfaceComponentQueryResults shoplangas = Interfaces.newQuery().texts("Auburys's Rune Shop.").results();

        if (!shoplangas.isEmpty()) {
            InterfaceComponentQueryResults validFlourInterfaces = Interfaces.newQuery().names("Fire rune").results();
            if (!validFlourInterfaces.isEmpty()) {
                InterfaceComponent flourInterface = validFlourInterfaces.first();
                if (flourInterface != null) {

                    if (flourInterface.interact("Buy 10")) {
                        Execution.delay(1200, 1600);
                        if (Menu.isOpen()) {
                            Menu.close();
                        }
                    }
                }
            }

        }

Solved in Slack Ty to Partyshanked. Can be closed now
 
Last edited:
Client Developer
Joined
Oct 12, 2015
Messages
3,781
Just a note, you can shorten this:
Code:
InterfaceComponentQueryBuilder shoplangas = Interfaces.newQuery().texts("Auburys's Rune Shop");
        InterfaceComponentQueryResults validShopInterfaces = shoplangas.results();

To:
Code:
InterfaceComponentQueryResults shoplangas = Interfaces.newQuery().texts("Auburys's Rune Shop").results();

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 :)
 
Also another note, you should join the #development chat on Slack. Normally people in there that are willing to help :)

Join Developer Chat | RuneMate
 
Top