This:
--count scannable items so we know how many types we need to list
local temp = 0
local skip = 0
for a,b in pairs (scan_object_e) do
skip = 0
for c,d in pairs (temp_selection) do
if scan_object_name[a] == temp_selection[c] then
skip = 1
break
end
end
if skip == 0 then
temp = temp + 1
temp_selection[temp] = scan_object_name[a]
end
end
Could probably be replaced by this:
local tempList = {}
for _, v in pairs( scan_object_name ) do tempList[ v ] = true end
temp_selection = {}
for k, _ in pairs( tempList ) do temp_selection[ #temp_selection + 1 ] = k end
Been there, done that, got all the T-Shirts!