Jump to content

get name using id


Recommended Posts

Posted (edited)
6 minutes ago, nosepicker said:

Probably not gonna help you out here, but if there's at least a little posibility to use names and not ids - always use names.

It is used to display item names on a website and i get item id's from my scripts im running (which get pushed to website) so i wanna find a way to just find the item name using item id so well itemid's do not really give the user any real usefull info (it is not possible for me to get the item name out of the game)

Edited by TheMcPker
Posted
17 minutes ago, Explv said:

ItemDefinition def = ItemDefinition.forId(id);

if (def != null) {
    String name = def.getName();
}

 

https://osbot.org/api/org/osbot/rs07/api/def/ItemDefinition.html#forId-int-

Thanks the script im making is in a diffrent botclient tho (i should of mentioned this in my first post il edit it now)

my first thought was maby use some website to lookup the name there but i suck at that kinda stuff xD

Posted (edited)
34 minutes ago, TheMcPker said:

Thanks the script im making is in a diffrent botclient tho (i should of mentioned this in my first post il edit it now)

my first thought was maby use some website to lookup the name there but i suck at that kinda stuff xD

Then why not post on their forum? :???:

Yes there are websites which you could use to lookup the name from ID for example http://www.itemdb.biz/ (may not support all items though)

Not going to spoonfeed you a snippet to do it either :)

 

Edited by Explv
  • 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...