Jump to content
TheMcPker

get name using id

Recommended Posts

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
Link to comment
Share on other sites

18 minutes ago, TheMcPker said:

Hey guys anyone has a code snippet to receive the name of a item using the item id? (could be webbased or scriptbased)

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-

Edited by Explv
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...