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.

Herb Snippet

Featured Replies

So i had this laying around, and i'm not working with herbs anymore so here you go.

 

Some credits to @Kenneh

public enum Herb    {
    GUAM(3, 249, 250, 199, 200),
    MARRENTILL(5, 251, 252, 201, 202),
    TARROMIN(11, 253, 254, 203, 204),
    HARRALANDER(20, 255, 256, 205, 206),
    RANARR(25, 257, 258, 207, 208),
    TOADFLAX(30, 2998, 2999, 3049, 3050),
    IRIT(40, 259, 260, 209, 210),
    AVANTOE(48, 261, 262, 211, 212),
    KWUARM(54, 263, 264, 213, 214),
    SNAPDRAGON(59, 3000, 3001, 3051, 3052),
    CADANTINE(65, 265, 266, 215, 216),
    LANTADYME(67, 2481, 2482, 2485, 2486),
    DWARFWEED(70, 267, 268, 217, 218),
    TORSTOL(75, 269, 270, 219, 220);

    private int idLevel, unnotedCleanId, notedCleanId, unnotedGrimyId, notedGrimyId;

    Herb(int idLevel, int unnotedCleanId, int notedCleanId,  int unnotedGrimyId, int notedGrimyId)    {
        this.idLevel = idLevel;
        this.unnotedCleanId = unnotedCleanId;
        this.notedCleanId = notedCleanId;
        this.unnotedGrimyId = unnotedGrimyId;
        this.notedGrimyId = notedGrimyId;
    }

    public static Herb get(int index)    {
        for (Herb h: values())
            if (index == h.ordinal())
                return h;
        return null;
    }

    public int getUnnotedGrimyId() {
        return unnotedGrimyId;
    }

    public int getIdLevel() {
        return idLevel;
    }

    public int getUnnotedCleanId() {
        return unnotedCleanId;
    }

    public int getNotedCleanId() {
        return notedCleanId;
    }

    public int getNotedGrimyId() {
        return notedGrimyId;
    }

    public String getName() {
        return name().charAt(0) +  name().substring(1).toLowerCase();
    }

    public boolean canIdHerb(int currentLevel)    {
        return currentLevel >= idLevel;
    }
}

Edited by josedpay

Okay, first before you read the rest of this, I want to say thanks for providing all the IDs.

 

But, you're using an enum wrong.

 

public enum Herb    {
    GUAM(3, 249, 250, 199, 200),
    MARRENTILL(5, 251, 252, 201, 202),
    TARROMIN(11, 253, 254, 203, 204),
    HARRALANDER(20, 255, 256, 205, 206),
    RANARR(25, 257, 258, 207, 208),
    TOADFLAX(30, 2998, 2999, 3049, 3050),
    IRIT(40, 259, 260, 209, 210),
    AVANTOE(48, 261, 262, 211, 212),
    KWUARM(54, 263, 264, 213, 214),
    SNAPDRAGON(59, 3000, 3001, 3051, 3052),
    CADANTINE(65, 265, 266, 215, 216),
    LANTADYME(67, 2481, 2482, 2485, 2486),
    DWARFWEED(70, 267, 268, 217, 218),
    TORSTOL(75, 269, 270, 219, 220);

    private int idLevel, unnotedCleanId, notedCleanId, unnotedGrimyId, notedGrimyId;

    Herb(int idLevel, int unnotedCleanId, int notedCleanId,  int unnotedGrimyId, int notedGrimyId)    {
        this.idLevel = idLevel;
        this.unnotedCleanId = unnotedCleanId;
        this.notedCleanId = notedCleanId;
        this.unnotedGrimyId = unnotedGrimyId;
        this.notedGrimyId = notedGrimyId;
    }

    public static Herb get(int index)    {
        for (Herb h: values())
            if (index == h.ordinal())
                return h;
        return null;
    }

    public int getUnnotedGrimyId() {
        return unnotedGrimyId;
    }

    public int getIdLevel() {
        return idLevel;
    }

