Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- HUD = peripheral.wrap("left")
- monitor = peripheral.wrap("top")
- --sfBoiler = peripheral.wrap("solid_fueled_boiler_firebox_0")
- lfBoiler = peripheral.wrap("liquid_fueled_boiler_firebox_3")
- lfBoiler2 = peripheral.wrap("liquid_fueled_boiler_firebox_4")
- lavaTank = peripheral.wrap("steel_tank_valve_1")
- ethanolTank = peripheral.wrap("steel_tank_valve_3")
- steamTank = peripheral.wrap("steel_tank_valve_2")
- steamTurbine = peripheral.wrap("steam_turbine_housing_0")
- steamComputer = peripheral.wrap("computer_2")
- mfe = peripheral.wrap("batbox_2")
- mfsu = peripheral.wrap("batbox_1")
- craftingMonitor = peripheral.wrap("me_crafting_monitor_0")
- steamOn = false
- rednet.open("bottom")
- function roundNum(val, decimal)
- if (decimal) then
- return math.floor(((val * 10^decimal) + 0.5) / (10^decimal))
- else
- return math.floor(val+0.5)
- end
- end
- function drawPixel(x, y, color)
- monitor.setCursorPos(x, y)
- monitor.setBackgroundColor(color)
- monitor.write(" ")
- end
- function drawTank(x, y, color, maxLiq, currentLiq, tankName)
- if currentLiq == nil then
- currentLiq = 0
- end
- if maxLiq == nil then
- maxLiq = 0
- end
- percentage = roundNum(((currentLiq / maxLiq) * 100), 0)
- for i = 0, 11 do
- drawPixel(x, y + i, colors.white)
- drawPixel(x + 19, y + i, colors.white)
- end
- for i = 1, 18 do
- drawPixel(x + i, y + 11, colors.white)
- end
- rows = roundNum((percentage / 10), 0)
- for i = 10 - rows, 10 do
- for j = 1, 18 do
- if tankName == "Lava Tank" then
- if math.random(1, 20 - i) == 1 then
- if math.random(1, 4) == 1 then
- drawPixel(x + j, y + i, colors.black)
- else
- drawPixel(x + j, y + i, colors.orange)
- end
- else
- drawPixel(x + j, y + i, color)
- end
- elseif tankName == "Steam Tank" then
- if math.random(1, 20 - i) == 1 then
- drawPixel(x + j, y + i, colors.lightGray)
- else
- drawPixel(x + j, y + i, color)
- end
- else
- drawPixel(x + j, y + i, color)
- end
- end
- end
- monitor.setCursorPos(x, y + 13)
- monitor.setBackgroundColor(colors.black)
- monitor.setTextColor(colors.white)
- monitor.write(tankName .. " " .. tostring(percentage) .. "%")
- monitor.setCursorPos(x, y + 14)
- monitor.write(tostring(currentLiq) .. "mB / " .. tostring(maxLiq) .. "mB")
- end
- function drawLiqBoiler(x, y, waterCap, waterCur, temp, fuelMax, fuelCurrent, steamMax, steamCurrent, name)
- if waterCur == nil then
- waterCur = 0
- end
- if waterCap == nil then
- waterCap = 0
- end
- if fuelCurrent == nil then
- fuelCurrent = 0
- end
- if fuelMax == nil then
- fuelMax = 0
- end
- if steamCurrent == nil then
- steamCurrent = 0
- end
- if steamMax == nil then
- steamMax = 0
- end
- waterPercentage = roundNum(((waterCur / waterCap) * 100), 0)
- fuelPercentage = roundNum(((fuelCurrent / fuelMax) * 100), 0)
- steamPercentage = roundNum(((steamCurrent / steamMax) * 100), 0)
- waterRows = roundNum((waterPercentage / 10), 0)
- fuelRows = roundNum((fuelPercentage / 10), 0)
- steamRows = roundNum((steamPercentage / 10), 0)
- for i = 2, 13 do
- drawPixel(x, y + i, colors.white)
- drawPixel(x + 2, y + i, colors.white)
- drawPixel(x + 5, y + i, colors.white)
- drawPixel(x + 7, y + i, colors.white)
- drawPixel(x + 10, y + i, colors.white)
- drawPixel(x + 12, y + i, colors.white)
- end
- drawPixel(x + 1, y + 13, colors.white)
- drawPixel(x + 6, y + 13, colors.white)
- drawPixel(x + 11, y + 13, colors.white)
- for i = 10 - waterRows, 10 do
- drawPixel(x + 1, y + i + 2, colors.blue)
- end
- for i = 10 - fuelRows, 10 do
- drawPixel(x + 6, y + i + 2, colors.purple)
- end
- for i = 10 - steamRows, 10 do
- drawPixel(x + 11, y + i + 2, colors.gray)
- end
- monitor.setCursorPos(x, y + 15)
- monitor.setBackgroundColor(colors.black)
- monitor.setTextColor(colors.white)
- monitor.write("Temp = " .. roundNum(temp, 2))
- monitor.setCursorPos(x, y)
- monitor.write(name)
- monitor.setCursorPos(x + 1, y + 1)
- monitor.setTextColor(colors.blue)
- monitor.write("W")
- monitor.setCursorPos(x + 6, y + 1)
- monitor.setTextColor(colors.purple)
- monitor.write("F")
- monitor.setCursorPos(x + 11, y + 1)
- monitor.setTextColor(colors.gray)
- monitor.write("S")
- end
- function drawMFSU(x, y, mfsuMax, mfsuCurrent)
- mfsuPercent = roundNum(((mfsuCurrent / mfsuMax) * 100), 0)
- mfsuCols = roundNum((mfsuPercent / (10 / 3)), 0)
- drawPixel(x, y + 2, colors.white)
- drawPixel(x + 32, y + 2, colors.white)
- for i = 0, 32 do
- drawPixel(x + i, y + 1, colors.white)
- drawPixel(x + i, y + 3, colors.white)
- end
- for i = 0, mfsuCols do
- drawPixel(x + 1 + i, y + 2, colors.red)
- end
- monitor.setCursorPos(x, y)
- monitor.setBackgroundColor(colors.black)
- monitor.setTextColor(colors.white)
- monitor.write("MFSU - " .. mfsuPercent .. "% (" .. mfsuCurrent .. "EU / " .. mfsuMax .. "EU)")
- end
- function drawMFE(x, y, mfeMax, mfeCurrent)
- mfePercent = roundNum(((mfeCurrent / mfeMax) * 100), 0)
- mfeCols = roundNum((mfePercent / (10/3)), 0)
- drawPixel(x, y + 2, colors.white)
- drawPixel(x + 32, y + 2, colors.white)
- for i = 0, 32 do
- drawPixel(x + i, y + 1, colors.white)
- drawPixel(x + i, y + 3, colors.white)
- end
- for i = 0, mfeCols do
- drawPixel(x + 1 + i, y + 2, colors.red)
- end
- monitor.setCursorPos(x, y)
- monitor.setBackgroundColor(colors.black)
- monitor.setTextColor(colors.white)
- monitor.write("MFE - " .. mfePercent .. "% (" .. mfeCurrent .. "EU / " .. mfeMax .. "EU)")
- end
- while true do
- monitor.clear()
- HUD.clear()
- drawTank(2, 2, colors.red, lavaTank.getTanks("unknown")[1].capacity, lavaTank.getTanks("unknown")[1].amount, "Lava Tank")
- drawTank(26, 2, colors.purple, ethanolTank.getTanks("unknown")[1].capacity, ethanolTank.getTanks("unknown")[1].amount, "BioFuel Tank")
- drawTank(50, 2, colors.gray, steamTank.getTanks("unknown")[1].capacity, steamTank.getTanks("unknown")[1].amount, "Steam Tank")
- drawLiqBoiler(2, 20, lfBoiler.getTanks("unknown")[1].capacity, lfBoiler.getTanks("unknown")[1].amount, lfBoiler.getTemperature(), lfBoiler.getTanks("unknown")[3].capacity, lfBoiler.getTanks("unknown")[3].amount, lfBoiler.getTanks("unknown")[2].capacity, lfBoiler.getTanks("unknown")[2].amount, "Boiler 1")
- drawLiqBoiler(19, 20, lfBoiler2.getTanks("unknown")[1].capacity, lfBoiler2.getTanks("unknown")[1].amount, lfBoiler2.getTemperature(), lfBoiler2.getTanks("unknown")[3].capacity, lfBoiler2.getTanks("unknown")[3].amount, lfBoiler2.getTanks("unknown")[2].capacity, lfBoiler2.getTanks("unknown")[2].amount, "Boiler 2")
- drawMFSU(36, 20, mfsu.getCapacity(), mfsu.getStored())
- drawMFE(36, 26, mfe.getCapacity(), mfe.getStored())
- sleep(1)
- end
Add Comment
Please, Sign In to add comment