Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- glass = peripheral.wrap("back")
- battery = peripheral.wrap("tile_thermalexpansion_cell_resonant_name_0")
- reactor = peripheral.wrap("BigReactors-Reactor_0")
- modem = peripheral.wrap("top")
- lbTime = 0
- function round(what, precision)
- return math.floor(what*math.pow(10,precision)+0.5) / math.pow(10,precision)
- end
- function listener()
- modem.open(1)
- while true do
- la,lb,lc,ld,qty,le = os.pullEvent("modem_message")
- end
- end
- function addBox()
- glass.addBox(1,1,80,10,0xCCCCCC,0.2)
- end
- function batDis()
- batLvl = battery.getEnergyStored()
- batMax = battery.getMaxEnergyStored()
- batRatio = batLvl / batMax
- endX = math.floor(78 * batRatio)
- glass.addText(3,15,"Resonant Cell")
- glass.addBox(3,25,75,5,0x00FF00)
- glass.addText(3,32,round(batLvl/1000000,1) .. "MRF/" .. batMax/1000000 .. "MRF")
- glass.addBox(endX,25,(78-endX),5,0xFF0000)
- end
- function reactorDis()
- isOn = reactor.getActive()
- rfStored = reactor.getEnergyStored()
- rfPerTick = reactor.getEnergyProducedLastTick()
- glass.addText(3,42,"Reactor")
- if isOn == true then
- glass.addText(3,51,"Active",0x00FF00)
- end
- if isOn == false then
- glass.addText(3,51,"Inactive",0xFF0000)
- end
- glass.addText(3,60,"Internal Buffer")
- glass.addBox(3,70,75,5,0x00FF00)
- endX = math.floor(78 * (rfStored / 10000000))
- glass.addBox(endX,70,(78-endX),5,0xFF0000)
- glass.addText(3,77,round(rfStored/1000000, 1) .. "MRF/10MRF")
- glass.addText(3,86,math.floor(rfPerTick) .. "RF/t")
- end
- function timeDis()
- time = textutils.formatTime(os.time(), false)
- glass.addText(5,2,"Time: " .. time, 0xEEEEEE)
- end
- function cobbleDis()
- glass.addText(3,92,"Cobble Barrel",0xCCCCCC)
- glass.addText(3,96,"qty: " .. qty .. "/4096")
- if uccobble == true then
- if lbTime<10 then
- glass.addText(3,180,"UC: " .. qty*6561)
- lbTime = lbTime + 1
- else
- uccobble = false
- end
- end
- end
- function start()
- glass.clear()
- while true do
- glass.clear()
- addBox()
- timeDis()
- batDis()
- reactorDis()
- cobbleDis()
- glass.sync()
- sleep(0.1)
- end
- end
- function commands()
- while true do
- event,side,player,id,command=os.pullEvent("glasses_chat_command")
- if command == "hello" then
- redstone.setOutput("top", true)
- end
- if command == "bye" then
- redstone.setOutput("top", false)
- end
- if command == "reset" then
- print("Restarting...")
- shell.run("restart")
- print("Restarted.")
- end
- if command == "reactor enable" then
- reactor.setActive(true)
- end
- if command == "reactor disable" then
- reactor.setActive(false)
- end
- if command == "spooky" then
- -- glass.addTriangle((3,150),(33,150),(18,120),0x00FF00)
- eye = glass.addIcon(270,140,"minecraft:ender_eye")
- end
- if command == "uccobble" then
- uccobble = true
- end
- end
- end
- parallel.waitForAll(start, commands, listener)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement