Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local d = peripheral.wrap("drum_1")
- local t = peripheral.wrap("drum_2")
- local n = peripheral.wrap("drum_3")
- local l = peripheral.wrap("drum_4")
- local md = peripheral.wrap("monitor_0")
- local mt = peripheral.wrap("monitor_1")
- local mn = peripheral.wrap("monitor_2")
- local ml = peripheral.wrap("monitor_3")
- local deutrium
- local tritiumOn
- local tritiumOff
- local nitrogen
- local lubrican
- 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
- while true do
- term.clear()
- -- deutrium
- local fluidRaw, fluidName, fluidAmount, fluidCapacity = getTank(d)
- percentDrum = math.floor(100 * fluidAmount / fluidCapacity )
- term.setCursorPos(1,1)
- term.write(fluidRaw.." "..tostring(fluidAmount).." mB | Remplissage: "..tostring(percentDrum).." %" )
- if percentDrum < 30 then
- deutrium = 1
- else
- deutrium = 0
- end
- md.clear()
- md.setCursorPos(6,1)
- md.setTextColor(colors.lightBlue)
- md.write(fluidRaw)
- md.setCursorPos(1,3)
- md.setTextColor(colors.white)
- md.write("Quantite: ")
- md.setCursorPos(8,4)
- md.setTextColor(colors.yellow)
- md.write(tostring(fluidAmount))
- md.setTextColor(colors.white)
- md.write(" mB")
- md.setCursorPos(1,5)
- md.write("Remplissage: ")
- md.setTextColor(colors.yellow)
- md.write(tostring(percentDrum))
- md.setTextColor(colors.white)
- md.write(" %")
- -- tritium
- local fluidRaw, fluidName, fluidAmount, fluidCapacity = getTank(t)
- percentDrum = math.floor(100 * fluidAmount / fluidCapacity )
- term.setCursorPos(1,2)
- term.write(fluidRaw.." "..tostring(fluidAmount).." mB | Remplissage: "..tostring(percentDrum).." %" )
- if percentDrum < 30 then
- tritiumOn = 4
- tritiumOff = 0
- else
- tritiumOn = 0
- tritiumOff = 2
- end
- mt.clear()
- mt.setCursorPos(6,1)
- mt.setTextColor(colors.lightBlue)
- mt.write(fluidRaw)
- mt.setCursorPos(1,3)
- mt.setTextColor(colors.white)
- mt.write("Quantite: ")
- mt.setCursorPos(8,4)
- mt.setTextColor(colors.yellow)
- mt.write(tostring(fluidAmount))
- mt.setTextColor(colors.white)
- mt.write(" mB")
- mt.setCursorPos(1,5)
- mt.write("Remplissage: ")
- mt.setTextColor(colors.yellow)
- mt.write(tostring(percentDrum))
- mt.setTextColor(colors.white)
- mt.write(" %")
- -- nitrogen
- local fluidRaw, fluidName, fluidAmount, fluidCapacity = getTank(n)
- percentDrum = math.floor(100 * fluidAmount / fluidCapacity )
- term.setCursorPos(1,3)
- term.write(fluidRaw.." "..tostring(fluidAmount).." mB | Remplissage: "..tostring(percentDrum).." %" )
- if percentDrum < 30 then
- nitrogen = 8
- else
- nitrogen = 0
- end
- mn.clear()
- mn.setCursorPos(6,1)
- mn.setTextColor(colors.lightBlue)
- mn.write(fluidRaw)
- mn.setCursorPos(1,3)
- mn.setTextColor(colors.white)
- mn.write("Quantite: ")
- mn.setCursorPos(8,4)
- mn.setTextColor(colors.yellow)
- mn.write(tostring(fluidAmount))
- mn.setTextColor(colors.white)
- mn.write(" mB")
- mn.setCursorPos(1,5)
- mn.write("Remplissage: ")
- mn.setTextColor(colors.yellow)
- mn.write(tostring(percentDrum))
- mn.setTextColor(colors.white)
- mn.write(" %")
- -- lubrican
- local fluidRaw, fluidName, fluidAmount, fluidCapacity = getTank(l)
- percentDrum = math.floor(100 * fluidAmount / fluidCapacity )
- term.setCursorPos(1,4)
- term.write(fluidRaw.." "..tostring(fluidAmount).." mB | Remplissage: "..tostring(percentDrum).." %" )
- if percentDrum < 30 then
- lubrican = 16
- else
- lubrican = 0
- end
- ml.clear()
- ml.setCursorPos(6,1)
- ml.setTextColor(colors.lightBlue)
- ml.write(fluidRaw)
- ml.setCursorPos(1,3)
- ml.setTextColor(colors.white)
- ml.write("Quantite: ")
- ml.setCursorPos(8,4)
- ml.setTextColor(colors.yellow)
- ml.write(tostring(fluidAmount))
- ml.setTextColor(colors.white)
- ml.write(" mB")
- ml.setCursorPos(1,5)
- ml.write("Remplissage: ")
- ml.setTextColor(colors.yellow)
- ml.write(tostring(percentDrum))
- ml.setTextColor(colors.white)
- ml.write(" %")
- -- redstone Output
- local value = deutrium+tritiumOn+tritiumOff+nitrogen+lubrican
- term.setCursorPos(1,5)
- term.write("RedstoneOutput: "..tostring(value))
- redstone.setBundledOutput("top",value)
- sleep(1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement