kamilo 7 Share Posted November 9, 2019 getWorldHopper().hopWorld(e); // Used this statement to hop worlds sleepUntil(() -> getWorlds().getWorld(getClient().getCurrentWorld()) == e, Calculations.random(6000,7100)); my issue is that my bot tries to perform actions while the world is still loading, it throws an exception in the log it still works but i would like to fix it i tried this: sleepUntil(() -> getWorlds().getWorld(getClient().getCurrentWorld()) == e, Calculations.random(6000,7100)); doesn't seem to resolve it any suggestions? Link to comment Share on other sites More sharing options...
Nuclear Nezz 2055 Share Posted November 9, 2019 That's because the world changes before the game fully loads. Which is also where the world hopper cuts out, when your world is the world that you're trying to hop to. That's also the criteria for returning true. Link to comment Share on other sites More sharing options...
kamilo 7 Author Share Posted November 9, 2019 2 hours ago, Nuclear Nezz said: That's because the world changes before the game fully loads. Which is also where the world hopper cuts out, when your world is the world that you're trying to hop to. That's also the criteria for returning true. do you suggest a different line of code then Link to comment Share on other sites More sharing options...
yeeter 521 Share Posted November 9, 2019 I have been told by hundreds of Venezuelans @Zawy is the master of this. Link to comment Share on other sites More sharing options...
Defiled 423 Share Posted November 9, 2019 As @Nuclear Nezz mentioned, the world number is changed before the world loads, therefore you must find a way to pause any actions until the world loads. I suggest manually calculating how much sleep time it needs to resume activities, then just apply the calculations in the sleep method. You do not need to be too accurate with this, just positively deviate the sleep value and that should take care of network lags. Link to comment Share on other sites More sharing options...
Defiled 423 Share Posted November 9, 2019 A way I thought of is the Camera View, I know for a fact that the Camera View changes after World loading is complete.. So you could sleepUntil the Camera ViewPoint is different, like for an example: First: find out the original getX() & getY(): int x = getCamera().getX(); int y = getCamera().getY(); Second: hop getWorldHopper().hop(int world); sleepUntil(()-> getCamera().getX() != x || getCamera().getY() != y, 7000); You could also check the pitch, Z axis, Yaw by getCamera().getYaw(); getCamera().getZ(); getCamera().getPitch(); This is just an untested "test" I thought of, give it a try Programming is all about new ideas, trial and error! Link to comment Share on other sites More sharing options...
kamilo 7 Author Share Posted November 9, 2019 13 hours ago, ItsDefiled said: A way I thought of is the Camera View, I know for a fact that the Camera View changes after World loading is complete.. So you could sleepUntil the Camera ViewPoint is different, like for an example: First: find out the original getX() & getY(): int x = getCamera().getX(); int y = getCamera().getY(); Second: hop getWorldHopper().hop(int world); sleepUntil(()-> getCamera().getX() != x || getCamera().getY() != y, 7000); You could also check the pitch, Z axis, Yaw by getCamera().getYaw(); getCamera().getZ(); getCamera().getPitch(); This is just an untested "test" I thought of, give it a try Programming is all about new ideas, trial and error! great idea i remember back in the day the camera would reset to north but that doesn't work, personally tested it out, camera values stay the same upon hop, good idea tho Link to comment Share on other sites More sharing options...
Hyper Crusher 4 Share Posted November 10, 2019 The world switcher widget doesn't update the world text until loading is complete, in fact for a brief moment after loading is complete the text is "Loading..." this means we can set a sleepuntil that checks this widgets text, with a timeout that is sizeable public void hopToWorld(int world){ String worldText = "Current world - "; getWorldHopper().hopWorld(world); sleepUntil(() -> getWidgets().getWidget(69).getChild(2).getText().equals(worldText + world), 20000); } Link to comment Share on other sites More sharing options...
Defiled 423 Share Posted November 10, 2019 6 hours ago, kamilo said: great idea i remember back in the day the camera would reset to north but that doesn't work, personally tested it out, camera values stay the same upon hop, good idea tho Oh, alright. I tried a very simple method on my end, and it worked. just sleep 1 to 2 secs before the hop, and 1 to 2 secs after the hop.. that worked wonderful for me Link to comment Share on other sites More sharing options...
kamilo 7 Author Share Posted November 10, 2019 59 minutes ago, ItsDefiled said: Oh, alright. I tried a very simple method on my end, and it worked. just sleep 1 to 2 secs before the hop, and 1 to 2 secs after the hop.. that worked wonderful for me if you're running a laggy client, or client disconnects etc, it can effect that. i've noticed my time changes and it isnt fixed LOL guess nothing's perfect Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.