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 use GameObjects?

Joined
Jul 2, 2020
Messages
6
I'm following Snufalufugus' video guide on writing a basic treebot. He does something like the following:
Code:
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:
import com.runemate.game.api.hybrid.region.GameObjects;


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


I've tried adding new:
Code:
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?
 
Last edited:
Joined
Jun 11, 2018
Messages
10
this works fine for me
JavaScript:
GameObject bankBooth = GameObjects.newQuery().names("Bank booth").actions("Bank").results().nearest();
 
Joined
Jul 2, 2020
Messages
6
this works fine for me
JavaScript:
GameObject bankBooth = GameObjects.newQuery().names("Bank booth").actions("Bank").results().nearest();
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.
 
Top