Advertisement
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("front")
- mon = peripheral.wrap("back")
- mon.setBackgroundColor(32768)
- mon.setTextScale(1.5)
- mon.clear()
- side = "back"
- function calc_color(color)
- return math.pow(2, color - 1)
- end
- function msg(gap, line, color, groundb, text)
- mon.setBackgroundColor(calc_color(groundb))
- mon.setCursorPos(gap,line)
- mon.setTextColor(calc_color(color))
- text = mon.write(text)
- end
- function sprachauswahl()
- mon.setBackgroundColor(32768)
- mon.clear()
- msg(12,3,4,16,"Sprache / Language")
- msg(8,07,1,6," ") msg(23,07,1,6," ")
- msg(8,08,1,6," ") msg(23,08,1,6," ")
- msg(8,09,1,6," Deutsch ") msg(23,09,1,6," English ")
- msg(8,10,1,6," ") msg(23,10,1,6," ")
- msg(8,11,1,6," ") msg(23,11,1,6," ")
- local event, side, X, Y = os.pullEvent("monitor_touch")
- if X >= 01 and X <=40 and Y >= 1 and Y <= 6 and side == side then
- sprachauswahl()
- elseif X >= 01 and X <=07 and Y >= 7 and Y <= 11 and side == side then
- sprachauswahl()
- elseif X >= 19 and X <=22 and Y >= 7 and Y <= 11 and side == side then
- sprachauswahl()
- elseif X >= 34 and X <=40 and Y >= 7 and Y <= 11 and side == side then
- sprachauswahl()
- elseif X >= 01 and X <=40 and Y >= 12 and Y <= 17 and side == side then
- sprachauswahl()
- elseif X >= 8 and X <=18 and Y >= 7 and Y <= 11 and side == side then
- shell.run("deutsch")
- elseif X >= 23 and X <=33 and Y >= 7 and Y <= 11 and side == side then
- shell.run("english")
- end
- end
- function start()
- mon.setBackgroundColor(32768)
- mon.clear()
- msg(12,4,10,16,"Player detection,")
- msg(8,5,10,16,"just klick on the Button.")
- msg(12,7,10,16,"Spieler Erkennung,")
- msg(8,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,"<--")
- msg(2,14,5,15," Nicht vergessen am Ende Auszuloggen!")
- msg(2,15,5,15," Don't forget to log out at the end! ")
- local event, side, X, Y = os.pullEvent("monitor_touch")
- if X >= 01 and X <=40 and Y >= 01 and Y <= 09 and side == side then
- start()
- elseif X >= 01 and X <=16 and Y >= 10 and Y <= 12 and side == side then
- start()
- elseif X >= 25 and X <=40 and Y >= 10 and Y <= 12 and side == side then
- start()
- elseif X >= 01 and X <=40 and Y >= 13 and Y <= 17 and side == side then
- start()
- elseif X >= 17 and X <=24 and Y >= 10 and Y <= 12 and side == side then
- for name,info in pairs(s.getTargets()) do
- local file = fs.open("Player", "w")
- file.write(name)
- file.close()
- sprachauswahl()
- end
- end
- end
- sleep(5)
- start()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement