add quantum entangler code
This commit is contained in:
parent
35b3f6d15b
commit
5fcc972a99
36
packs/above_beyond/quantum_entangler/startup.lua
Normal file
36
packs/above_beyond/quantum_entangler/startup.lua
Normal file
|
@ -0,0 +1,36 @@
|
|||
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
|
||||
#vac.list() == 0
|
||||
and item_count(tnt.list()) >= 1
|
||||
and item_count(singularity.list()) >= 5
|
||||
and item_count(ender_dust.list()) >= 5
|
||||
then
|
||||
local i = 0
|
||||
while i < 5 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
|
Loading…
Reference in a new issue