Jump to content

Get item id for item not in inventory


Recommended Posts

Posted

Programatically getting the id from a string is a lot harder than vice versa but there are two main ways I can think of to do it. First is to scrape a site such as the one @Apaec linked, second is to loop the Item Definition cache until you find the string you're looking for (make sure to check that it's not noted or anything). 

Posted
1 minute ago, Apaec said:

I believe there's a list here: http://www.itemdb.biz/

I am looking for a way for the bot to get the id without the item. The GE api requires the item id for

buyItem(int itemId, java.lang.String searchTerm, int price, int quantity) 

 

Makes it difficult to buy an item if it does not have one, and the list of items I want to buy is long, so I am trying to loop it.

3 minutes ago, Night said:

Programatically getting the id from a string is a lot harder than vice versa but there are two main ways I can think of to do it. First is to scrape a site such as the one @Apaec linked, second is to loop the Item Definition cache until you find the string you're looking for (make sure to check that it's not noted or anything). 

Thanks! I will look into that.

Posted
2 minutes ago, sudoinit6 said:

I am looking for a way for the bot to get the id without the item. The GE api requires the item id for

buyItem(int itemId, java.lang.String searchTerm, int price, int quantity) 

  

Makes it difficult to buy an item if it does not have one, and the list of items I want to buy is long, so I am trying to loop it.

Thanks! I will look into that.

A word to the wise, you don't need to iterate every item in the cache as approximately half are noted. Find the pattern and this will cut down the execution time by roughly 50%.

  • Like 1

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...