Jump to content
Frequently Asked Questions
  • Are you not able to open the client? Try following our getting started guide
  • Still not working? Try downloading and running JarFix
  • Help! My bot doesn't do anything! Enable fresh start in client settings and restart the client
  • How to purchase with PayPal/OSRS/Crypto gold? You can purchase vouchers from other users
  • How to get high alch value for an item?


    garlicwhale

    Recommended Posts

    How would one get the high alch value for any item given its name, without it needing to be in the inventory?

    One could do:

    new Item(ITEMID, 1).getHighAlchValue();

    but could one do it with the name of the item, instead of the id?

    Or is there a way to get the ID from the name?

    Edited by garlicwhale
    Link to comment
    Share on other sites

    • 1 month later...

    Fetch it here,

    https://prices.runescape.wiki/api/v1/osrs/mapping

    I'm not sure if there's a direct name/ID mapping in DreamBot's API but if you really wanted to avoid using the above I guess you could try,

    Integer avg = org.dreambot.api.methods.grandexchange.LivePrices.get(java.lang.String itemName)
    Integer low = org.dreambot.api.methods.grandexchange.LivePrices.getLow(java.lang.String itemName)
    Integer high = org.dreambot.api.methods.grandexchange.LivePrices.getHigh(java.lang.String itemName)
    
    for (int i = 0; i <= 26155; i++) {
        try {
            if (avg == org.dreambot.api.methods.grandexchange.LivePrices.get(i) &&
                low == org.dreambot.api.methods.grandexchange.LivePrices.getLow(i) &&
                high == org.dreambot.api.methods.grandexchange.LivePrices.getHigh(i)) {
                    Logger.log("Item ID " + i + " is a candidate");
            }
        } catch (Exception ignored) {} // Not tradeable
    }

    although it won't work for untradeable items. LOL

    Edited by apnasus
    code
    Link to comment
    Share on other sites

    If you know the itemID, you can create an instance of the item class without needing the item to be in the inventory. You do that by calling the constructor of the Item class with the itemID and quantity 1.

    Item yewLongbow = new Item(860, 1);
    int haValue = yewLongbow.getHighAlchValue();


     

     

    Edited by xyz111
    Link to comment
    Share on other sites

    20 minutes ago, xyz111 said:

    If you know the itemID, you can create an instance of the item class without needing the item to be in the inventory. You do that by calling the constructor of the Item class with the itemID and quantity 1.

    Item yewLongbow = new Item(860, 1);
    int haValue = yewLongbow.getHighAlchValue();

    I almost suggested the same thing until I read the rest of OP's post

    Link to comment
    Share on other sites

    2 hours ago, apnasus said:

    I almost suggested the same thing until I read the rest of OP's post

    What? Did you?

    Link to comment
    Share on other sites

    1 minute ago, apnasus said:

    OP doesn't have the item ID

    I addressed their initial query which also answers their subsequent questions. Might I propose a chat with your doctor about adjusting the dosage of your Adderall?

    Quote

    If    you know the itemID

     

     

     

    Link to comment
    Share on other sites

    On 11/29/2023 at 11:16 AM, garlicwhale said:

    One could do:

    new Item(ITEMID, 1).getHighAlchValue();

    but could one do it with the name of the item, instead of the id?

     

    3 hours ago, xyz111 said:

    If you know the itemID, you can create an instance of the item class without needing the item to be in the inventory. You do that by calling the constructor of the Item class with the itemID and quantity 1.

    Item yewLongbow = new Item(860, 1);
    int haValue = yewLongbow.getHighAlchValue();

     

    5 minutes ago, xyz111 said:

    I addressed their initial query which also answers their subsequent questions.

    No you've just typed OP back their own code in 2 lines instead of 1 :D what was even the point in you commenting?

    Link to comment
    Share on other sites

    2 minutes ago, apnasus said:

     

     

    No you've just typed OP back their own code in 2 lines instead of 1 :D what was even the point in you commenting?

     

    Quote

    new Item(ITEMID, 1).getHighAlchValue();

    That'll work?

    Quote

    I'm not sure if there's a direct name/ID mapping in DreamBot's API 

    what was even the point in you commenting?

    Link to comment
    Share on other sites

    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now
    ×
    ×
    • Create New...

    Important Information

    We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.