Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local tank = peripheral.wrap("back")
- local info
- local amount
- local capacity
- local percentage
- local outputRedstone
- while true do
- info = tank.getTankInfo("unknown")
- for k,v in pairs(info) do
- for x, y in pairs(v) do
- if x == "amount" then
- amount = y
- end
- if x == "capacity" then
- capacity = y
- end
- end
- end
- percentage = amount / capacity
- outputRedstone = (percentage >= 0.25)
- redstone.setOutput("bottom", outputRedstone)
- print("Percentage: "..percentage..", output: "..tostring(outputRedstone)..", time: "..os.time())
- sleep(2)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement