View difference between Paste ID: 2bdXP0VE and jsSqewdr
SHOW: | | - or go back to the newest paste.
1
inputDirection = 4
2-
macerateDirection = 1
2+
extractDirection = 1
3-
furnaceDirection = 0
3+
compressDirectoin = 0
4
sortDirection = 5
5
6
sorter = peripheral.wrap("back")
7
8
function Set (list)
9
  local set = {}
10
  for _, l in ipairs(list) do set[l] = true end
11
  return set
12
end
13
14-
furnace = Set {197311, 709385, 774921, 807689, 840457, 9368761, 971529, 7918345, 7951113, 7983881, 8016649, 8049417, 8082185, 20257, 53025, 1068833, 1101601, 1134369, 1167137}
14+
compress = Set {545545,30243, 302455, 30151}
15-
macerate = Set {14, 15, 16, 21, 244, 33012, 245, 248, 249, 33017, 65785, 688, 33471, 66239, 230079, 262847, 295615, 361151, 313919, 2001, 34769, 67537, 100305, 133073}
15+
extractor = Set {627, 30217}
16
17
while true do
18
  sleep(0)
19-
  for uuid, amount in pairs(sorter.list(inputDirection)) do
19+
  event, uuid, amount = os.pullEvent("isort_item")
20-
    if macerate[uuid] then
20+
  if compress[uuid] then
21-
      sorter.extract(inputDirection, uuid, macerateDirection, amount)
21+
    sorter.sort(compressDirection)
22-
    elseif furnace[uuid] then
22+
  elseif extractor[uuid] then
23-
      sorter.extract(inputDirection, uuid, furnaceDirection, amount)
23+
    sorter.sort(extractDirection)
24-
    else
24+
  else
25-
      sorter.extract(inputDirection, uuid, sortDirection, amount)
25+
    sorter.sort(sortDirection)
26-
    end
26+
27
end