Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

Sign up now!

Resolved Failing to find gameobject

Author of MaxiBots
Joined
Dec 3, 2013
Messages
7,032
RS3. Unable to find the tree's if i start the bot logged out. When i start it logged in it has no issues.
If i start logged in and then log out, it has no issues either.

@Cloud
 
More specifically, if you store the query builder while logged out or in the lobby it never finds a tree. If you store the query builder after logging in, it works fine. @Cloud
 
Author of MaxiBots
Joined
Dec 3, 2013
Messages
7,032
Code:
final Tree tree = activity.treeProperty().get().getLeft();
final TreeArea area = activity.areaProperty().get();
new WoodcutterContext(tree.toString(), area.getArea(tree));

public WoodcutterContext(String treeName, Area treeArea) {
    setQueryBuilder(treeName, treeArea);
}

public void setQueryBuilder(String treeName, Area treeArea) {
    this.treeArea = treeArea;
    builder = GameObjects.newQuery().names(treeName).actions("Chop down", "Chop").surroundingsReachable().within(treeArea);
}
 
Mod Automation
Joined
Jul 26, 2013
Messages
3,053
Code:
final Tree tree = activity.treeProperty().get().getLeft();
final TreeArea area = activity.areaProperty().get();
new WoodcutterContext(tree.toString(), area.getArea(tree));

public WoodcutterContext(String treeName, Area treeArea) {
    setQueryBuilder(treeName, treeArea);
}

public void setQueryBuilder(String treeName, Area treeArea) {
    this.treeArea = treeArea;
    builder = GameObjects.newQuery().names(treeName).actions("Chop down", "Chop").surroundingsReachable().within(treeArea);
}
@Cloud the issue is that surroundingsReachable() calls (and caches) Players.getLocal() which isn't available when not logged in.
 
Engineer
Joined
Jul 28, 2013
Messages
2,776
@Cloud the issue is that surroundingsReachable() calls (and caches) Players.getLocal() which isn't available when not logged in.
It doesn't cache Players.getLocal() since it returns a null value, and since it returns a null value it can't determine what's reachable.
 
Mod Automation
Joined
Jul 26, 2013
Messages
3,053
Caching a null value is still caching. :p Regardless we should be able to fix it with a callable.


Sent from my iPhone using Tapatalk
 
Top