Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- ###### Nur Bitte diese vier Werte bearbeiten! ######
- --
- --
- --
- -- Hier bitte Passwort eingeben (4 Ziffern lang)
- passwort = "1253"
- --
- -- 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"
- --
- -- Orginal von ReduceTheBlock
- -- Abgeschrieben von Maik Zimmermann
- -- Für euch verändert von TobsA13
- --
- --
- -- ### Ab hier bitte nix mehr machen außer du weißt 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
- os.setComputerLabel("Passwort-Door" )
- function Rahmen()
- term.clear()
- term.setTextColor(colors.white)
- term.setCursorPos(2,1)
- term.setBackgroundColor(colors.green)
- term.write("1")
- term.setBackgroundColor(colors.black)
- term.write (" ")
- term.setBackgroundColor(colors.green)
- term.write("2")
- term.setBackgroundColor(colors.black)
- term.write (" ")
- term.setBackgroundColor(colors.green)
- term.write("3")
- term.setBackgroundColor(colors.black)
- term.setCursorPos(2,3)
- term.setBackgroundColor(colors.green)
- term.write("4")
- term.setBackgroundColor(colors.black)
- term.write (" ")
- term.setBackgroundColor(colors.green)
- term.write("5")
- term.setBackgroundColor(colors.black)
- term.write (" ")
- term.setBackgroundColor(colors.green)
- term.write("6")
- term.setBackgroundColor(colors.black)
- term.setCursorPos(2,5)
- term.setBackgroundColor(colors.green)
- term.write("7")
- term.setBackgroundColor(colors.black)
- term.write (" ")
- term.setBackgroundColor(colors.green)
- term.write("8")
- term.setBackgroundColor(colors.black)
- term.write (" ")
- term.setBackgroundColor(colors.green)
- term.write("9")
- 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 für 4 sec")
- sleep(5)
- end
- end
- if event == "monitor_touch" then
- if x == 2 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 == 4 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 == 6 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 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 == 4 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 == 6 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 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 == 4 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 == 6 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
- end
- end
- count = 0
- end
- function punkt()
- if count == 1 then
- term.setCursorPos(1,1)
- term.write ("*")
- elseif count == 2 then
- term.setCursorPos(7,1)
- term.write ("*")
- elseif count == 3 then
- term.setCursorPos(1,5)
- term.write ("*")
- elseif count == 4 then
- term.setCursorPos(7,5)
- term.write ("*")
- sleep(0.2)
- end
- end
- while true do
- Rahmen()
- Eingabe()
- eingabe = (""..a..""..b..""..c..""..d.."")
- zugang = (passwort-eingabe)
- if passwort == eingabe then
- term.clear()
- term.setCursorPos(4,3)
- term.setBackgroundColor(colors.black)
- term.setTextColor(colors.green)
- term.write ("OK")
- rs.setOutput(redout, true)
- sleep(2.5)
- rs.setOutput(redout, false)
- else
- term.clear()
- term.setCursorPos(1,3)
- term.setBackgroundColor(colors.black)
- term.setTextColor(colors.red)
- term.write("FALSCH!")
- sleep (1)
- term.clear()
- term.setCursorPos(4,3)
- term.write("5")
- sleep(1)
- term.setCursorPos(4,3)
- term.write("4")
- sleep(1)
- term.setCursorPos(4,3)
- term.write("3")
- sleep(1)
- term.setCursorPos(4,3)
- term.write("2")
- sleep(1)
- term.setCursorPos(4,3)
- term.write("1")
- sleep(1)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement