Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.loadAPI("ocs/apis/sensor")
- local s = sensor.wrap("top")
- rednet.open("right")
- mon = peripheral.wrap("left")
- mon.setBackgroundColor(32768)
- mon.setTextScale(1.5)
- mon.clear()
- 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
- function sprachauswahl()
- mon.setBackgroundColor(32768)
- mon.clear()
- msg(12,3,4,16,"Sprache / Language")
- msg(8,06,1,6," ") msg(23,06,1,6," ")
- msg(8,07,1,6," ") msg(23,07,1,6," ")
- msg(8,08,1,6," Deutsch ") msg(23,08,1,6," English ")
- msg(8,09,1,6," ") msg(23,09,1,6," ")
- msg(8,10,1,6," ") msg(23,10,1,6," ")
- local event, side, X, Y = os.pullEvent("monitor_touch")
- if X >= 8 and X <=18 and Y >= 6 and Y <= 10 and side == "left" then
- shell.run("deutsch")
- elseif X >= 23 and X <=33 and Y >= 6 and Y <= 10 and side == "left" then
- shell.run("english")
- end
- end
- while true do
- msg(01,4,10,16,"Player detection,")
- msg(01,5,10,16,"just klick on the Button.")
- msg(01,7,10,16,"Spieler Erkennung,")
- msg(01,8,10,16,"klick einfach auf den Knopf.")
- msg(17,10,16,01," ")
- msg(17,11,16,01," ")
- msg(17,12,16,01," ")
- msg(13,11,1,16,"-->")
- msg(26,11,1,16,"<--")
- local event, side, X, Y = os.pullEvent("monitor_touch")
- if X >= 17 and X <=24 and Y >= 10 and Y <= 12 and side == "left" then
- for name,info in pairs(s.getTargets()) do
- local file = fs.open("Player", "w")
- file.write(name)
- file.close()
- sprachauswahl()
- end
- end
- sleep(1)
- end
Add Comment
Please, Sign In to add comment