    public int getUnnotedCleanId() {
        return unnotedCleanId;
    }

    public int getNotedCleanId() {
        return notedCleanId;
    }

    public int getNotedGrimyId() {
        return notedGrimyId;
    }

    public String getName() {
        return name().charAt(0) +  name().substring(1).toLowerCase();
    }

    public boolean canIdHerb(int currentLevel)    {
        return currentLevel >= idLevel;
    }
}

 

ftfy

Edited by Kenneh

  • Author

Why do people always tell me I'm using enum wrong I know exactly what I'm doing -.- the only reason why I have it that way is so, let's say your using a combo box or a list, and they chose a herb from the list. You use getSelectedIndex() (from with or, combo box or list) which returns an int, you use the int that they chose, within the get(int index) which will return the herb the chose. Now you could simply use the other methods that use a herb argument. To return what ever you need, for example name, or ids. You could make an AIO with simply two or three lines of code. Rather Then using a for loop, switch statement, or even a nested if and else statement Which takes up a bunch of lines.

Sorry for the rant, and you didn't fix anything for me you just dumbed it down for everyone else

Edited by josedpay

Why do people always tell me I'm using enum wrong I know exactly what I'm doing -.- the only reason why I have it that way is so, let's say your using a combo box or a list, and they chose a herb from the list. You use getSelectedIndex() (from with or, combo box or list) which returns an int, you use the int that they chose, within the get(int index) which will return the herb the chose. Now you could simply use the other methods that use a herb argument. To return what ever you need, for example name, or ids. You could make an AIO with simply two or three lines of code. Rather Then using a for loop, switch statement, or even a nested if and else statement Which takes up a bunch of lines.

Sorry for the rant, and you didn't fix anything for me you just dumbed it down for everyone else

he posted a more correct usage of enums.
  • Author

he posted a more correct usage of enums.

I know I just preferr my way because it's just me :P, but just because I posted my way doesn't mean it wrong. He didn't even know what I was up to

Why do people always tell me I'm using enum wrong I know exactly what I'm doing -.- the only reason why I have it that way is so, let's say your using a combo box or a list, and they chose a herb from the list. You use getSelectedIndex() (from with or, combo box or list) which returns an int, you use the int that they chose, within the get(int index) which will return the herb the chose. Now you could simply use the other methods that use a herb argument. To return what ever you need, for example name, or ids. You could make an AIO with simply two or three lines of code. Rather Then using a for loop, switch statement, or even a nested if and else statement Which takes up a bunch of lines.

Sorry for the rant, and you didn't fix anything for me you just dumbed it down for everyone else

 

Comboboxes have getSelectedItem() and getSelectedItemList() though.

I know I just preferr my way because it's just me tongue.png, but just because I posted my way doesn't mean it wrong. He didn't even know what I was up to

If it doesn't follow convention, then to an extent it is wrong.

If I'm wrong then I don't now why I brother to help

 

I'm just trying to help. Here's a little example.

import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * Created by Kenneth on 3/22/14.
 */
public class HerbGUI extends JFrame {

    public JComboBox<Herb> comboBox = new JComboBox<>(Herb.values());
    public JButton startButton = new JButton("Start");

    public Herb singleHerb;

    public HerbGUI() {
        getContentPane().setLayout(new FlowLayout());
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

        getContentPane().add(comboBox);
        getContentPane().add(startButton);

        startButton.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {

                singleHerb = (Herb) comboBox.getSelectedItem();
                System.out.println(singleHerb.getIdLevel());
                System.out.println(singleHerb.getName());
                System.out.println(singleHerb.getNotedGrimyId());
            }
        });
        pack();
        setVisible(true);
    }


    public static void main(String[] args) {
        new HerbGUI();
    }

}


Edited by Kenneh

  • Author

Sorry for my rudeness, im just a bit cranky because i just had surgery. And im sick of not doing anything all day.

 

and i added both versions the correct one. And the more advances one.

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.