Jump to content
Frequently Asked Questions
  • Are you not able to open the client? Try following our getting started guide
  • Still not working? Try downloading and running JarFix
  • Help! My bot doesn't do anything! Enable fresh start in client settings and restart the client
  • How to purchase with PayPal/OSRS/Crypto gold? You can purchase vouchers from other users
  • World Hopping problem


    Ratchet

    Recommended Posts

    My world hopper was working fine before (when I was using getWorlds().getRandomWorld(), but now I always get a null pointer exception and it won't hop worlds because the world is returning null.

    // Dwarf Cannon (World Hop)
    GameObject dwarfCannon = getGameObjects().closest("Dwarf multicannon");
    if(dwarfCannon != null && !getLocalPlayer().isInCombat() && dwarfCannon.distance() <= 15 && getMap().canReach(dwarfCannon)){
    	Widget logoutTab = getWidgets().getWidget(182);
    	Widget worldSwitcher = getWidgets().getWidget(69);
    	state = 10;
    	if(logoutTab == null || !logoutTab.isVisible()){
    		getTabs().openWithMouse(Tab.LOGOUT);
    	        sleep(1000,2000);
    	}
            if(worldSwitcher == null || !worldSwitcher.isVisible()){
    		getWorldHopper().openWorldHopper();
    	        sleep(1000,2000);
    	}
    	World e = getWorlds().getRandomWorld(w -> w !=null && !w.isDeadmanMode()
    	&& !w.isF2P() && !w.isHighRisk()
    	&& !w.isLastManStanding() && !w.isPVP() 
    	&& w.isMembers() && !w.equals(getClient().getCurrentWorld())
    	&& w.getID() != 353 && w.getID() != 366
    	&& w.getID() != 373 && w.getID() != 349 && w.getID() != 361);
    	log("GETWORLD");
    	log(e.toString());
            if(!getLocalPlayer().isInCombat()){
    		getWorldHopper().hopWorld(e);
    	        sleep(Calculations.random(1000, 2000));
    		dwarfCannon = null;
    	}
    }
    
    Link to comment
    Share on other sites

    Checking it out :)


    That same filter isn't throwing any errors for me, it may be an issue loading the worlds.

     

    I'll write a check and release that later, for now just restart the client and try again.

    Link to comment
    Share on other sites

    Checking it out :)

    That same filter isn't throwing any errors for me, it may be an issue loading the worlds.

     

    I'll write a check and release that later, for now just restart the client and try again.

     

    Tried restarting the client and reloading the jar in eclipse and exporting again, but to no avail, it still returns null.

    Link to comment
    Share on other sites

    I can confirm it is indeed broken, one of the private Scripts I wrote for someone does not seem to work for them while it works fine for me, we both restarded the Client and still same result. It must be an issue with the newly added automatically loading Worlds.

     

    This filter:

     

    w = getWorlds().all(f -> f.isMembers() && !f.isDeadmanMode() && !f.isPVP() && f.getMinimumLevel() == 0);
     
    does work fine for me and give me all the matching worlds while for the other guy my debugs state:
     
    [iNFO]13:42:02: @@UsingDreambot version: 1.301  //Just a print for me to know which version the Script is running on
     
    [iNFO]13:42:02: ~ HOP //State print
     
    [iNFO]13:42:02: ~ CURRENT WORLD: 302 //Current world
     
    [iNFO]13:42:02: ~ WORLD LIST SIZE: 0 //Size of the list from worlds to choose from (w)

     

    Causing this part of code:

     

    getWorldHopper().hopWorld(w.get(Calculations.random(w.size())));

     

    to throw a NumberIsTooLargeException since you the lower bound which in this case is 0 must be strictly less than the upper bound(0 aswell since w has a size of 0 as you can see from the previous mentions)

     

    tl;dr: the automatic world loading thing probably causes the filter not to pick up worlds correctly

     

     

    So it works for you but not the other guy?

    Tried restarting the client and reloading the jar in eclipse and exporting again, but to no avail, it still returns null.

     

    Can you try printing getWorlds().all().size()?

    Link to comment
    Share on other sites

    I'll be pushing a release soon that will make sure the worlds loaded properly (along with some logs so we can figure out the problem ;))

    Alright, Pandemic! Thanks for getting on it. What we do without you. <3

    Link to comment
    Share on other sites

    any updates on this?  :ph34r:

     

     

    Alright, Pandemic! Thanks for getting on it. What we do without you.

     

     

    Alright guys just released a hot fix, if you could restart your launchers to download the latest version, run the client and let me know what the first line of the debug console shows :)

     

    (should either say successfully loaded x worlds, or throw an error)

    Link to comment
    Share on other sites

    Archived

    This topic is now archived and is closed to further replies.

    ×
    ×
    • Create New...

    Important Information

    We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.