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

Question How to use GameObjects?

Discussion in 'Developer Support' started by Seraphie, Jul 7, 2020.

  1. Seraphie

    Joined:
    Jul 2, 2020
    Messages:
    6
    Likes Received:
    0
    I'm following Snufalufugus' video guide on writing a basic treebot. He does something like the following:
    Code (Text):
    1. GameObject bankBooth = GameObjects().on(bank).names("Bank booth").actions("Bank").results().first();

    I'm getting an error whenever I try to use GameObjects(), telling me that a "Method call expected". I seem to have the correct import:
    Code (Text):
    1. import com.runemate.game.api.hybrid.region.GameObjects;

    I've tried adding newQuery():
    Code (Text):
    1. GameObject bankBooth = GameObjects().newQuery().on(bank).names("Bank booth").actions("Bank").results().first();

    I've tried adding new:
    Code (Text):
    1. GameObject bankBooth = new GameObjects().on(bank).names("Bank booth").actions("Bank").results().first();

    Nothing seems to work. I've looked at the API documentation and can't figure it out. I'm new to the API and haven't touched Java in years. What could I be doing wrong?
     
    #1 Seraphie, Jul 7, 2020
    Last edited: Jul 7, 2020
  2. MajorAlt

    Joined:
    Jun 11, 2018
    Messages:
    10
    Likes Received:
    1
    this works fine for me
    Code (Javascript):
    1. GameObject bankBooth = GameObjects.newQuery().names("Bank booth").actions("Bank").results().nearest();
     
  3. Seraphie

    Joined:
    Jul 2, 2020
    Messages:
    6
    Likes Received:
    0
    Thanks fren. Such a classic overlook. I swear I was looking at the code for half an hour and didn't notice the GameObjects was actually GameObjects() when it shouldn't have been. It's always the stupidest typos.
     

Share This Page

Loading...