Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- r = peripheral.find("BigReactors-Reactor")
- mon = peripheral.find("monitor")
- enMax = 10000000
- enMaxIn = 90000
- enMaxTo = 5000000
- function updateMon()
- mon.setCursorPos(1,1)
- mon.setTextColor(colors.white)
- end
- function setReactorOff()
- r.setActive(false)
- end
- function BootUp()
- mon.clear()
- mon.setBackgroundColor(colors.cyan)
- local v = 1
- for i = 1,19 do
- mon.setCursorPos(1,v)
- mon.write("[ ]")
- v = v+1
- end
- sleep(0.2)
- mon.setCursorPos(33,5)
- mon.setBackgroundColor(colors.red)
- mon.write(" ")
- mon.setCursorPos(33,5+1)
- mon.write(" ")
- sleep(0.5)
- mon.setCursorPos(33+4,5)
- mon.setBackgroundColor(colors.lime)
- mon.write(" ")
- mon.setCursorPos(33+4,5+1)
- mon.write(" ")
- sleep(0.5)
- mon.setCursorPos(33,5+3)
- mon.setBackgroundColor(colors.blue)
- mon.write(" ")
- mon.setCursorPos(33,5+1+3)
- mon.write(" ")
- sleep(0.5)
- mon.setCursorPos(33+4,5+3)
- mon.setBackgroundColor(colors.yellow)
- mon.write(" ")
- mon.setCursorPos(33+4,5+4)
- mon.write(" ")
- sleep(3)
- end
- function buttonCreateSparmodus()
- --Sparmodus
- mon.setCursorPos(3,2)
- mon.setBackgroundColor(colors.red)
- mon.setTextColor(colors.black)
- mon.write(" Sparmodus ")
- mon.setBackgroundColor(colors.cyan)
- end
- function buttonCreatePowerPlus()
- --PowerPlus
- mon.setCursorPos(3,4)
- mon.setBackgroundColor(colors.red)
- mon.setTextColor(colors.black)
- mon.write(" PowerPlus ")
- mon.setBackgroundColor(colors.cyan)
- end
- function buttonCreateVolldampf()
- --Volldampf
- mon.setCursorPos(3,6)
- mon.setBackgroundColor(colors.red)
- mon.setTextColor(colors.black)
- mon.write(" Volldampf ")
- mon.setBackgroundColor(colors.cyan)
- end
- --function buttonCreateUpdate()
- --Update
- --mon.setCursorPos(3,18)
- --mon.setBackgroundColor(colors.lime)
- --mon.setTextColor(colors.black)
- --mon.write(" Update ")
- --mon.setBackgroundColor(colors.cyan)
- --end
- function buttonCreateReset()
- --Control level to 0
- mon.setCursorPos(3,8)
- mon.setBackgroundColor(colors.red)
- mon.setTextColor(colors.black)
- mon.write(" Reset ")
- mon.setBackgroundColor(colors.cyan)
- end
- function buttonCreateOff()
- --An/Aus
- mon.setCursorPos(64,2)
- mon.setBackgroundColor(colors.red)
- mon.setTextColor(colors.black)
- mon.write(" ")
- mon.setCursorPos(64,2+1)
- mon.write(" A ")
- mon.setCursorPos(64,2+2)
- mon.write(" U ")
- mon.setCursorPos(64,2+3)
- mon.write(" S ")
- mon.setCursorPos(64,2+4)
- mon.write(" ")
- mon.setBackgroundColor(colors.cyan)
- end
- function buttonCreateOn()
- mon.setCursorPos(58,2)
- mon.setBackgroundColor(colors.red)
- mon.setTextColor(colors.black)
- mon.write(" ")
- mon.setCursorPos(58,2+1)
- mon.write(" A ")
- mon.setCursorPos(58,2+2)
- mon.write(" N ")
- mon.setCursorPos(58,2+3)
- mon.write(" ")
- mon.setCursorPos(58,2+4)
- mon.write(" ")
- mon.setBackgroundColor(colors.cyan)
- end
- function buttonCreateLISTEN()
- mon.setCursorPos(14,18)
- mon.setBackgroundColor(colors.red)
- mon.setTextColor(colors.black)
- mon.write("LISTEN")
- mon.setBackgroundColor(colors.cyan)
- end
- function buttonLoadAll()
- event, side, x, y = os.pullEvent("monitor_touch")
- --if x > 3 and x < 8 and y == 18 then
- --mon.setCursorPos(3,18)
- --mon.setBackgroundColor(colors.orange)
- --mon.setTextColor(colors.black)
- --mon.write(" Update ")
- --sleep(0.5)
- --mon.setBackgroundColor(colors.cyan)
- --shell.run("Update")
- --end
- if x > 3 and x < 14 and y == 2 then
- mon.setCursorPos(3,2)
- mon.setBackgroundColor(colors.lime)
- mon.setTextColor(colors.black)
- mon.write(" Sparmodus ")
- r.setAllControlRodLevels(99)
- mon.setBackgroundColor(colors.cyan)
- elseif x > 3 and x < 14 and y == 4 or y == 6 then
- buttonCreateSparmodus()
- end
- if x > 3 and x < 14 and y == 4 then
- mon.setCursorPos(3,4)
- mon.setBackgroundColor(colors.lime)
- mon.setTextColor(colors.black)
- mon.write(" PowerPlus ")
- r.setAllControlRodLevels(70)
- mon.setBackgroundColor(colors.cyan)
- elseif x > 3 and x < 14 and y == 2 or y == 6 then
- buttonCreatePowerPlus()
- end
- if x > 3 and x < 14 and y == 6 then
- mon.setCursorPos(3,6)
- mon.setBackgroundColor(colors.lime)
- mon.setTextColor(colors.black)
- mon.write(" Volldampf ")
- r.setAllControlRodLevels(0)
- mon.setBackgroundColor(colors.cyan)
- elseif x > 3 and x < 14 and y == 2 or y == 4 then
- buttonCreateVolldampf()
- end
- if x > 3 and x < 14 and y == 8 then
- mon.setCursorPos(3,8)
- mon.setBackgroundColor(colors.lime)
- mon.setTextColor(colors.black)
- mon.write(" Reset ")
- r.setAllControlRodLevels(0)
- mon.setBackgroundColor(colors.cyan)
- buttonCreateSparmodus()
- buttonCreatePowerPlus()
- buttonCreateVolldampf()
- sleep(0.2)
- buttonCreateReset()
- end
- if x > 64 and x < 69 and y >= 2 and y <= 6 then
- mon.setCursorPos(64,2)
- mon.setBackgroundColor(colors.lime)
- mon.setTextColor(colors.black)
- mon.write(" ")
- mon.setCursorPos(64,2+1)
- mon.write(" A ")
- mon.setCursorPos(64,2+2)
- mon.write(" U ")
- mon.setCursorPos(64,2+3)
- mon.write(" S ")
- mon.setCursorPos(64,2+4)
- mon.write(" ")
- r.setActive(false)
- buttonCreateOn()
- end
- if x > 58 and x < 64 and y >= 2 and y <= 6 then
- mon.setCursorPos(58,2)
- mon.setBackgroundColor(colors.lime)
- mon.setTextColor(colors.black)
- mon.write(" ")
- mon.setCursorPos(58,2+1)
- mon.write(" A ")
- mon.setCursorPos(58,2+2)
- mon.write(" N ")
- mon.setCursorPos(58,2+3)
- mon.write(" ")
- mon.setCursorPos(58,2+4)
- mon.write(" ")
- r.setActive(true)
- buttonCreateOff()
- end
- if x > 14 and x < 20 and y == 18 then
- mon.setCursorPos(14,18)
- mon.setBackgroundColor(colors.orange)
- mon.setTextColor(colors.red)
- mon.write("LISTEN")
- shell.openTab(".listen")
- mon.setCursorPos(14,19)
- mon.setBackgroundColor(colors.cyan)
- mon.write(" BETA ")
- mon.setBackgroundColor(colors.cyan)
- end
- end
- function getPercentEnergy()
- enPer = math.floor(enNow/enMax*100)
- end
- function pushEnergy()
- mon.setCursorPos(42,2)
- mon.setBackgroundColor(colors.cyan)
- mon.setTextColor(colors.black)
- mon.write("Energie: ")
- mon.setCursorPos(42,2+1)
- enNow = r.getEnergyStored()
- mon.write(enNow)
- mon.setCursorPos(42,2+2)
- mon.write(enPer)
- end
- updateMon()
- BootUp()
- buttonCreateSparmodus()
- buttonCreatePowerPlus()
- buttonCreateVolldampf()
- buttonCreateReset()
- buttonCreateLISTEN()
- buttonCreateOn()
- while true do
- buttonLoadAll()
- end
- while true do
- pushEnergy()
- getPercentEnergy()
- sleep(0.1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement