skepta 0 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);
Before 97 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
Computor 179 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(); }
qbots 240 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.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.