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

  • Author

 

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())

Nevermind you're right this API is freaken horrible.

Edited by Swizzbeat

*facepalm*

 

The length method returns the TOTAL amount of index's in the array. For example if you had an array of {1, 2, 3} the maximum index would be 2 however length() would return a value of 3.

 

I know.

 

Now use random(3); The highest amount you can get is 2.

  • 4 months later...

Sorry to gravedig but this is the right thread to ask this. How would I change it so that I have an initial array WORLDS and when I hop to a certain world, it would be withdrawn from the initial array and put into a second one, lets say WORLDSHOPPED. Then I would hop again, but it would pick a random world from the remaining worlds in WORLDS array. That would go on and on and at the end if there would be no worlds left in WORLDS and they were all in WORLDSHOPPED, all the values would go back into the WORLDS array.

 

So I would hop all the worlds - NOT HOPPING TO PREVIOUS ONES - and after I have hopped all the worlds, "the counter" would reset.

 

How would code for something like that look like?

  • Author

Sorry to gravedig but this is the right thread to ask this. How would I change it so that I have an initial array WORLDS and when I hop to a certain world, it would be withdrawn from the initial array and put into a second one, lets say WORLDSHOPPED. Then I would hop again, but it would pick a random world from the remaining worlds in WORLDS array. That would go on and on and at the end if there would be no worlds left in WORLDS and they were all in WORLDSHOPPED, all the values would go back into the WORLDS array.

So I would hop all the worlds - NOT HOPPING TO PREVIOUS ONES - and after I have hopped all the worlds, "the counter" would reset.

How would code for something like that look like?

Learn Java.

Sorry to gravedig but this is the right thread to ask this. How would I change it so that I have an initial array WORLDS and when I hop to a certain world, it would be withdrawn from the initial array and put into a second one, lets say WORLDSHOPPED. Then I would hop again, but it would pick a random world from the remaining worlds in WORLDS array. That would go on and on and at the end if there would be no worlds left in WORLDS and they were all in WORLDSHOPPED, all the values would go back into the WORLDS array.

 

So I would hop all the worlds - NOT HOPPING TO PREVIOUS ONES - and after I have hopped all the worlds, "the counter" would reset.

 

How would code for something like that look like?

 

http://docs.oracle.com/javase/7/docs/api/java/util/ArrayList.html

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.