I have idea, how make classcall module for Hunters on Nefarian.
As i know, UseContainerItem function does not require keypress, so:
-when classcall coming UseItemByName("fakebow"), after classcall done UseItemByName("mainbow")
-user enters the name of main and fake bows into chatboxes in BigWigs options
-function UseItemByName("itemname") i found in SuperMacro addon, so need to add it into BigWigs (to working independently of the SuperMacro)...
I am not sure what exactly need but I suppose that:
function UseItemByName(item)
local bag,slot = FindItem(item);
if ( not bag ) then return; end;
if ( slot ) then
UseContainerItem(bag,slot); -- use, equip item in bag
return bag, slot;
else
UseInventoryItem(bag); -- unequip from body
return bag;
end
end
function FindItem(item)
if ( not item ) then return; end
item = string.lower(ItemLinkToName(item));
local link;
for i = 1,23 do
link = GetInventoryItemLink("player",i);
if ( link ) then
if ( item == string.lower(ItemLinkToName(link)) )then
return i, nil, GetInventoryItemTexture('player', i), GetInventoryItemCount('player', i);
end
end
end
local count, bag, slot, texture;
local totalcount = 0;
for i = 0,NUM_BAG_FRAMES do
for j = 1,MAX_CONTAINER_ITEMS do
link = GetContainerItemLink(i,j);
if ( link ) then
if ( item == string.lower(ItemLinkToName(link))) then
bag, slot = i, j;
texture, count = GetContainerItemInfo(i,j);
totalcount = totalcount + count;
end
end
end
end
return bag, slot, texture, totalcount;
end
function ItemLinkToName(link)
if ( link ) then
return gsub(link,"^.*%[(.*)%].*$","%1");
end
end