Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- passwort = 1234
- count = 0
- bla = 0
- new = bla+0
- setPW = bla+0
- a = 0
- b = 0
- c = 0
- d = 0
- eingabe = 0
- zugang = 0
- function Rahmen()
- shell.run("clear")
- term.setBackgroundColor(colors.green)
- term.setCursorPos(3,2)
- print("1 2 3")
- term.setCursorPos(3,3)
- print("4 5 6")
- term.setCursorPos(3,4)
- print("7 8 9")
- if setNew == 0 then
- term.setBackgroundColor(colors.red)
- term.setCursorPos(7,5)
- print("X")
- end
- end
- term.setBackgroundColor(colors.black)
- function Eingabe()
- while count < 4 do
- event,side,x,y = os.pullEvent()
- if event == "monitor_touch" then
- if x == 3 and y == 2 then
- count = count + 1
- if count == 1 then
- a = 1
- term.setBackgroundColor(colors.black)
- write("*")
- elseif count == 2 then
- b = 1
- write("*")
- elseif count == 3 then
- c = 1
- write("*")
- elseif count == 4 then
- d = 1
- write("*")
- end
- end
- if x == 5 and y == 2 then
- count = count + 1
- if count == 1 then
- a = 2
- term.setBackgroundColor(colors.black)
- write("*")
- elseif count == 2 then
- b = 2
- write("*")
- elseif count == 3 then
- c = 2
- write("*")
- elseif count == 4 then
- d = 2
- write("*")
- end
- end
- if x == 7 and y == 2 then
- count = count + 1
- if count == 1 then
- a = 3
- term.setBackgroundColor(colors.black)
- write("*")
- elseif count == 2 then
- b = 3
- write("*")
- elseif count == 3 then
- c = 3
- write("*")
- elseif count == 4 then
- d = 3
- write("*")
- end
- end
- if x == 3 and y == 3 then
- count = count + 1
- if count == 1 then
- a = 4
- term.setBackgroundColor(colors.black)
- write("*")
- elseif count == 2 then
- b = 4
- write("*")
- elseif count == 3 then
- c = 4
- write("*")
- elseif count == 4 then
- d = 4
- write("*")
- end
- end
- if x == 5 and y == 3 then
- count = count + 1
- if count == 1 then
- a = 5
- term.setBackgroundColor(colors.black)
- write("*")
- elseif count == 2 then
- b = 5
- write("*")
- elseif count == 3 then
- c = 5
- write("*")
- elseif count == 4 then
- d = 5
- write("*")
- end
- end
- if x == 7 and y == 3 then
- count = count + 1
- if count == 1 then
- a = 6
- term.setBackgroundColor(colors.black)
- write("*")
- elseif count == 2 then
- b = 6
- write("*")
- elseif count == 3 then
- c = 6
- write("*")
- elseif count == 4 then
- d = 6
- write("*")
- end
- end
- if x == 3 and y == 4 then
- count = count + 1
- if count == 1 then
- a = 7
- term.setBackgroundColor(colors.black)
- write("*")
- elseif count == 2 then
- b = 7
- write("*")
- elseif count == 3 then
- c = 7
- write("*")
- elseif count == 4 then
- d = 7
- write("*")
- end
- end
- if x == 5 and y == 4 then
- count = count + 1
- if count == 1 then
- a = 8
- term.setBackgroundColor(colors.black)
- write("*")
- elseif count == 2 then
- b = 8
- write("*")
- elseif count == 3 then
- c = 8
- write("*")
- elseif count == 4 then
- d = 8
- write("*")
- end
- end
- if x == 7 and y == 4 then
- count = count + 1
- if count == 1 then
- a = 9
- term.setBackgroundColor(colors.black)
- write("*")
- elseif count == 2 then
- b = 9
- write("*")
- elseif count == 3 then
- c = 9
- write("*")
- elseif count == 4 then
- d = 9
- write("*")
- end
- end
- if x == 7 and y == 5 then
- new = 1
- end
- end
- end
- count = 0
- end
- while true do
- Rahmen()
- Eingabe()
- term.clear()
- term.setCursorPos(2,2)
- eingabe = (""..a..""..b..""..c..""..d.."")
- if setNew == 1 then
- zugang = passwort
- else
- zugang = (passwort-eingabe)
- if zugang == 0 then
- if new == 1 then
- setNew = 1
- new = 0
- write("Write")
- term.setCursorPos(2,3)
- write("down")
- term.setCursorPos(2,4)
- write("new PW")
- term.setCursorPos(2,5)
- write("now!")
- sleep(3.5)
- else
- term.setTextColour(colors.green)
- write("Access")
- term.setCursorPos(2,3)
- write("granted")
- rs.setOutput("bottom", true)
- sleep(3,5)
- rs.setOutput("bottom", false)
- end
- else
- term.setTextColour(colors.red)
- write("Access")
- term.setCursorPos(2,3)
- write("denied")
- term.setTextColour(colors.white)
- end
- end
- sleep(3)
- term.setBackgroundColor(colors.black)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement