37 lines
920 B
Lua
37 lines
920 B
Lua
local tnt = peripheral.wrap "right"
|
|
local singularity = peripheral.wrap "left"
|
|
local ender_dust = peripheral.wrap "minecraft:dropper_0"
|
|
local vac = peripheral.wrap "thermal:device_collector_0"
|
|
|
|
local function item_count(list)
|
|
local count = 0
|
|
for _, v in pairs(list) do
|
|
count = count + v.count
|
|
end
|
|
return count
|
|
end
|
|
|
|
while true do
|
|
if
|
|
item_count(vac.list()) == 0
|
|
and item_count(tnt.list()) >= 1
|
|
and item_count(singularity.list()) >= 15
|
|
and item_count(ender_dust.list()) >= 15
|
|
then
|
|
local i = 0
|
|
while i < 15 do
|
|
i = i + 1
|
|
redstone.setOutput("left", true)
|
|
os.sleep(0.1)
|
|
redstone.setOutput("left", false)
|
|
os.sleep(0.1)
|
|
end
|
|
os.sleep(1)
|
|
redstone.setOutput("right", true)
|
|
os.sleep(0.1)
|
|
redstone.setOutput("right", false)
|
|
end
|
|
|
|
os.sleep(25)
|
|
end
|