May 24, 20205 yr I only started scripting some days a go and been struggling with an issue of how to make my player detect if there are other player nearby so it would get out and hop worlds. Now it will do that even if its alone and nobody is there so can someone help me out and tell me what is wrong with this? it seems that "(getPlayers().getAll().size() <= 1 && (dungeon.contains(myPosition())))" is always active even if the conditions are not met? private void getOut() throws InterruptedException { if (getPlayers().getAll().size() <= 1 && (dungeon.contains(myPosition()))) { sleep(500); getWalking().webWalk(exit); RS2Object ladder = getObjects().closest("Ladder"); ladder.interact("Climb-up"); Sleep.sleepUntil(() ->myPlayer().isAnimating(), 3000); log ("Hopping worlds"); getWorlds().hopToP2PWorld(); Sleep.sleepUntil(() ->(getWorlds().hopToP2PWorld()), 2000); } else { collect(); } }
May 24, 20205 yr getPlayers().getAll().size() <= 1 will always be met as you count as a player in this method, <= is greater than or equal to 1 If you set this to < 1 then should work
May 25, 20205 yr 21 hours ago, D9BLADEE said: getPlayers().getAll().size() <= 1 will always be met as you count as a player in this method, <= is greater than or equal to 1 If you set this to < 1 then should work Might want to flip that operator (; > - greater than < - less than
May 25, 20205 yr 8 minutes ago, BravoTaco said: Might want to flip that operator (; > - greater than < - less than 🤦♂️
May 25, 20205 yr 5 hours ago, D9BLADEE said: 🤦♂️ Don't feel bad. I still have to draw the alligator teeth. I'm 22 years old.
Create an account or sign in to comment