Jump to content
View in the app

A better way to browse. Learn more.

OSBot :: 2007 OSRS Botting

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

World hopping with limits

Featured Replies

Sometimes when mining or woodcutting you might notice a ton of people just bombing your spot. Instead of losing out on gp/hr hop worlds!

First we need these imports

import org.osbot.rs07.api.map.Area;
import org.osbot.rs07.api.model.Player;

Now a function to detect local players and check if we should hop

/**
 * Check if the current players in our area meets the limit
 *
 * @param area           the area that the players will be calculated
 * @param playerLim      the amount of players needed to perform a hop
 * @return               true if the player count meets the limit
 */
private boolean shouldWeHop(Area area, int playerLim) {
    int playersInArea = 0;
    List<Player> nearbyPlayers = players.getAll();
    
    //Remove our player from the list
    nearbyPlayers.remove(myPlayer());
    for (Player player : nearbyPlayers) {
        if (area.contains(player)) {
            playersInArea++;
        }
    }
    return playersInArea >= playerLim;
}

Usage:

int playerDetectionRadius = 5; //A radius of 5 steps is 5 steps in every direction from our player
int playerLim = 3; //amount of players we should have before hopping

if(shouldWeHop(myPlayer().getArea(playerDetectionRadius), playerLim)) {

    //true we should hop, let's hop!
    worlds.hopToF2PWorld();
}

 

Edited by Hayase

or you can do:
if (getPlayers().getAll().size() > 2) {

worlds.hopToF2PWorld();

}

note, 2 will mean if there is 1 player or more near you as it will return 1 for your own player

I've been using this a lot in my scripts and it seems to help counter bans. 

I find an isolated mining/woodcutting spot and put this in the code and it has lead to me not getting banned. 

You can also detect if anyone says part of your name/whole name and then world hop. They cant report you once you've hopped I believe 

  • Author
4 minutes ago, Lewis said:

or you can do:
if (getPlayers().getAll().size() > 2) {

worlds.hopToF2PWorld();

}

note, 2 will mean if there is 1 player or more near you as it will return 1 for your own player

Yes that does work, except it is too greedy when detecting nearby players. Sometimes when mining inside the dwarven mines the nearby players could pickup people that aren't even nearby. So to be more accurate with the nearby players--we count the players inside our players radius.

6 minutes ago, Lewis said:

or you can do:
if (getPlayers().getAll().size() > 2) {

worlds.hopToF2PWorld();

}

note, 2 will mean if there is 1 player or more near you as it will return 1 for your own player

shouldn't that be >= 2 or > 1?

 

 

will be useful :) but what is playersInArea?

20 minutes ago, Hayase said:

int playerDetectionRadius = 5; //A radius of 5 steps is 5 steps in every direction from our player int playerLim = 3; //amount of players we should have before hopping if(shouldWeHop(playersInArea(myPlayer().getArea(playerDetectionRadius)), playerLim)) { //true we should hop, let's hop! worlds.hopToF2PWorld(); }

 

2 minutes ago, Stimpack said:

shouldn't that be >= 2 or > 1?

yeah, just using as an example. wrote it in 5 seconds lol
i personally use

> 1; 

Might snap some of this shit up. Shot breathers.

  • Author
5 hours ago, Stimpack said:

shouldn't that be >= 2 or > 1?

 

 

will be useful :) but what is playersInArea?

 

oops, totally fucked up my own copy pasta :???:

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.