Advertisement
Lordeah18

Untitled

Jan 3rd, 2020
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. blacklist = {
  2. "modularforcefieldsystem:forcicium", -1,
  3. "thermalfoundation:material": 866
  4. }
  5.  
  6.  
  7. function isBlacklisted(name, damage)
  8. local matchFound
  9. for blacklisted_name, blacklisted_damage in ipairs(blacklist) do
  10. if name == blacklisted_name and (damage == -1 or damage == blacklisted_damage) then
  11. matchFound = true
  12. break
  13. end
  14. end
  15. return matchFound
  16. end
  17.  
  18.  
  19.  
  20. function move(machine, side, slot)
  21. item = machine.list()[slot]
  22. if item ~= nil then
  23. if isBlacklisted(item.name, item.damage) then
  24. machine.pushItems(side[2], slot)
  25. end
  26. moved = machine.pushItems(side[1], slot)
  27.  
  28. end
  29. end
  30. --Clean compressor output
  31. function main()
  32. print("Running Compressor")
  33. compressor = peripheral.wrap("xu2:tilemachinereceiver_0")
  34. move(compresor, {"right", "down"}, 2)
  35. move(compresor, {"right", "down"}, 3)
  36. end
  37.  
  38.  
  39. while true do
  40. main()
  41. end
  42.  
  43. return {
  44. main = main
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement