Jump to content
View in the app

A better way to browse. Learn more.

RuneSuite RSPS Development

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.

Featured Replies

Posted
comment_63108

Hey everyone.

This is a better way to select a random entry from an enum :) 

An example of an enum group is:

This is the hidden content, please

Enums are incredibly useful for storing multiple types of data. You'll see them used in a load of places!

Now, the usual way to select a random entry from your enum list would be;

This is the hidden content, please

Of course - this does work. However, why not improve it!

Here is a new method for you.. I've added mine into Misc.java along with my randomItem method!

This is the hidden content, please

Now, lets select a entry from our enum using this new method!

(If added in Misc.java)

This is the hidden content, please

How much cleaner is that!

You **must** add .class to the end of the name in this bracket.

You can then use the entry as required!

E.g.

This is the hidden content, please

Hopefully you can use this to clean up some code 😛

  • 7 months later...
  • 4 months later...

Create an account or sign in to comment

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.