A bit more advanced version. Create 2 new macros with the following code.
Run this before the start of a milling session:
Code: Select all
/run function FnH() for i=0,4 do for j=1,GetContainerNumSlots(i) do local t={GetItemInfo(GetContainerItemLink(i,j) or 0)} if t[7]=="Herb" and select(2,GetContainerItemInfo(i,j))>=5 then return i.." "..j,t[1] end end end end
Then use this as your milling button:
Code: Select all
/run local f,l,n=AuM or CreateFrame("Button","AuM",nil,"SecureActionButtonTemplate") f:SetAttribute("type","macro") l,n=FnH() if l then f:SetAttribute("macrotext","/cast Milling\n/use "..l) SetMacroItem("Macro Name",n) end
/click AuM
(change "Macro Name" to the name of the macro)
It will skip over stacks less than 5, it will also mill herbs from past expansions and it will change the macro's icon to the current herb you're milling and how many of that herb you have left.
I found this gem on the official wow forums about a year ago and I've never looked back.