Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --This Code is currently incomplet. Come back later, I'll go sleep now :D
- local function mvprint(lign, col, str)
- p.setCursorPos(col, lign)
- p.write(str)
- end
- local function termprint(str)
- term.clear()
- term.setCursorPos(1, 1)
- term.write(str)
- end
- local function initialisation()
- term.clear()
- while (peripheral.isPresent("back") == false or peripheral.getType("back") ~= "BigReactors-Reactor") do
- termprint("Please, connect a Reactor to the back")
- sleep(1)
- end
- reactor = peripheral.wrap("back")
- while (peripheral.isPresent("top") == false or peripheral.getType("top") ~= "monitor") do
- termprint("Please, connect a Monitor to the top")
- sleep(1)
- end
- p = peripheral.wrap("top")
- p.setBackgroundColor(colors.black)
- p.clear()
- width, height = p.getSize()
- width = width + 1
- height = height + 1
- c_width = width / 2
- c_height = height / 2
- while (p.isColor() == false) do
- mvprint(c_height, c_width - string.len("Le moniteur ne supporte pas la couleur!") / 2)
- sleep(1)
- end
- end
- local function management()
- p.clear()
- mvprint(2, c_width - string.len("Managing:") / 2, "Managing:")
- p.setBackgroundColor(colors.green)
- mvprint(c_height, 1 + 3, "ON")
- p.setBackgroundColor(colors.red)
- mvprint(c_height, width - string.len(" ") - 3, "OFF")
- end
- initialisation()
- management()
- print("END")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement