Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Sly's reactor--
- --peripherals
- local m = {27,28,26}
- local monitors = {}
- for i=1,3 do
- monitors[i] = peripheral.wrap("monitor_"..m[i])
- end
- local t = {6,3,7,9,4,2,5,8}
- local turbines = {}
- for i=1,8 do
- turbines[i] = peripheral.wrap("BigReactors-Turbine_"..t[i])
- end
- function drawGauge(i,m,pos)
- local tur = turbines[i]
- local mon = monitors[m]
- local RPM = tur.getRotorSpeed()
- local energyLastTick = tur.getEnergyProducedLastTick()
- local flowRate = tur.getFluidFlowRate()
- local coils = tur.getInductorEngaged()
- local RPMp = math.ceil(((RPM/2000) * 30) - 0.5)
- for y = 0,31 do
- mon.setCursorPos(10,36-y)
- mon.setBackgroundColor(colors.white)
- mon.write(" ")
- if y==0 or y == 31 or y<=RPMp then
- mon.setBackgroundColor(colors.white)
- else
- mon.setBackgroundColor(Cols[c[y]])
- end
- mon.write(string.rep(" ",8))
- mon.setBackgroundColor(colors.white)
- mon.write(" ")
- mon.setBackgroundColor(colors.black)
- end
- end
- while true do
- monitors[1].setBackgroundColor(colors.black)
- monitors[1].clear()
- drawGauge(5,1,{1,1})
- sleep(0.5)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement