View difference between Paste ID: fBUiscU4 and 9W5iKwFB
SHOW: | | - or go back to the newest paste.
1
os.loadAPI("ocs/apis/sensor")
2
3
tank = sensor.wrap("top")
4
5
uppertank = 235000
6
lowertank = 5000
7
8
while true do
9
	tank1Details = tank.getTargetDetails("-2,1,-1")
10-
	filltank1 = tank1Details["Amount"]
10+
	filltank1 = tank1Details.Tanks[1].Amount
11
	tank2Details = tank.getTargetDetails("-2,1,1")
12-
	filltank2 = tank2Details["Amount"]
12+
	filltank1 = tank2Details.Tanks[1].Amount
13
	
14
	if filltank1 > uppertank and filltank2 > uppertank then
15
		redstone.setOutput("right", true)
16
		redstone.setOutput("left", true)
17
	
18
	elseif filltank1 < lowertank and filltank2 > uppertank then
19
		redstone.setOutput("right", false)
20
		redstone.setOutput("left", true)
21
	
22
	elseif filltank1 > uppertank and filltank2 < lowertank then
23
		redstone.setOutput("right", true)
24
		redstone.setOutput("left", false)
25
	
26
	elseif filltank1 < lowertank and filltank2 < lowertank then
27
		redstone.setOutput("right", false)
28
		redstone.setOutput("left", false)
29
	end
30
	
31
sleep(3)
32
end