Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Marks all unowned items with a minimum wear value for dumping
- local function markDump(minWear)
- local count = 0
- -- iterate through all the items
- for _, item in ipairs(df.global.world.items.all) do
- -- if item wear meets the minimum, check if its unowned and mark it for dump
- if (item.wear >= minWear) and (item.flags.owned == false) and (item.flags.trader == false) and (item.flags.dump == false) then
- item.flags.dump = true
- count = count + 1
- end
- end
- print(count .. ' worn items were marked for dump')
- end
- local args = {...}
- if (args[1] == 'help') then
- -- print usage
- print([[dump-wear - this script marks for dump all unowned items with a min wear level
- dump-wear
- use the default minimum wear level of x(pig tail fiber sock)x
- dump-wear minlevel
- specifies a minimum wear level for dumping
- minlevel = 'x', 'X', or 'XX'
- ]])
- elseif (args[1] == 'x') then
- markDump(1)
- elseif (args[1] == 'X') then
- markDump(2)
- elseif (args[1] == 'XX') then
- markDump(3)
- else
- -- default dump level of x(pig tail fiber sock)x
- markDump(1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement