private boolean dismissRandom() {
for (NPC randomEvent : npcs.getAll()) {
if (randomEvent == null || randomEvent.getInteracting() == null
|| randomEvent.getInteracting() != myPlayer()) {
continue;
}
if (randomEvent.hasAction("Dismiss")) {
randomEvent.interact("Dismiss");
randomsDismissed++;
return true;
}
}
return false;
}
As imate said, i think the randoms event dismisser will override this method anyway so you're basically getting counts of it being dismissed based on the random event doing it. (I could be wrong though in how I just said this though)
and yeah like he also said for the mouse thing, you could look around in the api and you'd see methods such as getMouse().isOnScreen() getMouse().moveOutsideScreen() and use cond sleeps etc to deduce if the action has been complete
For a first attempt though I think this is good