Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function setBundled(side,color,state)
- if state == true then
- local input = rs.getBundledInput(side)
- rs.setBundledOutput(side, colors.combine(input, color))
- else
- local input = rs.getBundledInput(side)
- rs.setBundledOutput(side, colors.subtract(input, color))
- end
- end
- function getBundled(side,color)
- return colors.test(redstone.getBundledInput(side), color)
- end
- local tank = peripheral.wrap("back")
- local sign = peripheral.wrap("front")
- while true do
- if tank ~= nil then
- local tankinfo = tank.getTankInfo("")
- print("tank ok")
- if tankinfo[1]["amount"] == nil then
- tankinfo[1]["amount"] = 0
- print("tank leeg0")
- end
- print(tankinfo[1]["amount"])
- if tankinfo[1]["amount"] <= 500 then
- print("tank leeg")
- sleep(1)
- setBundled("left",colors.white,false)
- print("tank leeg2")
- sleep(10)
- print("tank leeg3")
- if sign ~= nil then
- tankinfo = tank.getTankInfo("")
- if tankinfo[1]["amount"] == nil then
- tankinfo[1]["amount"] = 0
- end
- sign.setLine(2,(tankinfo[1]["amount"])*6 .."mB/Min")
- end
- else
- setBundled("left",colors.white,true)
- end
- else
- if sign ~= nil then
- sign.setText("")
- sign.setLine(1,"Geen Tank")
- end
- end
- sleep(1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement