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.

Enum/GUI help

Featured Replies

I know its not TECHNICALLY restricted to just this client but it relates here anyway. I'm trying to have a simple gui where you choose what type of fishing you want done. Right now I just have it for net fishing and fly fishing.  The first problem is, I want the enum to be displayed in the gui with a capitalized first letter and multi-line(Example "Fly Fishing".) I'm also having trouble getting what type the user selected in the main code and setting a variable depending on what it is. Here is the code:

GUI enum

enum Fish {
    NET,
    FLY;
    
    @Override
    public String toString() {
        return name().toLowerCase();
    }
}

And the only code I have for the main part:

fish = gui.getSelectedFish();

You can probably tell I'm using Explv's tutorial ?

  • Author

I've found the solution, and incase anyone find this and has the same issue, heres the solution:

For the actuall enum thing is what I did:

enum Fish {
    NET("Net fishing"),
    FLY("Fly fishing");
    
	private String displayName;
	
	
    Fish(String displayName) {
        this.displayName = displayName;
    }


    @Override
    public String toString() {
    	return displayName;
    }
}

This basically just uses the string in the parenthesis as what the name displayed in the gui dropdown. 

For using the value in the code, I did this:

        fish = gui.getSelectedFish();
        if(fish == fish.FLY) {
              //code
        }

Pretty self explanatory :D

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.