Florg 0 Posted November 29, 2023 I wasn't able to find an existing API for interacting with the World Map -- likely because it isn't exactly a necessary bot action. I've been implementing my own API via interacting with the widgets, but I've run into a little trouble. Things work for now, but I'm thinking it is mostly by luck in that the internal ordering of Widgets has the correct/ideal Parent widget appearing first. Some of the widgets on the map are GrandChild widgets, with their own individual sub-IDs. However, using the existing Widgets/ChildWidget APIs, it appears that the reported value for "getID()" on a GrandChild widget is actually the Parent's ID. And the "getParentID()" is actually the GrandParent's ID. Essentially I am looking for a way to find the Parent widget from a Child widget. If Widgets had unique IDs, and the child knew the Parent's unique ID, that could work If there was a direct API call/reference from a ChildWidget to its Parent, that could work Currently my implementation that "works" looks like the below. However, considering that the RealID value appears to be the same for all the widgets under a given top-level-ish widget, I'm surprised this works at all. public static WidgetChild GetParentWidget(WidgetChild child) { return Widgets.get(widgetChild -> widgetChild.getRealID() == child.getRealParentID()); }
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now