By registering with us, you'll be able to discuss, share and private message with other members of our community.
Sign up now!Coordinate pos = Players.getLoaded().nearest().getPosition();
Coordinate myPos = Playes.getLocal().getPosition();
RuneScape.logout();
yourscriptasvariable.stop();
Or you could use the Distance API and also make sure that the player you get isn't your player. What you could do is use queries to get a list of players, excluding your player, within a certain area with your player as the center. If the list is empty, logout, if the logout is successful, stop the bot. Be sure to only stop if the logout is successful, otherwise you'll be defeating the purpose.Not asking why on earth you would want this because it's like screaming "DETECT ME PLEASE"; but anyways:
Your validate should be something like (pseudo-code)
Compare both positions using pos.getX() and pos.getY()Code:Coordinate pos = Players.getLoaded().nearest().getPosition(); Coordinate myPos = Playes.getLocal().getPosition();
If the player is too close then return true, else return false.
Your execution should be
Code:RuneScape.logout(); yourscriptasvariable.stop();
I don't plan on using this to bot. I want to have it running when I'm up at something like lava dragons, playing legit. So that if I'm not paying 100% attention and a pker comes nearby, it'll automatically log me out.
u cant logout in combat tho
We use essential cookies to make this site work, and optional cookies to enhance your experience.