Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local monitor = peripheral.wrap("monitor_2")
- local turbine = peripheral.wrap("Industrial Turbine_0")
- function formateNumber(n) --http://richard.warburton.it
- if type(n) == "number" then
- n = string.format("%.f", tostring(n))
- else
- n = string.format("%.f", n)
- end
- local left,num,right = string.match(n,'^([^%d]*%d)(%d*)(.-)$');
- return left..(num:reverse():gsub('(%d%d%d)','%1,'):reverse())..right;
- end
- function round(num, idp)
- local mult = 10^(idp or 0);
- return math.floor(num * mult + 0.5) / mult;
- end
- monitor.clear()
- monitor.setTextColor(colors.combine(colors.orange, colors.yellow))
- monitor.setTextScale(1)
- while true do
- local isOn = turbine.isFormed()
- local SteamInv = turbine.getSteam()
- local SteamFlowRate = turbine.getFlowRate()
- local SteamInput = turbine.getSteamInput()
- local PowerOutput = SteamFlowRate * 40
- monitor.setCursorPos(2,6)
- monitor.clearLine()
- if isOn then
- monitor.setTextColor(colors.lime)
- monitor.write("Turbine is FORMED")
- else
- monitor.setTextColor(colors.red)
- monitor.write("Turbine is NOT FORMED")
- end
- monitor.setTextColor(colors.combine(colors.orange, colors.yellow))
- monitor.setCursorPos(2,9)
- monitor.clearLine()
- monitor.write("Turbine is consuming " .. formateNumber(SteamInput) .. " mB/t steam.")
- monitor.setCursorPos(2,12)
- monitor.clearLine()
- monitor.write("Turbine is producing " .. formateNumber(PowerOutput) .. " RF/t.")
- sleep(0.1)
- end
Add Comment
Please, Sign In to add comment