Neffarion 485 Share Posted December 6, 2016 Hello everyone, if you have a script with a bunch of ID's and cant be bothered to get all the names for all of them (or the other way around), you can use this small class along with the file to get the name or ID of any item within the game. I have made an ID File list along with a class you can copy paste into your projects Download archive with files | Mirror How to use: String filepath = "PathToFileInsideYourProject/osrs_items.data"; int id = 952; ItemsReader reader = new ItemsReader(filepath); String itemName = reader.getItemName(id); // This will give you: SpadeYou can also do String filepath = "PathToFileInsideYourProject/osrs_items.data"; String name = "Spade"; ItemsReader reader = new ItemsReader(filepath); int id = reader.getItemId(name); // This will give you: 952To get the path of the id list file just follow your project path from srcExample: /util/osrs_items.data (inside util package/folder inside src) or /resources/osrs_items.data (inside resources package/folder inside src) The id list file is about 216 KBytes so it will add just a bit of weight into your project Note: If you want to get ID from name take note that some items have same name therefor it will give you the first item id it finds. Each search wont be intensive on your client but if you mass search items it wont be good. (Make sure you don't over do it all at once ) Link to comment Share on other sites More sharing options...
Eclipseop 194 Share Posted December 7, 2016 Could also query something like this https://rsbuddy.com/exchange/names.json which i suppose is only optimal if you are also trying to find prices xd Link to comment Share on other sites More sharing options...
Neffarion 485 Author Share Posted December 7, 2016 Could also query something like this https://rsbuddy.com/exchange/names.json which i suppose is only optimal if you are also trying to find prices xd True, this is local file however, doesn't need rsbuddy This is mostly used for grand exchange, this way you can just pass an ID and get the name of the item you want to buy Link to comment Share on other sites More sharing options...
rokaHakor 171 Share Posted December 7, 2016 The rsbuddy JSON only has items that are tracked by them aka items sellable in GE. It doesn't have untreadable items or tradable items that can't be sold it GE such as partially eaten cake and teleport jewelry with charges missing. Neffarions list is also missing items such as the Hill Giant Club which is one of the newer items. Link to comment Share on other sites More sharing options...
Neffarion 485 Author Share Posted December 7, 2016 The rsbuddy JSON only has items that are tracked by them aka items sellable in GE. It doesn't have untreadable items or tradable items that can't be sold it GE such as partially eaten cake and teleport jewelry with charges missing. Neffarions list is also missing items such as the Hill Giant Club which is one of the newer items. You use it for whatever you like, I just gave example for GE. if you really want, you can always just get an updated list to your needs. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.