Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.loadAPI("ocs/apis/sensor")
- tank = sensor.wrap("top")
- uppertank = 235000
- lowertank = 5000
- while true do
- tank1Details = tank.getTargetDetails("-2,1,-1")
- filltank1 = tank1Details.Tanks[1].Amount
- tank2Details = tank.getTargetDetails("-2,1,1")
- filltank1 = tank2Details.Tanks[1].Amount
- if filltank1 > uppertank and filltank2 > uppertank then
- redstone.setOutput("right", true)
- redstone.setOutput("left", true)
- elseif filltank1 < lowertank and filltank2 > uppertank then
- redstone.setOutput("right", false)
- redstone.setOutput("left", true)
- elseif filltank1 > uppertank and filltank2 < lowertank then
- redstone.setOutput("right", true)
- redstone.setOutput("left", false)
- elseif filltank1 < lowertank and filltank2 < lowertank then
- redstone.setOutput("right", false)
- redstone.setOutput("left", false)
- end
- sleep(3)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement