Thread Tools Display Modes
11-23-05, 12:03 AM   #1
blindsleeper
A Defias Bandit
Join Date: Nov 2005
Posts: 2
Item Subtype from player slot

I dont know if this is something that can fairly easily be solved but i need some help making a script that would scan the item in an item slot (in this case, looking at the offhand slot (17)) and determining what the subtype (i.e. shield, mace, etc) is. Ive tried using the following code, but it doesnt seem to work:
Code:
linktext = GetInventoryItemLink("player",17);
local sName, sLink, iQuality, iLevel, sType, sSubType = GetItemInfo(linktext);
  Reply With Quote
11-23-05, 04:20 PM   #2
Gello
A Molten Giant
AddOn Author - Click to view addons
Join Date: Jan 2005
Posts: 521
GetItemInfo wants a numeric item id or the string "item:###etc". Which you can get from parsing out the link but the link itself won't work.

This will work:

local _,_,itemID = string.find(GetInventoryItemLink("player",17) or "","item:(%d+)")
local sName, sLink, iQuality, iLevel, sType, sSubType = GetItemInfo(itemID);
  Reply With Quote
11-23-05, 06:07 PM   #3
blindsleeper
A Defias Bandit
Join Date: Nov 2005
Posts: 2
Thanks! appriciate it, was having trouble sorting out the string parsing commands.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Item Subtype from player slot

Thread Tools
Display Modes

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