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 2 small questions.

Joined
Nov 6, 2015
Messages
583
Hello, I am new to RuneMate but I did some coding for other bots, I will work my way here too.

I am starting on a Cooker which works at the GE.

2 things seem to not be working for now,

#1

Code:
} else if (fire.interact("Use")) {
                        Execution.delayUntil(() -> !Inventory.contains(troutID), 5000);
                    }

It says Lambda expressions are not supported at this language level.

On this line: () -> !Inventory.contains(troutID)

2#

How can I handle these dialogs which popup?

I have been looking through the Docs but I can't seem to find it, if you give me the name I can do the other research myself!

jf9aio.png


Thanks in advance!
 
Conelander
Joined
Oct 30, 2014
Messages
3,610
Go to your project settings and set the language level to 8.

You have to use interfaces to handle those dialogs, you can find their data using the SDK.
 
Conelander
Joined
Oct 30, 2014
Messages
3,610
Query the interface you need using your collected data, for example:
Code:
final InterfaceComponent button = Interfaces.newQuery().names("Dank meme").actions("Blaze").visible().results().first();


Then you can use that component just like any other interactable.
 
Joined
Nov 6, 2015
Messages
583
Where can I find the inferface names? When I open the Developer tool it's hard to see which interface is doing what.

Edit: And how can I change this? [Caution] GE Cooker is using the default loop delay of [200,400].
 
Last edited:
Joined
Nov 6, 2015
Messages
583
Thanks so far!

I have been really getting along, only this is still not working:

Code:
final InterfaceComponent cookInterface = Interfaces.newQuery().containers(1179).results().first();
                        if (cookInterface != null) {
                            System.out.println("Test");
                            cookInterface.click(); //interact() if you know the action
                        }

Yes, 1179 is the correct container!
 
Conelander
Joined
Oct 30, 2014
Messages
3,610
Thanks so far!

I have been really getting along, only this is still not working:

Code:
final InterfaceComponent cookInterface = Interfaces.newQuery().containers(1179).results().first();
                        if (cookInterface != null) {
                            System.out.println("Test");
                            cookInterface.click(); //interact() if you know the action
                        }

Yes, 1179 is the correct container!
A container usually contains multiple components and you're simply picking the first in it, which might not be the one you need. It's not recommended to use the container ids, but rather names, actions, or even dimensions.
 
Joined
Nov 6, 2015
Messages
583
Okay so I tried it by name:

fm5gk3.png


Code:
final InterfaceComponent cookInterface = Interfaces.newQuery().textContains("Cook").results().first();
            if (cookInterface != null) {
                System.out.println("Cook dialog opened");
                if(cookInterface.interact("Cook"))
                {
                    System.out.println("Cook was clicked");
                }
                else
                {
                    System.out.println("Cook wasn't clicked");
                }
            }

Code:
(10:31:19) Trout found! Looking for a fire!
(10:31:19) Cook dialog opened
(10:31:20) Cook wasn't clicked

Still hasn't clicked it.

EDIT:

If I change .interact with .click() it says it's clicked but he hasn't clicked it.
 
Last edited:
Conelander
Joined
Oct 30, 2014
Messages
3,610
Okay so I tried it by name:

fm5gk3.png


Code:
final InterfaceComponent cookInterface = Interfaces.newQuery().textContains("Cook").results().first();
            if (cookInterface != null) {
                System.out.println("Cook dialog opened");
                if(cookInterface.interact("Cook"))
                {
                    System.out.println("Cook was clicked");
                }
                else
                {
                    System.out.println("Cook wasn't clicked");
                }
            }

Code:
(10:31:19) Trout found! Looking for a fire!
(10:31:19) Cook dialog opened
(10:31:20) Cook wasn't clicked

Still hasn't clicked it.

EDIT:

If I change .interact with .click() it says it's clicked but he hasn't clicked it.
The contained item of the interface contains the text "Cook", not the interface itself.
 
Joined
Nov 6, 2015
Messages
583
Could you please put down 1 good example?

I have been struggeling with this for the entire day.
 
Close this moved on a new project!
 
Top