Not sure if it was fixed but I couldn't make it work properly with the lua that Droidz suggested or any other way, so I put one together that works with vanilla API
local food, water = 0, 0; for bag = 0,4,1 do for slot = 1, GetContainerNumSlots(bag), 1 do local name = GetContainerItemLink(bag,slot); if name and string.find(name, "Conjured") then local _, count = GetContainerItemInfo(bag,slot); if string.find(name, 'Water') then water = water + count; else food = food + count; end; end; end; end; if food <= 4 then CastSpellByName('Conjure Food') end; if water <= 4 then CastSpellByName('Conjure Water') end