WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   Item Subtype from player slot (https://www.wowinterface.com/forums/showthread.php?t=2474)

blindsleeper 11-23-05 12:03 AM

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);


Gello 11-23-05 04:20 PM

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);

blindsleeper 11-23-05 06:07 PM

Thanks! appriciate it, was having trouble sorting out the string parsing commands.


All times are GMT -6. The time now is 04:37 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI