Wowpedia

We have moved to Warcraft Wiki. Click here for information and the new URL.

READ MORE

Wowpedia
Register
Advertisement

Function Replaced 10.0[]

As of 10.0 this function is returning a nil value (on a character that does not have a reagent bag equipped). "attempt to call global 'GetContainerNumSlots' (a nil value)".

When used in a macro:

/run local c,i,n,v=0;for b=1,6 do for s=1,GetContainerNumSlots(b)do i={GetContainerItemInfo(b,s)}n=i[7]if n and string.find(n,"Blood Card")then v={GetItemInfo(n)}q=i[2]c=c+v[11]*q;UseContainerItem(b,s)print(n,q)end;end;end;print(GetCoinText(c))

I've changed this from the original (b=0,5) as she doesn't have a Reagent bag in slot 0 and there are now 6 bags, and tested using the original, 1,6 and 1,5.

Does anyone know if this function has been depreciated or replaced? If the latter, what is the replacement format? Tequima-WoW (talk)

UPDATE: I've since found that the new format is [C_Container.GetContainerNumSlots]. Though this is shown in the first paragraph it's not exactly clear, from the way it's documented, at a glance. Should this article be marked as depreciated in some way, and if so, can someone point me at the boilerplate (I did try searching for it, but could only find examples of it in use).

For anyone interested, I also found a new version of the macro, thanks to Reddit user davelinelol on r/woweconomy:

/run c=C_Container for b=0,4,1 do for s=1,c.GetContainerNumSlots(b),1 do local n=c.GetContainerItemLink(b,s) if n and string.find(n,"Blood Card") then DEFAULT_CHAT_FRAME:AddMessage("- Selling "..n) c.UseContainerItem(b,s) end end end

Tequima-WoW (talk)

Advertisement