Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ladomonitor = "top"
- aviso = "back"
- controlador = "bottom"
- ----
- cont = peripheral.wrap(controlador)
- mon = peripheral.wrap(ladomonitor)
- cm, lm = mon.getSize()
- mon.clear()
- ----ww
- tur = {
- "Controle de Turbinas",
- "Bloco",
- "[A]",
- "[B]",
- "[C]",
- "[D]",
- "[E]",
- "[F]",
- "<On> | <Off>",
- "Baixo Nivel de Combustivel",
- }
- --
- mon.setCursorPos(cm/2-string.len(tur[1])/2, 1)
- mon.setTextColor(colors.magenta)
- mon.write(tur[1])
- -- Bloco A
- mon.setCursorPos(1,3)
- mon.setTextColor(colors.blue)
- mon.write(tur[2])
- mon.setCursorPos(string.len(tur[2])+2, 3)
- mon.setTextColor(colors.red)
- mon.write(tur[3])
- mon.setCursorPos(string.len(tur[2])+11, 3)
- mon.setTextColor(colors.orange)
- mon.write(tur[9])
- -- Bloco B
- mon.setCursorPos(1,4)
- mon.setTextColor(colors.blue)
- mon.write(tur[2])
- mon.setCursorPos(string.len(tur[2])+2, 4)
- mon.setTextColor(colors.red)
- mon.write(tur[4])
- mon.setCursorPos(string.len(tur[2])+11, 4)
- mon.setTextColor(colors.orange)
- mon.write(tur[9])
- -- Bloco C
- mon.setCursorPos(1,5)
- mon.setTextColor(colors.blue)
- mon.write(tur[2])
- mon.setCursorPos(string.len(tur[2])+2, 5)
- mon.setTextColor(colors.red)
- mon.write(tur[5])
- mon.setCursorPos(string.len(tur[2])+11, 5)
- mon.setTextColor(colors.orange)
- mon.write(tur[9])
- -- Bloco D
- mon.setCursorPos(1,6)
- mon.setTextColor(colors.blue)
- mon.write(tur[2])
- mon.setCursorPos(string.len(tur[2])+2, 6)
- mon.setTextColor(colors.red)
- mon.write(tur[6])
- mon.setCursorPos(string.len(tur[2])+11, 6)
- mon.setTextColor(colors.orange)
- mon.write(tur[9])
- -- Bloco E
- mon.setCursorPos(1,7)
- mon.setTextColor(colors.blue)
- mon.write(tur[2])
- mon.setCursorPos(string.len(tur[2])+2, 7)
- mon.setTextColor(colors.red)
- mon.write(tur[7])
- mon.setCursorPos(string.len(tur[2])+11, 7)
- mon.setTextColor(colors.orange)
- mon.write(tur[9])
- -- Bloco F
- mon.setCursorPos(1,8)
- mon.setTextColor(colors.blue)
- mon.write(tur[2])
- mon.setCursorPos(string.len(tur[2])+2, 8)
- mon.setTextColor(colors.red)
- mon.write(tur[8])
- mon.setCursorPos(string.len(tur[2])+11, 8)
- mon.setTextColor(colors.orange)
- mon.write(tur[9])
- --
- function touch()
- while true do
- event, side, x, y = os.pullEvent("monitor_touch")
- if x > 15 and x < 20 and y == 3 then
- mon.setCursorPos(string.len(tur[2])+2, 3)
- mon.setTextColor(colors.green)
- mon.write(tur[3])
- cont.setAspect("Bloco A", 5)
- elseif x > 22 and x < 28 and y == 3 then
- mon.setCursorPos(string.len(tur[2])+2, 3)
- mon.setTextColor(colors.red)
- mon.write(tur[3])
- cont.setAspect("Bloco A", 1)
- elseif x > 15 and x < 20 and y == 4 then
- mon.setCursorPos(string.len(tur[2])+2, 4)
- mon.setTextColor(colors.green)
- mon.write(tur[4])
- cont.setAspect("Bloco B", 5)
- elseif x > 22 and x < 28 and y == 4 then
- mon.setCursorPos(string.len(tur[2])+2, 4)
- mon.setTextColor(colors.red)
- mon.write(tur[4])
- cont.setAspect("Bloco B", 1)
- elseif x > 15 and x < 20 and y == 5 then
- mon.setCursorPos(string.len(tur[2])+2, 5)
- mon.setTextColor(colors.green)
- mon.write(tur[5])
- cont.setAspect("Bloco C", 5)
- elseif x > 22 and x < 28 and y == 5 then
- mon.setCursorPos(string.len(tur[2])+2, 5)
- mon.setTextColor(colors.red)
- mon.write(tur[5])
- cont.setAspect("Bloco C", 1)
- elseif x > 15 and x < 20 and y == 6 then
- mon.setCursorPos(string.len(tur[2])+2, 6)
- mon.setTextColor(colors.green)
- mon.write(tur[6])
- cont.setAspect("Bloco D", 5)
- elseif x > 22 and x < 28 and y == 6 then
- mon.setCursorPos(string.len(tur[2])+2, 6)
- mon.setTextColor(colors.red)
- mon.write(tur[6])
- cont.setAspect("Bloco D", 1)
- elseif x > 15 and x < 20 and y == 7 then
- mon.setCursorPos(string.len(tur[2])+2, 7)
- mon.setTextColor(colors.green)
- mon.write(tur[7])
- cont.setAspect("Bloco E", 5)
- elseif x > 22 and x < 28 and y == 7 then
- mon.setCursorPos(string.len(tur[2])+2, 7)
- mon.setTextColor(colors.red)
- mon.write(tur[7])
- cont.setAspect("Bloco E", 1)
- elseif x > 15 and x < 20 and y == 8 then
- mon.setCursorPos(string.len(tur[2])+2, 8)
- mon.setTextColor(colors.green)
- mon.write(tur[8])
- cont.setAspect("Bloco F", 5)
- elseif x > 22 and x < 28 and y == 8 then
- mon.setCursorPos(string.len(tur[2])+2, 8)
- mon.setTextColor(colors.red)
- mon.write(tur[8])
- cont.setAspect("Bloco F", 1)
- end
- end
- end
- function fuel()
- if redstone.getInput(aviso) == true then
- while true do
- mon.setCursorPos(29-string.len(tur[10]), 12)
- mon.setTextColor(colors.red)
- mon.write(tur[10])
- mon.setTextColor(colors.black)
- mon.write(tur[10])
- sleep(0.5)
- end
- else
- mon.setCursorPos(29-string.len(tur[10]), 12)
- mon.setTextColor(colors.black)
- mon.write(tur[10])
- end
- end
- parallel.waitForAny(touch(), fuel())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement