KMW 0 Posted December 21, 2017 GameObject chest = getGameObjects().closest("Bank chest"); Hi, FIrst ever time trying to script (well thats not some boring SQL for analysis), been following some guides on here but have fallen at what i imagine is a very simple step. The above code gets the error: "GameObject cannot be resolved to a type" Seen everyone uses it so don't understand what is going on. Have the client.jar as the referenced library and all that. Any help greatly appreciated.
Veelo 0 Posted September 26, 2018 Hate to dig up old threads but I'm still having the same issue with the following code: GameObject stall = getGameObjects().getClosest("Tea stall"); .getClosest is underlined in red, and when hovered over it reads: The method getClosest(String) is undefined for the type GameObjects I've made sure that it is imported by using the following code as you said, yet to no avail. Import org.dreambot.api.wrappers.interactive.GameObject; Also getting the same error for: getInventory().dropItem("Cup of tea"); Says: The method dropItem(String) is undefined for the type Inventory. Any help would be so appreciated.
Empyrean GB 7 Posted October 12, 2018 It's because there is no method .getClosest(string) so your "Tea stall" parameter is invallid. Try: GameObject stall = source.getGameObjects().closest(object -> object != null && object.hasAction("Steal")); or find the propper method on object to find by name: for that you can try: GameObject stall = source.getGameObjects().closest(object -> object != null && object.getName().equals("Tea stall")); didn't use it that way yet though so you will have to test
Recommended Posts
Archived
This topic is now archived and is closed to further replies.