Reply
Thread Tools Display Modes
Unread 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);
blindsleeper is offline   Reply With Quote
Unread 11-23-05, 04:20 PM   #2
Gello
A Scalebane Royal Guard
AddOn Author - Click to view addons
Join Date: Jan 2005
Posts: 442
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);
Gello is online now   Reply With Quote
Unread 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.
blindsleeper is offline   Reply With Quote
Reply

Go BackWoWInterface » 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