- Joined
- Nov 18, 2013
- Messages
- 126
- Thread Author
- #1
Today, I've been having some issues with getting the client to click on specific objects. It seems to work for most objects but some just fail to click. I've tried using #interact and #click. Any ideas? Thanks
Clicking on the object's tile using #getPosition#click seems to be my workaround for now but I'd prefer to not use that.
Clicking on the object's tile using #getPosition#click seems to be my workaround for now but I'd prefer to not use that.
Code:
private GameObject getLadder() {
LocatableEntityQueryResults<GameObject> ladder = GameObjects.getLoaded("Ladder");
if (ladder != null && ladder.size() > 0) {
return ladder.first();
}
return null;
}
private void climbLadder() {
GameObject ladder = getLadder();
int plane = player.getPosition().getPlane();
if (ladder != null) {
System.out.println("Not null");
if (ladder.interact("Climb-up", "Ladder")) {
Execution.delayUntil(() -> player.getPosition().getPlane() != plane, 2000, 3000);
} else {
System.out.println("Failed to click");
}
}
}