Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function wrapThis(thing, x)
- local wrapped, i = nil, x
- while wrapped == nil and i <= 100 do
- wrapped = peripheral.wrap(thing.."_"..i)
- i = i + 1
- end
- if wrapped == nil then
- return nil
- else
- return wrapped
- end
- end
- function round(num, idp)
- local mult = 10^(idp or 0)
- return math.floor(num * mult + 0.5) / mult
- end
- while true do
- local r = wrapThis("BigReactors-Reactor", 0)
- local t= {}
- for i = 0, 3 do
- t[i] = wrapThis("BigReactors-Turbine", i)
- end
- local mon = peripheral.wrap("bottom")
- mon.clear()
- mon.setCursorPos(1,1)
- mon.write("Reactor Temp: "..round(r.getCasingTemperature(),1).."°C")
- mon.setCursorPos(1,2)
- mon.write("Fuel Consumption: "..round(r.getFuelConsumedLastTick(),3).."mB/t")
- for i = 0, 3 do
- tur = i + 1
- y = i + 3
- mon.setCursorPos(1,y)
- mon.write("Turbine "..tur..": "..round(t[i].getRotorSpeed(),1).."RPM")
- end
- os.sleep(5)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement