Question 2 small questions.

Discussion in 'Developer Support' started by Constantijn Floris, Nov 10, 2015.

  1. 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,


    Code (Text):
    1. } else if (fire.interact("Use")) {
    2.                         Execution.delayUntil(() -> !Inventory.contains(troutID), 5000);
    3.                     }
    It says Lambda expressions are not supported at this language level.

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


    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!


    Thanks in advance!
  2. 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.
  3. Could you show me an example with how you handle interfaces? It's kinda though.
  4. Query the interface you need using your collected data, for example:
    Code (Text):
    1. final InterfaceComponent button = Interfaces.newQuery().names("Dank meme").actions("Blaze").visible().results().first();

    Then you can use that component just like any other interactable.
  5. 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].
    #5 Constantijn Floris, Nov 10, 2015
    Last edited: Nov 10, 2015
  6. setLoopDelay()
  7. Thanks so far!

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

    Code (Text):
    1. final InterfaceComponent cookInterface = Interfaces.newQuery().containers(1179).results().first();
    2.                         if (cookInterface != null) {
    3.                             System.out.println("Test");
    4.                   ; //interact() if you know the action
    5.                         }
    Yes, 1179 is the correct container!
  8. 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.
  9. Okay so I tried it by name:


    Code (Text):
    1. final InterfaceComponent cookInterface = Interfaces.newQuery().textContains("Cook").results().first();
    2.             if (cookInterface != null) {
    3.                 System.out.println("Cook dialog opened");
    4.                 if(cookInterface.interact("Cook"))
    5.                 {
    6.                     System.out.println("Cook was clicked");
    7.                 }
    8.                 else
    9.                 {
    10.                     System.out.println("Cook wasn't clicked");
    11.                 }
    12.             }
    Code (Text):
    1. (10:31:19) Trout found! Looking for a fire!
    2. (10:31:19) Cook dialog opened
    3. (10:31:20) Cook wasn't clicked
    Still hasn't clicked it.


    If I change .interact with .click() it says it's clicked but he hasn't clicked it.
    #9 Constantijn Floris, Nov 10, 2015
    Last edited: Nov 10, 2015
  10. The contained item of the interface contains the text "Cook", not the interface itself.
  11. Could you please put down 1 good example?

    I have been struggeling with this for the entire day.
    --- Double Post Merged, Nov 11, 2015, Original Post Date: Nov 10, 2015 ---
    Close this moved on a new project!

Share This Page