- Thread Author
- #1
So i'm having an issue similar to this thread -> Resolved - [OSRS] Runescape.isLoggedIn() = true in "lobby screen"?
The thing is im using a tree bot instead of a looping bot. I have structured my bot so that if it can't find a fishing spot it logs out. The problem being the fishing spot is not visible until I log in completely. However runemate executes all of my logic before the login handler has logged me completely in e.g clicked through the "lobby".
My question is what is the best way using a tree bot structure to check if a player is completely logged in?
I have tried:
- delayUntil in the branch that checks if i'm near a fishing spot -> didnt work, it returned a null pointer exception on Execution.delayUntil(() -> p.isVisible());
- I've tried doing this check in the root node but im not sure what to return outside of the if statement:
So yeah not sure how to properly check that im logged in so that I can start looping through my bot logic.
The thing is im using a tree bot instead of a looping bot. I have structured my bot so that if it can't find a fishing spot it logs out. The problem being the fishing spot is not visible until I log in completely. However runemate executes all of my logic before the login handler has logged me completely in e.g clicked through the "lobby".
My question is what is the best way using a tree bot structure to check if a player is completely logged in?
I have tried:
- delayUntil in the branch that checks if i'm near a fishing spot -> didnt work, it returned a null pointer exception on Execution.delayUntil(() -> p.isVisible());
Code:
public class IsNearFishSpot extends BranchTask {
private Fish fish = new Fish();
private Logout logout = new Logout();
private Npc fishing_spot;
private Player p;
@Override
public boolean validate() {
fishing_spot = Npcs.newQuery().names("Fishing spot").actions("Net").results().nearest();
p = Players.getLocal();
Execution.delayUntil(() -> p.isVisible());
if (fishing_spot != null) {
return true;
} else {
return false;
}
}
@Override
public TreeTask failureTask() {
return logout;
}
@Override
public TreeTask successTask() {
return fish;
}
}
- I've tried doing this check in the root node but im not sure what to return outside of the if statement:
Code:
public class PowaFisher extends TreeBot {
private Player p;
@Override
public TreeTask createRootTask() {
if ((p = Players.getLocal()) == null || !p.isVisible()) {
return new IsInventoryFull();
}
return null; // is it ok to return null? whats the proper return statement here?
}
So yeah not sure how to properly check that im logged in so that I can start looping through my bot logic.
Last edited: