Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Variablen
- yourpass = "" -- Zwischen die "" bitte das Passwort eintragen
- yourprogram = "" -- Zwischen die "" bitte das Programm eintragen was gestartet werden soll
- floppypass = "" -- Zwischen die "" bitte das Passwort der Floppydisk eintragen (Das Label)
- floppy = true -- true bedeutet er braucht eine Floppydisk für das Passwort
- os.pullEvent = os.pullEventRaw
- -- Prüft nach einer Floppydisk
- floppyside= ""
- if floppy then
- while floppyside == "" do
- for i, side in pairs(peripheral.getNames()) do
- if (disk.isPresent(side)) then
- floppyside = side
- end
- end
- if floppyside == "" then
- sleep(2)
- end
- end
- end
- -- Bildschirm leeren
- term.clear()
- term.setCursorPos(1,1)
- -- Funktionen
- function writeCentered( text, y )
- width, height = term.getSize()
- x = ( width / 2 ) - ( string.len( text ) / 2 )
- term.setCursorPos(x,y)
- term.write( text )
- end
- -- Hauptteil
- while true do
- term.write("| |")
- writeCentered("Computer Security", 1)
- term.setCursorPos(1,2)
- term.write("+-------------------------------------------------+")
- term.setCursorPos(1,3)
- term.write("| |")
- term.setCursorPos(1,4)
- term.write("| Passwort: |")
- for i = 5,18 do
- term.setCursorPos(1,i)
- term.write("| |")
- end
- term.setCursorPos(1,19)
- term.write("+-------------------------------------------------+")
- term.setCursorPos(16,4)
- pass = read("*")
- floppyAuth = false
- if disk.getLabel(floppyside) == floppypass then
- floppyAuth = true
- else
- if not floppy then
- floppyAuth = true
- end
- end
- if pass == yourpass and floppyAuth then
- term.setCursorPos(6,6)
- term.write("Authentifizierung Erfolgreich!")
- term.setCursorPos(6,7)
- term.write("Sie werden nun Weitergeleitet")
- sleep(0.25)
- for i = 1,3 do
- term.write(".")
- sleep(0.5)
- end
- term.clear()
- term.setCursorPos(1,1)
- os.run({}, "/"..yourprogram)
- else
- term.setCursorPos(5,6)
- term.write("Authentifizierung Fehlgeschlagen!")
- sleep(1)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment