skepta 0 Share Posted September 28, 2015 Trying to get the script to log out when there is no other players around, not understanding why this doesn't work. Just goes off if im alone or around a load of people if (getPlayers().all().size() <= 2) { if(!getTabs().isOpen(Tab.LOGOUT)) getTabs().open(Tab.LOGOUT); } else { getMouse().move(p); sleep(10, 60); getMouse().click(); sleep(10, 60); Link to comment Share on other sites More sharing options...
Before 95 Share Posted September 29, 2015 the <=2 would log out if there was just you or you and one other person.. Why it goes off when there are a lot of people is beyond me. Then again I can't code, just trying to help :L edit: ok so you're trying to get it to log off when you're alone. You WANT to be in a group.. idk why that part was so confusing. I would imagine it's something with your getPlayers thing.. agh nope can't help Link to comment Share on other sites More sharing options...
Computor 177 Share Posted September 29, 2015 Trying to get the script to log out when there is no other players around, not understanding why this doesn't work. Just goes off if im alone or around a load of people if (getPlayers().all().size() <= 2) { if(!getTabs().isOpen(Tab.LOGOUT)) getTabs().open(Tab.LOGOUT); } else { getMouse().move(p); sleep(10, 60); getMouse().click(); sleep(10, 60); There is a getTabs().logout(); method, FYI. Other than that, your logic should be fine. Try this: if(getPlayers().all(player -> player != null && !player.equals(getLocalPlayer())).size() < 2){ getTabs().logout(); } Link to comment Share on other sites More sharing options...
qbots 239 Share Posted September 29, 2015 Trying to get the script to log out when there is no other players around, not understanding why this doesn't work. Just goes off if im alone or around a load of people if (getPlayers().all().size() <= 2) { if(!getTabs().isOpen(Tab.LOGOUT)) getTabs().open(Tab.LOGOUT); } else { getMouse().move(p); sleep(10, 60); getMouse().click(); sleep(10, 60); It looks like you meant to do: if(!getTabs().isOpen(Tab.LOGOUT)) { getTabs().open(Tab.LOGOUT); } else { getMouse().move(p); sleep(10, 60); getMouse().click(); sleep(10, 60); } but instead you did if(!getTabs().isOpen(Tab.LOGOUT)) getTabs().open(Tab.LOGOUT); } else { getMouse().move(p); sleep(10, 60); getMouse().click(); sleep(10, 60); Though, I could be wrong. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.