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.

Hoppable Worlds Array

Featured Replies

public static int[] WORLDS = {301, 302, 303, 304, 305, 306, 308, 309, 310, 311, 312,
	313, 314, 316, 317, 318, 319, 320, 321, 322, 326, 327, 328, 329, 330, 333, 334,
	335, 336, 338, 341, 342, 343, 344, 345, 346, 349, 350, 351, 352, 353, 354, 357,
	358, 359, 360, 361, 362, 365, 366, 367, 368, 369, 370, 373, 374, 375, 376, 377,
	378};

And to hop to a random one:

new WorldHopper(MethodProvider).hopWorld(WORLDS[random(WORLDS.length)]);

Had to make this last night and might save someone a couple minutes tongue.png

 

This list CONTAINS F2P worlds: 308, 316

This list DOES NOT CONTAIN PvP worlds: 325, 337

Edited by Swizzbeat

What is when random(WORLDS.length) = 0 is ? You subtract 1 then its -1. A array with -1 is impossible.

Don't subtract 1 then it will work.

Edited by Soldtodie

  • Author

What is when random(WORLDS.length) = 0 is ? You subtract 1 then its -1. A array with -1 is impossible.

Don't subtract 1 then it will work.

The first index of an array is zero, however the length method returns the total number of items in the array not taking this into account.

The first index of an array is zero, however the length method returns the total number of items in the array not taking this into account.

 

He's actually right though, the random function's max is exclusive, so it already goes from 0 - max-1 :o

  • Author

He's actually right though, the random function's max is exclusive, so it already goes from 0 - max-1 ohmy.png

Hmm I always thought the random method started at 1 :o my apologies then, I'll fix now. Thanks to both <3

You have to subtract by one, the length of an array with one object is 1, while the object index is 0. If the random method returns the length of this array it will give you a nullpointer as the object that has the index of the length doesnt exist (in short words: the lenght of an array is its total objects +1)

  • Author

You have to subtract by one, the length of an array with one object is 1, while the object index is 0. If the random method returns the length of this array it will give you a nullpointer as the object that has the index of the length doesnt exist (in short words: the lenght of an array is its total objects +1)

Hmm so my original code was right I just need to add a min/max value in....I'll fix when I get on a computer!

Your code is too broad and it doesn't take into consideration potential latency issues someone may experience, e.g., I don't play on American servers because there would be too much latency at times. If I were to bot, this would undoubtedly effect the bot's performance.

  • Author

Your code is too broad and it doesn't take into consideration potential latency issues someone may experience, e.g., I don't play on American servers because there would be too much latency at times. If I were to bot, this would undoubtedly effect the bot's performance.

This is just an array for all the possible worlds people can hop to without the PvP ones. I don't think anyone really cares if their on an American/Germany server :p

new WorldHopper(MethodProvider).hopWorld(WORLDS[random(WORLDS.length - 1)]);

No need to put the 0 in there. ^_^

  • Author
new WorldHopper(MethodProvider).hopWorld(WORLDS[random(WORLDS.length - 1)]);
No need to put the 0 in there. ^_^
Fixed it right after I changed it :p it's 2 in the morning my brains a little loopy!

Sorry but this is not right:

random(WORLDS.length() - 1)

An example:

 

random(28);

This can gives you the number 0 or the number 27 and all numbers beetween this two numbers. But not the number 28.

 

This is right:

random(WORLDS.length())
Guest
This topic is now closed to further replies.

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.