Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- passwort = 1258 -- kann man sich aussuchen (einfach 4-stellige Zahl aussuchen und austauschen)
- count = 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("123")
- term.setCursorPos(3,3)
- print("456")
- term.setCursorPos(3,4)
- print("789")
- 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 == 4 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 == 5 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 == 4 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 == 5 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 == 4 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 == 5 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
- end
- end
- count = 0
- end
- while true do
- Rahmen()
- Eingabe()
- eingabe = (""..a..""..b..""..c..""..d.."")
- zugang = (passwort-eingabe)
- if zugang == 0 then
- write("OK")
- rs.setOutput("bottom", true)
- sleep(3,5)
- rs.setOutput("bottom", false)
- else write("FALSCH")
- end
- sleep(3)
- term.setBackgroundColor(colors.black)
- end
Add Comment
Please, Sign In to add comment