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_gold"
- local mainPeripheral
- local function countCoal ()
- local res = 0
- local content = mainPeripheral.list()
- for n=1,96 do
- if content[n] ~= nil then
- res = res + content[n]["count"]
- end
- 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 = countCoal()
- -- TODO send output to rednet
- sleep(900)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement