Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local sides = { "top", "bottom", "left", "right", "front", "back" }
- local peripheralType = "minecraft:ironchest_diamond"
- local mainPeripheral
- local function countCoke ()
- local res = 0
- local content = mainPeripheral.list()
- for n=1,96 do
- res = res + content[n]
- end
- coke = res
- return res
- end
- print("Finding " .. peripheralType .. "...")
- local found = false
- for i = 1, #sides do
- if peripheral.isPresent(sides[i]) then
- if peripheral.getType(sides[i]) == peripheralType then
- print("Found: "..sides[i])
- mainPeripheral = peripheral.wrap(sides[i])
- found = true
- end
- end
- end
- local count
- if found then
- redstone.setOutput("bottom",true)
- while true do
- count = countCoke()
- if count == 0 then
- redstone.setOutput("top",true)
- else
- redstone.setOutput("top",false)
- end
- -- TODO send output to rednet
- sleep(900)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement