Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local tank = peripheral.wrap("back")
- local amount
- function getTank(tankPeriph)
- local tableInfo = tankPeriph.getTankInfo()
- fluidRaw = nil
- fluidName = nil
- fluidAmount = nil
- fluidCapacity = nil
- for k,v in pairs(tableInfo) do
- fluidCapacity = v.capacity
- if v.contents then
- for i,w in pairs(v.contents) do
- if i == "rawName" then
- fluidRaw = w
- elseif i == "amount" then
- fluidAmount = w
- elseif i == "name" then
- fluidName = w
- end
- end
- end
- end
- return fluidRaw, fluidName, fluidAmount, fluidCapacity
- end
- --// Programme de control du tank
- while true do
- redstone.setOutput("front", false)
- local fluidRaw, fluidName, fluidAmount, fluidCapacity = getTank(tank)
- if fluidName then
- redstone.setOutput("front", true)
- end
- sleep (1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement