Thread Tools Display Modes
04/14/14, 04:36 AM   #1
thrahistan
Join Date: Apr 2014
Posts: 4
Getting Item ID from chat link and name from ID

Hi everyone !
My first question is:
Is it possible to get the Item ID from a chat link?
If it is:
How to get the Name from that ID?

I couldn't find anything in the wiki :-(

Thanks!
  Reply With Quote
04/14/14, 07:04 AM   #2
Shinni
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 167
ZO_LinkHandler_ParseLink( itemLink )
returns name, color, type, id, +19 other attributes which I can't identify.
so you want to call
Lua Code:
  1. _, _, _, itemId = ZO_LinkHandler_ParseLink( itemLink )

Getting the name from the itemId isn't possible.
You can only get informations of items you possess or if someone else posted the link in the chat.
  Reply With Quote
04/14/14, 07:16 AM   #3
thrahistan
Join Date: Apr 2014
Posts: 4
ah thx for that...

that I can't get the name is bad course I would want the translation from that item when it's in another language
if someone posts a german item in the link the name is in german unless he/she uses the english client
but if you click on that item it's the english name

Or is it better to do another way for the translated item name link (it should stay as link)?
Maybe this isn't even possible :-/
  Reply With Quote
04/14/14, 07:34 AM   #4
Shinni
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 167
Originally Posted by thrahistan View Post
if someone posts a german item in the link the name is in german unless he/she uses the english client
but if you click on that item it's the english name
yeah...that's right.
maybe there is a way to get the correct item's name. I'll search for it.

edit:
the translation happen internally via the tooltipcontrol
http://wiki.esoui.com/Controls#TooltipControl
it has a method :SetLink

maybe you can access the data via
:GetNumChildren()
:GetChild(child)
if you're lucky you can access it's labels and read the string.

Last edited by Shinni : 04/14/14 at 07:44 AM.
  Reply With Quote
04/14/14, 08:16 AM   #5
thrahistan
Join Date: Apr 2014
Posts: 4
thanks !
I will try later

I will let you know if it works later
  Reply With Quote
04/22/14, 09:25 AM   #6
thrahistan
Join Date: Apr 2014
Posts: 4
I'm back here!

I've found out that the chat links are postet like this:
Lua Code:
  1. "|COLORCODE:item:id:s:o:m:e:n:u:m:b:e:r:s|h[YourLanguageItemName]|h"


the function SetLink() needs "string aLink" as parameter but I don't know what to use here D:

GetChild and GetNumChildren
How do i use these functions?
I don't quiete understand because everything I've done was giving errors

Thanks again!

Last edited by thrahistan : 04/22/14 at 09:28 AM.
  Reply With Quote
04/22/14, 01:19 PM   #7
BadVolt
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 74
Originally Posted by thrahistan View Post
I'm back here!

I've found out that the chat links are postet like this:
Lua Code:
  1. "|COLORCODE:item:id:s:o:m:e:n:u:m:b:e:r:s|h[YourLanguageItemName]|h"


the function SetLink() needs "string aLink" as parameter but I don't know what to use here D:

GetChild and GetNumChildren
How do i use these functions?
I don't quiete understand because everything I've done was giving errors

Thanks again!
So. 1st function, SetLink. If I remember right, it is used with tooltips, so you have to create new tooltip object and apply this method to it. Or you can use standart tooltips.
Try this:
Lua Code:
  1. ItemTooltip:Clear()
  2. ItemTooltip:SetLink(GetItemLink(1,1))
  3. ItemTooltip:SetHidden(false)
  4. ItemTooltip:SetAlpha(1)
It should display info about your item in 1st slot in the bag.

2nd and 3rd functions are providing info about XML stucture.
  Reply With Quote

ESOUI » AddOns » AddOn Help/Support » Getting Item ID from chat link and name from ID


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off