Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Hier bitte Passwort eingeben (4 Ziffern lang)
- passwort = "1253"
- --
- -- Redstone eingang(bottom,top,back,front,left,right)
- input = "left"
- --
- -- Redstone ausgang(bottom,top,back,front,left,right)
- redout = "bottom"
- --
- -- Monitor seite(bottom,top,back,front,left,right)
- moniside = "back"
- --
- -- Super Admin pass: wird gebraucht um das Programm zu beenden!
- adminpass = "5555"
- --
- -- Tastenfarbe:
- tastencol = 0x2000
- -- Farbcodes:
- -- white 0x1
- -- orange 0x2
- -- magenta 0x4
- -- lightBlue 0x8
- -- yellow 0x10
- -- lime 0x20
- -- pink 0x40
- -- gray 0x80
- -- lightGray 0x100
- -- cyan 0x200
- -- purple 0x400
- -- blue 0x800
- -- brown 0x1000
- -- green 0x2000
- -- red 0x4000
- -- black 0x8000
- -- ### Ab hier bitte nix mehr machen auå9Fer du weiå9Ft was du machst! ###
- count = 0
- a = 0
- b = 0
- c = 0
- d = 0
- eingabe = 0
- zugang = 0
- term = peripheral.wrap(moniside)
- local pullEvent = os.pullEvent
- os.pullEvent = os.pullEventRaw
- term.setBackgroundColor(colors.black)
- if os.getComputerLabel() == nil then
- os.setComputerLabel("Passwort-Door" )
- end
- function Rahmen()
- term.clear()
- term.setTextColor(colors.white)
- term.setCursorPos(2,1)
- term.setBackgroundColor(tastencol)
- term.write(" 1 ")
- term.setBackgroundColor(colors.black)
- term.write (" ")
- term.setBackgroundColor(tastencol)
- term.write(" 2 ")
- term.setBackgroundColor(colors.black)
- term.write (" ")
- term.setBackgroundColor(tastencol)
- term.write(" 3 ")
- term.setBackgroundColor(colors.black)
- term.setCursorPos(2,3)
- term.setBackgroundColor(tastencol)
- term.write(" 4 ")
- term.setBackgroundColor(colors.black)
- term.write (" ")
- term.setBackgroundColor(tastencol)
- term.write(" 5 ")
- term.setBackgroundColor(colors.black)
- term.write (" ")
- term.setBackgroundColor(tastencol)
- term.write(" 6 ")
- term.setBackgroundColor(colors.black)
- term.write (" ")
- term.setBackgroundColor(tastencol)
- term.write(" C ")
- term.setBackgroundColor(colors.black)
- term.setCursorPos(2,5)
- term.setBackgroundColor(tastencol)
- term.write(" 7 ")
- term.setBackgroundColor(colors.black)
- term.write (" ")
- term.setBackgroundColor(tastencol)
- term.write(" 8 ")
- term.setBackgroundColor(colors.black)
- term.write (" ")
- term.setBackgroundColor(tastencol)
- term.write(" 9 ")
- term.setBackgroundColor(colors.black)
- term.setCursorPos(15,2)
- term.setBackgroundColor(tastencol)
- term.write(" ")
- term.setCursorPos(15,4)
- term.write(" ")
- term.setBackgroundColor(colors.black)
- end
- function Eingabe()
- while count < 4 do
- event,side,x,y = os.pullEvent()
- if event == "terminate" then
- write("Admin Passwort:")
- admin = read("*")
- if admin == adminpass then
- os.pullEvent = pullEvent
- write("Richtig! Mache jetzt nochmal STRG + T fuer 4 sec. Du hast 6 sec Zeit.")
- sleep(6)
- end
- end
- if event == "monitor_touch" then
- if (x >= 2 and x<= 4) and y == 1 then
- count = count + 1
- if count == 1 then
- a = 1
- term.setBackgroundColor(colors.black)
- punkt()
- elseif count == 2 then
- b = 1
- punkt()
- elseif count == 3 then
- c = 1
- punkt()
- elseif count == 4 then
- d = 1
- punkt()
- end
- end
- if (x >= 6 and x<= 8) and y == 1 then
- count = count + 1
- if count == 1 then
- a = 2
- term.setBackgroundColor(colors.black)
- punkt()
- elseif count == 2 then
- b = 2
- punkt()
- elseif count == 3 then
- c = 2
- punkt()
- elseif count == 4 then
- d = 2
- punkt()
- end
- end
- if (x >= 10 and x<= 12) and y == 1 then
- count = count + 1
- if count == 1 then
- a = 3
- term.setBackgroundColor(colors.black)
- punkt()
- elseif count == 2 then
- b = 3
- punkt()
- elseif count == 3 then
- c = 3
- punkt()
- elseif count == 4 then
- d = 3
- punkt()
- end
- end
- if (x >= 2 and x<= 4) and y == 3 then
- count = count + 1
- if count == 1 then
- a = 4
- term.setBackgroundColor(colors.black)
- punkt()
- elseif count == 2 then
- b = 4
- punkt()
- elseif count == 3 then
- c = 4
- punkt()
- elseif count == 4 then
- d = 4
- punkt()
- end
- end
- if (x >= 6 and x<= 8) and y == 3 then
- count = count + 1
- if count == 1 then
- a = 5
- term.setBackgroundColor(colors.black)
- punkt()
- elseif count == 2 then
- b = 5
- punkt()
- elseif count == 3 then
- c = 5
- punkt()
- elseif count == 4 then
- d = 5
- punkt()
- end
- end
- if (x >= 10 and x<= 12) and y == 3 then
- count = count + 1
- if count == 1 then
- a = 6
- term.setBackgroundColor(colors.black)
- punkt()
- elseif count == 2 then
- b = 6
- punkt()
- elseif count == 3 then
- c = 6
- punkt()
- elseif count == 4 then
- d = 6
- punkt()
- end
- end
- if (x >= 2 and x<= 4) and y == 5 then
- count = count + 1
- if count == 1 then
- a = 7
- term.setBackgroundColor(colors.black)
- punkt()
- elseif count == 2 then
- b = 7
- punkt()
- elseif count == 3 then
- c = 7
- punkt()
- elseif count == 4 then
- d = 7
- punkt()
- end
- end
- if (x >= 6 and x<= 8) and y == 5 then
- count = count + 1
- if count == 1 then
- a = 8
- term.setBackgroundColor(colors.black)
- punkt()
- elseif count == 2 then
- b = 8
- punkt()
- elseif count == 3 then
- c = 8
- punkt()
- elseif count == 4 then
- d = 8
- punkt()
- end
- end
- if (x >= 10 and x<= 12) and y == 5 then
- count = count + 1
- if count == 1 then
- a = 9
- term.setBackgroundColor(colors.black)
- punkt()
- elseif count == 2 then
- b = 9
- punkt()
- elseif count == 3 then
- c = 9
- punkt()
- elseif count == 4 then
- d = 9
- punkt()
- end
- end
- if (x >= 15 and x<= 17) and (y >= 2 and y<= 5) then
- term.setCursorPos(15,5)
- term.write(" ")
- count = 0
- end
- end
- end
- count = 0
- end
- function punkt()
- if count == 1 then
- term.setCursorPos(15,5)
- term.write ("*")
- elseif count == 2 then
- term.setCursorPos(16,5)
- term.write ("*")
- elseif count == 3 then
- term.setCursorPos(17,5)
- term.write ("*")
- elseif count == 4 then
- term.setCursorPos(18,5)
- term.write ("*")
- sleep(0.1)
- end
- end
- function rand()
- term.setBackgroundColor(farbe)
- term.setCursorPos(1,1)
- term.write(" ")
- term.setCursorPos(1,2)
- term.write(" ")
- term.setCursorPos(18,2)
- term.write(" ")
- term.setBackgroundColor(colors.black)
- term.write(" ")
- term.setBackgroundColor(farbe)
- term.setCursorPos(1,3)
- term.write(" ")
- term.setCursorPos(18,3)
- term.write(" ")
- term.setBackgroundColor(colors.black)
- term.write(" ")
- term.setBackgroundColor(farbe)
- term.setCursorPos(1,4)
- term.write(" ")
- term.setCursorPos(18,4)
- term.write(" ")
- term.setBackgroundColor(colors.black)
- term.write(" ")
- term.setBackgroundColor(farbe)
- term.setCursorPos(1,5)
- term.write(" ")
- term.setBackgroundColor(colors.black)
- end
- while true do
- Rahmen()
- Eingabe()
- eingabe = (""..a..""..b..""..c..""..d.."")
- zugang = (passwort-eingabe)
- if passwort == eingabe then
- term.clear()
- term.setBackgroundColor(colors.black)
- term.setTextColor(tastencol)
- farbe = 8192
- rand()
- term.setCursorPos(9,3)
- term.write ("OK")
- rs.setOutput(redout, true)
- while not redstone.getInput(input) do
- os.queueEvent("randomEvent")
- os.pullEvent()
- end
- rs.setOutput(redout, false)
- else
- term.clear()
- term.setBackgroundColor(colors.black)
- term.setTextColor(colors.red)
- farbe = 16384
- rand()
- term.setCursorPos(7,3)
- term.write("FALSCH")
- sleep (1)
- term.setCursorPos(6,3)
- term.write(" ")
- term.setCursorPos(9,3)
- term.write("5")
- sleep(1)
- term.setCursorPos(9,3)
- term.write("4")
- sleep(1)
- term.setCursorPos(9,3)
- term.write("3")
- sleep(1)
- term.setCursorPos(9,3)
- term.write("2")
- sleep(1)
- term.setCursorPos(9,3)
- term.write("1")
- sleep(1)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement