Thread Tools Display Modes
07-15-05, 07:54 AM   #1
Borkan
A Murloc Raider
 
Borkan's Avatar
Join Date: Jul 2005
Posts: 5
Usage of GetItemInfo()

Hi,

i tried the new function GetItemInfo(id) after receiving the current patch (german version) and always receive nil values with the following code snippet:

[...]
itemLink = GetTradeSkillItemLink(skillIndex)
[...]
name, link, quality, minLevel, class, subclass, maxStack = GetItemInfo(itemLink);

"name" is always nil, although "itemLink" looks good (I print it in my debugging output). It fails for items I just have created, so they have to be in my local cache. Has anybody a solution, or some code snippet that works?

PS.: I tried it with the real name of the items, too (GetTradeSkillItemInfo(skillIndex) and didn't succeed.
  Reply With Quote
07-15-05, 09:58 AM   #2
Beladona
A Molten Giant
 
Beladona's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2005
Posts: 539
the item has to be in your local cache or else it will return nil. It is a limitation they included recently because linking an item that was not in your local cache or the server's (after a reboot) would cause you to get disconnected immediately. Now it just returns nil...
  Reply With Quote
07-15-05, 12:26 PM   #3
Borkan
A Murloc Raider
 
Borkan's Avatar
Join Date: Jul 2005
Posts: 5
Originally Posted by Beladona
the item has to be in your local cache or else it will return nil. It is a limitation they included recently because linking an item that was not in your local cache or the server's (after a reboot) would cause you to get disconnected immediately. Now it just returns nil...
I created the item, I looked at it, I sold it, what else have I to do, to put it in my local cache? ;-) Nothing helped, I always got "nil".
  Reply With Quote
07-18-05, 05:51 PM   #4
Iriel
Super Moderator
WoWInterface Super Mod
Featured
Join Date: Jun 2005
Posts: 578
How much of the item link are you sending in. Contrary to how the function may have been described, you need to strip off all of the other display junk, and get it down to just the

item:XXXXX:XXX:XXX:XXX

form.
  Reply With Quote
07-20-05, 06:38 AM   #5
Borkan
A Murloc Raider
 
Borkan's Avatar
Join Date: Jul 2005
Posts: 5
Thank you very much, that was the trick. :-) The WoW interface functions should be a little bit more precise about their wanted data-types.
  Reply With Quote
07-24-05, 12:07 PM   #6
Kaelten
Jack's raging bile duct
 
Kaelten's Avatar
Featured
Join Date: May 2005
Posts: 782
optionally you can also just send the short ID instead of the link
__________________
WowAce.com & CurseForge.com Adminstrator
Developer of Ace3, OneBag3, and many other addons and libraries
Project lead and Mac developer for the Curse Client

Anyone that needs what they want
And doesn't want what they need
I want nothing to do with
  Reply With Quote
08-08-05, 05:56 AM   #7
shamaz
A Defias Bandit
Join Date: Aug 2005
Posts: 3
Hello

I have exactly the same problem, but uh I'm a beginner ... How can I get the "Item:XXXXX:XXX:XXX:XXX form" or the itemID with the itemLink ?

itemLink = GetInventoryItemLink("player", 16);
goodLink = WhatShouldIPutHere( itemLink ); ??
name, link, quality, minLevel, class, subclass, maxStack = GetItemInfo( goodLink );
  Reply With Quote
08-08-05, 08:31 AM   #8
Kaelten
Jack's raging bile duct
 
Kaelten's Avatar
Featured
Join Date: May 2005
Posts: 782
check the code for KC_Items, I have functions that do both.
__________________
WowAce.com & CurseForge.com Adminstrator
Developer of Ace3, OneBag3, and many other addons and libraries
Project lead and Mac developer for the Curse Client

Anyone that needs what they want
And doesn't want what they need
I want nothing to do with
  Reply With Quote
08-08-05, 09:28 AM   #9
shamaz
A Defias Bandit
Join Date: Aug 2005
Posts: 3
Originally Posted by Kaelten
check the code for KC_Items, I have functions that do both.
Thank you very much !
I found everything in KC_Items_Core.lua. There's a lot of helpful methods in you mod
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Usage of GetItemInfo()


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