Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local mon = peripheral.wrap("left")
- local rec = peripheral.wrap("bottom")
- local max = 80
- local standard = 44
- -- DNT
- local Cap = max/100
- local softCap = (max-20)/100
- function alert()
- if Deut <= 500 or Trit <= 500 then
- rec.setInjectionRate(2)
- rs.setOutput("top", true)
- term.setTextColor(colors.red)
- else
- rs.setOutput("top", false)
- end
- end
- while true do
- Trit = rec.getTritium()
- Deut = rec.getDeuterium()
- energy = rec.getEnergy()
- energyMax = rec.getMaxEnergy()
- mon.clear()
- term.redirect(mon)
- --term.setBackgroundColor(colors.black)
- paintutils.drawBox(2,2,12,18,colors.gray)
- term.setCursorPos(4,7)
- local posX, posY = term.getCursorPos()
- -- Fuel
- term.setBackgroundColor(colors.black)
- term.setTextColor(colors.white)
- mon.setCursorPos(4,2)
- write(" Fuel ")
- local DeutF= 10-((Deut*100/1000)/10)
- local TritF= 10-((Trit*100/1000)/10)
- paintutils.drawFilledBox(4,4,6,16, colors.purple)
- paintutils.drawFilledBox(4,4,6,4+DeutF, colors.red)
- paintutils.drawFilledBox(8,4,10,16, colors.lightBlue)
- paintutils.drawFilledBox(8,4,10,4+TritF, colors.red)
- term.setBackgroundColor(colors.black)
- -- Fuel end
- -- Energy Capacity
- paintutils.drawBox(14,2,38,6, colors.gray)
- term.setCursorPos(16,2)
- term.setBackgroundColor(colors.black)
- write(" Energy level ")
- local EnergyF = (energy*100/energyMax)/10
- local energyRF = math.floor(energy/2500,0.5)
- local energyMaxRF = energyMax/2500
- paintutils.drawFilledBox(16,4,36,4, colors.red)
- paintutils.drawFilledBox(16,4,16+EnergyF*2,4, colors.lime)
- term.setCursorPos(17,3)
- term.setBackgroundColor(colors.black)
- write(energyRF.."/"..energyMaxRF.." KRF")
- term.setBackgroundColor(colors.black)
- -- Energy Capacity end
- -- Info
- -- Production
- paintutils.drawBox(14,8,38,13, colors.gray)
- term.setCursorPos(16,8)
- term.setBackgroundColor(colors.black)
- write(" Info ")
- term.setCursorPos(16,10)
- write("Production: ")
- local RFpT = (math.floor(rec.getProducing()/25000, 0.5))/10
- if RFpT < 1 then
- RFpT = (math.floor(rec.getProducing()/250, 0.5))/10
- write(RFpT)
- term.setTextColor(colors.orange)
- term.setCursorPos(32,10)
- write(" KRF/T")
- else
- write(RFpT)
- term.setTextColor(colors.yellow)
- term.setCursorPos(32,10)
- write(" MRF/T")
- end
- -- Production end
- -- Injection Rate
- term.setCursorPos(16,11)
- term.setTextColor(colors.white)
- write("InjectionRate: ")
- -- Injection Rate end
- -- Info end
- paintutils.drawBox(14,15,38,18, colors.gray)
- term.setCursorPos(16,15)
- term.setBackgroundColor(colors.black)
- write(" Injection Control ")
- paintutils.drawBox(15,16,19,17, colors.green)
- term.setCursorPos(16,17)
- write("+10")
- paintutils.drawBox(20,16,23,17, colors.lime)
- term.setCursorPos(21,17)
- write("+1")
- paintutils.drawBox(25,16,27,17, colors.cyan)
- term.setCursorPos(26,17)
- write("2")
- paintutils.drawBox(29,16,33,17, colors.orange)
- term.setCursorPos(30,17)
- write("-1")
- paintutils.drawBox(33,16,37,17, colors.red)
- term.setCursorPos(34,17)
- write("-10")
- -- Injection Hard Cap
- if energy >= energyMax*softCap then
- if energy >= energyMax*Cap then
- rec.setInjectionRate(2)
- term.setTextColor(colors.orange)
- end
- else
- term.setTextColor(colors.green)
- rec.setInjectionRate(standard)
- end
- -- Injection Hard Cap end
- term.setBackgroundColor(colors.black)
- alert()
- term.setCursorPos(31,11)
- write(rec.getInjectionRate())
- sleep(0.5)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement