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
  • How do I hop fast


    Mancubus

    Recommended Posts

    I want to hop was fast as possible, quickHop() logs me out so that doesnt work for me I dont think its much faster than hopWorld(). Anyone know of a fast way to hop to a random members world?

    Edited by Mancubus
    Link to comment
    Share on other sites

    8 hours ago, Mancubus said:

    I want to hop was fast as possible, quickHop() logs me out so that doesnt work for me I dont think its much faster than hopWorld(). Anyone know of a fast way to hop to a random members world?

    If you want to hop fast so you don't die or something, it might be better just to have the script log out, then choose the world from the actual menu screen.

    Link to comment
    Share on other sites

    No Its not that I actually want it to hop as fast as possible, would be perfect if the client could send the hop request without scrolling through the entire worldhopper to find the world. Would this be possible?

    Link to comment
    Share on other sites

    actually found a solution for it, just made sure hte bot never picks a world that it is so far down/up that is has to scroll to it.

    Link to comment
    Share on other sites

    • 1 month later...

    The quickHop() method is deprecated, leaving the only option being standard hopWorld() methods which use the middle mouse scroll effects to scroll slowly through the world list. To speed it up, I have written a method of worldhopping which opens the world hopper menu manually and then checks if the desired world is already visible, if not then it clicks the appropriate location on the scrollbar to instantly scroll to it, then clicks it. It does not check if the desired world is a valid world (like 1365) so there is a seperate method to grab a valid and random world. Also the code only works for fixed mode lol, and you have to change the sleeps to your own sleeps.

    public static List<World> worlds;
    	public static void scrollHopWorld(int world)
    	{
    		if(Players.localPlayer().isInCombat() ||
    				Worlds.getCurrentWorld() == world) return;
    		Timer timeout = new Timer(Sleep.calculate(8888, 1111));
    		while(Worlds.getCurrentWorld() != world && 
    				!timeout.finished() && 
    				Client.isLoggedIn() && 
    				!Players.localPlayer().isInCombat() && 
    				Skills.getRealLevel(Skill.HITPOINTS) > 0)
    		{
    			if(Widgets.getWidgetChild(69,2) != null &&
    					Widgets.getWidgetChild(69,2).isVisible() &&
    					Widgets.getWidgetChild(69,2).getText().contains("Loading..."))
    			{
    				Sleep.sleep(50, 1111);
    				continue;
    			}
    			if(Widgets.getWidgetChild(182, 7) != null &&
    					Widgets.getWidgetChild(182, 7).isVisible() &&
    					Widgets.getWidgetChild(182, 7).getText().contains("World Switcher"))
    			{
    				Widgets.getWidgetChild(182, 3).interact("World Switcher");
    				Sleep.sleep(50, 1111);
    				continue;
    			}
    			if(!Tabs.isOpen(Tab.LOGOUT))
    			{
    				Tabs.open(Tab.LOGOUT);
    				Sleep.sleep(50, 1111);
    				continue;
    			}
    			//worlds are now loaded
    			if(Widgets.getWidgetChild(69,2) != null &&
    					Widgets.getWidgetChild(69,2).isVisible() &&
    					Widgets.getWidgetChild(69,2).getText().contains("Current world - "))
    			{
    				//establish correct WidgetChild of desired world's clickable bar
    				int gc = -1;
    				for(WidgetChild w : Widgets.getWidgetChildrenContainingText(Integer.toString(world)))
    				{
    					if(w.getX() == 563) // correct x position lineup for world number location **FIXED MODE**
    					{
    						gc = (w.getIndex() - 2);
    						break;
    					}
    				}
    				WidgetChild worldWidget = null;
    				if(gc >= 0) worldWidget = Widgets.getWidgetChild(69,17,gc);
    				if(worldWidget == null) 
    				{
    					Sleep.sleep(10, 111);
    					continue;
    				}
    				Rectangle worldRectangle = worldWidget.getRectangle();
    				WidgetChild worldListContainer = Widgets.getWidgetChild(69,17);
    				if(worldListContainer == null)
    				{
    					Sleep.sleep(10, 111);
    					continue;
    				}
    				if(worldRectangle.intersects(Widgets.getWidgetChild(69,15).getRectangle()))
    				{
    					//World widget is visible - clicking it
    					Rectangle visibleWorldRectangle = worldRectangle.intersection(Widgets.getWidgetChild(69,15).getRectangle());
    					Mouse.click(visibleWorldRectangle);
    				}
    				else
    				{
    					//World list needs scrolling
    					double yPos = worldRectangle.getCenterY();
    					double yMin = worldListContainer.getRectangle().getMinY();
    					double yMax = worldListContainer.getRectangle().getMaxY();
    					double offsetRatio = ((yPos - yMin) / (yMax - yMin));
    					WidgetChild scrollContainer = Widgets.getWidgetChild(69,18,0);
    					if(scrollContainer == null)
    					{
    						Sleep.sleep(10, 111);
    						continue;
    					}
    					double yScrollMin = scrollContainer.getRectangle().getMinY();
    					int xRand = (int) Calculations.random(scrollContainer.getRectangle().getMinX(), scrollContainer.getRectangle().getMaxX());
    					int yClickPos = (int) ((scrollContainer.getHeight() * offsetRatio) + yScrollMin);
    					Mouse.click(new Point(xRand,yClickPos));
    				}
    				Sleep.sleep(50, 1111);
    				continue;
    			}
    			Sleep.sleep(50, 1111);
    		}
    	}
    	public static int randomWorld(boolean members)
    	{
    		if(worlds == null || worlds.isEmpty()) worlds = Worlds.noMinimumLevel();
    		List<World> filteredWorlds = new ArrayList<World>();
    		if(filteredWorlds == null || filteredWorlds.isEmpty()) 
    		{
    			for(World tmp : worlds)
    			{
    				if(members) 
    				{
    					if(tmp.isMembers() &&
    							!tmp.isPVP() && 
    							!tmp.isTournamentWorld() &&
    							!tmp.isLeagueWorld() &&
    							!tmp.isDeadmanMode())
    					{
    						filteredWorlds.add(tmp);
    					}
    				} 
    				else 
    				{
    					if(!tmp.isMembers() &&
    							!tmp.isPVP() &&
    							!tmp.isTournamentWorld() &&
    							!tmp.isLeagueWorld() &&
    							!tmp.isDeadmanMode())
    					{
    						filteredWorlds.add(tmp);
    					}
    				}
    			}
    		}
    		return filteredWorlds.get(new Random().nextInt(filteredWorlds.size() - 1)).getWorld();
    	}

    Then when I want to hop to a random world in my script, just say

    scrollHopWorld(randomWorld(false));

     and the void function returns when either a 9-second timeout runs out, or the world is hopped to the correct world, or you enter combat, or die, or logout.

    Link to comment
    Share on other sites

    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now
    ×
    ×
    • 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.