Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- pastebin get b6DDeput startup
- reactor = peripheral.wrap("left")
- monitor = peripheral.wrap("front")
- MAXWIDTH = 29
- MAXHIGHT = 26
- GRAPHMAX = 20
- FUELMAX = reactor.getFuelAmountMax()
- ENERGYMAX = reactor.getEnergyCapacity()
- HEATMAX = 2000
- monitor.setBackgroundColour(32768)
- monitor.clear()
- monitor.setCursorBlink(false)
- while(reactor.getActive)
- do
- fuel = reactor.getFuelAmount()
- reactorEnergy = reactor.getEnergyStored()
- controlRodLevel = reactor.getControlRodLevel(1)
- energy = reactor.getEnergyStored()
- heat = reactor.getFuelTemperature()
- --Level marker for reactor fuel Level
- monitor.setBackgroundColour(32768)
- monitor.setTextColor(1)
- monitor.setCursorPos(1,1)
- monitor.write("Fuel Level:")
- monitor.setCursorPos(1,2)
- monitor.write("--------------------")
- for i=3,5,1
- do
- for j = 1, GRAPHMAX, 1
- do
- monitor.setCursorPos(j,i)
- if(0<j and j<=5)
- then
- monitor.setBackgroundColour(16384)
- if( ((fuel/FUELMAX)*20) >= j )
- then
- monitor.setTextColor(1)
- else
- monitor.setTextColor(16384)
- end
- monitor.write("|")
- elseif(5<j and j<=10)
- then
- monitor.setBackgroundColour(2)
- if( ((fuel/FUELMAX)*20) >= j )
- then
- monitor.setTextColor(1)
- else
- monitor.setTextColor(2)
- end
- monitor.write("|")
- elseif(10<j)
- then
- monitor.setBackgroundColour(8192)
- if( ((fuel/FUELMAX)*20) >= j )
- then
- monitor.setTextColor(1)
- else
- monitor.setTextColor(8192)
- end
- monitor.write("|")
- end
- end
- end
- --Energy Level marker
- monitor.setBackgroundColour(32768)
- monitor.setTextColor(1)
- monitor.setCursorPos(1,6)
- monitor.write("Energy Level:")
- monitor.setCursorPos(1,7)
- monitor.write("--------------------")
- for i=8,10,1
- do
- for j = 1, GRAPHMAX, 1
- do
- monitor.setCursorPos(j,i)
- if(0<j and j<=10)
- then
- monitor.setBackgroundColour(8192)
- if( ((energy/ENERGYMAX)*20) >= j )
- then
- monitor.setTextColor(1)
- else
- monitor.setTextColor(8192)
- end
- monitor.write("|")
- elseif(10<j and j<=15)
- then
- monitor.setBackgroundColour(2)
- if( ((energy/ENERGYMAX)*20) >= j )
- then
- monitor.setTextColor(1)
- else
- monitor.setTextColor(2)
- end
- monitor.write("|")
- elseif(15<j)
- then
- monitor.setBackgroundColour(16384)
- if( ((energy/ENERGYMAX)*20) >= j )
- then
- monitor.setTextColor(1)
- else
- monitor.setTextColor(16384)
- end
- monitor.write("|")
- end
- end
- end
- --Heat Level
- monitor.setBackgroundColour(32768)
- monitor.setTextColor(1)
- monitor.setCursorPos(1,11)
- monitor.write("Heat Level:")
- monitor.setCursorPos(1,12)
- monitor.write("--------------------")
- for i=13,15,1
- do
- for j = 1, GRAPHMAX, 1
- do
- monitor.setCursorPos(j,i)
- if(0<j and j<=10)
- then
- monitor.setBackgroundColour(8192)
- if( ((heat/HEATMAX)*20) >= j )
- then
- monitor.setTextColor(1)
- else
- monitor.setTextColor(8192)
- end
- monitor.write("|")
- elseif(10<j and j<=15)
- then
- monitor.setBackgroundColour(2)
- if( ((heat/HEATMAX)*20) >= j )
- then
- monitor.setTextColor(1)
- else
- monitor.setTextColor(2)
- end
- monitor.write("|")
- elseif(15<j)
- then
- monitor.setBackgroundColour(16384)
- if( ((heat/HEATMAX)*20) >= j )
- then
- monitor.setTextColor(1)
- else
- monitor.setTextColor(16384)
- end
- monitor.write("|")
- end
- end
- end
- --Control rod Level
- monitor.setBackgroundColour(32768)
- monitor.setTextColor(1)
- monitor.setCursorPos(21,2)
- monitor.write(" Control")
- monitor.setCursorPos(21,3)
- monitor.write(" Rod:")
- monitor.setCursorPos(21,4)
- monitor.write(" ")
- monitor.write(math.floor((controlRodLevel/100) *100))
- monitor.write("%")
- monitor.setCursorPos(21,5)
- monitor.write("---------")
- for i=21, 29 ,1
- do
- for j = 6, MAXHIGHT, 1
- do
- monitor.setCursorPos(i,j)
- if( (((controlRodLevel/100) * 20) + 6) >= j and 22<i and i<28)
- then
- monitor.setTextColor(32768)
- else
- monitor.setTextColor(16)
- end
- monitor.setBackgroundColour(16)
- monitor.write("|")
- end
- end
- --Control rod adjustment
- inverseEnergyLvl = math.floor((energy/ENERGYMAX) * 100)
- reactor.setAllControlRodLevels(inverseEnergyLvl)
- --power per tic reader
- monitor.setTextColor(1)
- monitor.setBackgroundColour(32768)
- monitor.setCursorPos(1,16)
- monitor.write("Power Per Tick:")
- monitor.setCursorPos(1,17)
- monitor.write("--------------------")
- monitor.setCursorPos(1,18)
- monitor.write(reactor.getEnergyProducedLastTick())
- sleep(.1)
- --End WhileLoop
- end
Add Comment
Please, Sign In to add comment