9551

Untitled

Jun 19th, 2021 (edited)
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.08 KB | None | 0 0
  1. -------reactor to update :P------------
  2. local b = require("button")
  3. local r = peripheral.wrap("BigReactors-Reactor_0")
  4. local m = peripheral.wrap("right")
  5. local me = peripheral.wrap("top")
  6. m.clear()
  7. me.clear()
  8. me.setTextScale(0.5)
  9. local function update()
  10.     local click = b.timetouch(1, "right")
  11.     b.sliderVer("right", click, 1, 2, 11, 10, "white", "black")
  12.     b.switchn("right", 1, click, 4, 2, "red", "green", "white", "off", "on")
  13.     local slider = b.sliderVer("db", 1) * 10 - 10
  14.     r.setAllControlRodLevels(slider)
  15.     m.setCursorPos(3, 5)
  16.     if slider > 0 then
  17.         m.write(slider)
  18.     end
  19.     r.setActive(b.switchn("db", 1))
  20.     b.bar("top",3,4,20,2,r.getEnergyStats().energyStored,10000000,"gray","red","white",true,false,"energy",true,true,false)
  21.     me.setCursorPos(4, 8)
  22.     me.clearLine()
  23.     me.write(math.floor(r.getEnergyProducedLastTick() * 10) .. " RF/s")
  24. end
  25. while true do
  26.     if r.getEnergyStored() >= 9999999 then
  27.         b.switchn("setdb", 1, false)
  28.         repeat
  29.             update()
  30.         until r.getEnergyStored() < 10000000
  31.         b.switchn("setdb", 1, true)
  32.     end
  33.     update()
  34. end
Add Comment
Please, Sign In to add comment