Cleanup
(Corrected valid range of the parameter bagID.) |
(Cleanup) |
||
Line 25: | Line 25: | ||
== Example == | == Example == | ||
<!-- If it helps, include an example here, though it's not required if the usage is self-explanatory --> | <!-- If it helps, include an example here, though it's not required if the usage is self-explanatory --> | ||
function UseContainerItemByName( | function UseContainerItemByName(search) | ||
for bag=0,4 do | for bag = 0,4 do | ||
for slot=1,GetContainerNumSlots(bag) do | for slot = 1,GetContainerNumSlots(bag) do | ||
local item = GetContainerItemLink(bag,slot) | |||
if item and item:find(search) then | |||
UseContainerItem(bag,slot) | |||
end | end | ||
end | end |