investmentideas Posted February 28, 2019 Share Posted February 28, 2019 I have created a small test script to see how world hop function works. I have created the below script however when it is logged into world 308 and needs to swap to 316 it just picks random worlds, i.e. 504. Any advice? @Override public int onLoop() throws InterruptedException { if (worlds.getCurrentWorld() == 308){ //F2p world // complete action // after action is complete then world hop to the next world in the line worlds.hop(316); //F2p world } else { if (worlds.getCurrentWorld() == 316) { //F2p world // complete action // after action is complete then world hop to the next world in the line worlds.hop(326); //F2p world } } return 0; } Quote Link to comment Share on other sites More sharing options...
FuryShark Posted February 28, 2019 Share Posted February 28, 2019 Have you clicked refresh before selected your script? Quote Link to comment Share on other sites More sharing options...
investmentideas Posted February 28, 2019 Author Share Posted February 28, 2019 Just now, FuryShark said: Have you clicked refresh before selected your script? that did it.. I though I had.. thank you! Quote Link to comment Share on other sites More sharing options...
Mr_MilkysButler Posted February 28, 2019 Share Posted February 28, 2019 You are returning way too fast. 1 Quote Link to comment Share on other sites More sharing options...
Juggles Posted February 28, 2019 Share Posted February 28, 2019 World hop method works fine. Some issues with your code. No sleep condition. Your return value is 0. You are running hundreds of loops a second... A script should run like 1 loop a second. If you had a condition sleep, you would only run 1 loop for like 3-4 seconds Quote Link to comment Share on other sites More sharing options...
luciuspragg Posted February 28, 2019 Share Posted February 28, 2019 (edited) Given that apparently refreshing the scripts fixed your problem I'd still like to add a suggestion, you aren't sleeping or checking on the worlds.hop() method in any way. Although what you did can and does for the most part work fine assuming no lag it still can be problematic and be something you need to check on. Edited February 28, 2019 by luciuspragg Quote Link to comment Share on other sites More sharing options...
investmentideas Posted March 1, 2019 Author Share Posted March 1, 2019 Thank you, sorry I had not got around to adding the sleep and the return values. I was looking more at the use of the world hop function itself. I have now added both into the script so it isnt running so many thank you! Quote Link to comment Share on other sites More sharing options...