garlicwhale 1 Share Posted November 29, 2023 (edited) 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 November 29, 2023 by garlicwhale Link to comment Share on other sites More sharing options...
apnasus 49 Share Posted January 1 (edited) 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 January 1 by apnasus code Link to comment Share on other sites More sharing options...
xyz111 84 Share Posted January 2 (edited) 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 January 2 by xyz111 Link to comment Share on other sites More sharing options...
apnasus 49 Share Posted January 2 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 More sharing options...
xyz111 84 Share Posted January 2 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 More sharing options...
apnasus 49 Share Posted January 2 18 minutes ago, xyz111 said: What? Did you? OP doesn't have the item ID Link to comment Share on other sites More sharing options...
xyz111 84 Share Posted January 2 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 More sharing options...
apnasus 49 Share Posted January 2 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 what was even the point in you commenting? Link to comment Share on other sites More sharing options...
xyz111 84 Share Posted January 2 2 minutes ago, apnasus said: No you've just typed OP back their own code in 2 lines instead of 1 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 More sharing options...
xyz111 84 Share Posted January 2 6 minutes ago, apnasus said: what was even the point in you commenting? Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now