Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Hilfs-Funktionen--
- function color(color)
- mon.setTextColor(color)
- end
- function pos(gap, line)
- mon.setCursorPos(gap1,line1)
- end
- function msg(gap, line, color, groundb, text)
- if color == 1 then
- color = 1
- elseif color == 02 then
- color = 2
- elseif color == 03 then
- color = 4
- elseif color == 04 then
- color = 8
- elseif color == 05 then
- color = 16
- elseif color == 06 then
- color = 32
- elseif color == 07 then
- color = 64
- elseif color == 08 then
- color = 128
- elseif color == 09 then
- color = 256
- elseif color == 10 then
- color = 512
- elseif color == 11 then
- color = 1024
- elseif color == 12 then
- color = 2048
- elseif color == 13 then
- color = 4096
- elseif color == 14 then
- color = 8192
- elseif color == 15 then
- color = 16384
- elseif color == 16 then
- color = 32768
- end
- if groundb == 1 then
- groundb = 1
- elseif groundb == 02 then
- groundb = 2
- elseif groundb == 03 then
- groundb = 4
- elseif groundb == 04 then
- groundb = 8
- elseif groundb == 05 then
- groundb = 16
- elseif groundb == 06 then
- groundb = 32
- elseif groundb == 07 then
- groundb = 64
- elseif groundb == 08 then
- groundb = 128
- elseif groundb == 09 then
- groundb = 256
- elseif groundb == 10 then
- groundb = 512
- elseif groundb == 11 then
- groundb = 1024
- elseif groundb == 12 then
- groundb = 2048
- elseif groundb == 13 then
- groundb = 4096
- elseif groundb == 14 then
- groundb = 8192
- elseif groundb == 15 then
- groundb = 16384
- elseif groundb == 16 then
- groundb = 32768
- end
- mon.setBackgroundColor(groundb)
- mon.setCursorPos(gap,line)
- mon.setTextColor(color)
- text = mon.write(text)
- end
- --Hauptfunktionen--
- function green()
- msg(1,1,1,6," ")
- msg(1,2,1,6," ")
- msg(1,3,1,6," ")
- msg(1,4,1,6," ")
- msg(1,5,1,6," ")
- msg(1,6,1,6," ")
- end
- function red()
- msg(1,1,1,15," ")
- msg(1,2,1,15," ")
- msg(1,3,1,15," ")
- msg(1,4,1,15," ")
- msg(1,5,1,15," ")
- msg(1,6,1,15," ")
- end
- mon = peripheral.wrap("top")
- mon.clear()
- red()
- while true do
- local event, side, X, Y = os.pullEvent("monitor_touch")
- if X >= 1 and X <=10 and Y >= 1 and Y <= 5 and side == "top" then
- green()
- rs.setOutput("back",true)
- sleep(5)
- rs.setOutput("back",false)
- red()
- elseif rs.getInput("back") then
- green()
- sleep(5)
- red()
- end
- sleep(0.5)
- end
Add Comment
Please, Sign In to add comment