you got choice between list and category:
provide cattegory from looting
npcsellitems('is')
provide list of items
npcsellitems({'demon helmet','demon armor','demon legs'})
function npcsellitems(tableorcategory)
local args = tableorcategory
if #args == 0 then
printerror('incorrect argument provided')
return false
end
if not ischannel('NPCs') then
say('hi') wait(1000,1500)
else
npcsay('hi') wait(1000,1500)
end
npcsay('trade') waitping(2,4)
if not $tradeopen then return false end
if type(args) == 'table' then
for _, k in ipairs(args) do
while tradecount('sell', k) > 0 do
sellitems(item, tradecount('sell',k))
end
end
elseif type(args) == 'string' then
foreach lootingitem m args do
local itemdata = iteminfo(m.id)
while tradecount('sell', itemdata.name) > 0 do
sellitems(itemdata.name, tradecount('sell', itemdata.name))
end
end
else
printerror('incorrect type of argument')
return false
end
end