Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function desktop()
- term.clear()
- term.setCursorPos( 1, 1 )
- end
- local pcname = os.getComputerLabel()
- -- Не выключать!
- os.pullEvent = os.pullEventRaw
- --Цвет текста
- term.setTextColor(32)
- -- Очистка экрана
- term.clear()
- -- Пишет текст вверху
- term.setCursorPos( 1, 1 )
- -- Пишет *Привет*
- print("Hello!")
- --Спит
- sleep(3)
- -- Спрашивает имя хозяина
- print("What is your name?")
- -- Хозяин пишет
- i = read()
- -- Приветствует хозяина по имени
- write("Hello".." "..i.."!")
- --Спит
- sleep(3)
- term.clear()
- term.setCursorPos( 1, 1 )
- -- Говорит кто она
- write("My name is "..pcname.."!")
- sleep(3)
- term.clear()
- term.setCursorPos( 1, 1 )
- -- Просит дать ей имя
- print("Please, give me a new name!")
- tn = read()
- -- Присваивает компьютеру имя подобное своему
- os.setComputerLabel(tn)
- sleep(3)
- term.clear()
- term.setCursorPos( 1, 1 )
- -- Говорит хозяину какое у нее хорошее имя
- write("Thanks, now I have a new wonderful name".." "..tn.."!")
- sleep(3)
- term.clear()
- term.setCursorPos( 1, 1 )
- print("OK,Record important data to a file database")
- sleep(3)
- term.clear()
- term.setTextColor(16384)
- term.setCursorPos( 1, 1 )
- print("Please, create a password")
- password = read()
- f = fs.open("data.db", "w")
- f.write("tn = ")
- f.write('"')
- f.write(tn)
- f.write('"')
- f.writeLine("")
- f.write("username = ")
- f.write('"')
- f.write(i)
- f.write('"')
- f.writeLine("")
- f.write("password = ")
- f.write('"')
- f.write(password)
- f.write('"')
- f.close()
- desktop()
- print("Loading data.db .")
- os.loadAPI("data.db")
- while true do
- if password == password then break
- else break
- end
- end
- pass = fs.open("startup","w")
- pass.write("os.pullEvent = os.pullEventRaw")
- pass.writeLine("")
- pass.write("shell.run")
- pass.write("(")
- pass.write('"')
- pass.write("data.db")
- pass.write('"')
- pass.write(")")
- pass.writeLine("")
- pass.write("os.setComputerLabel")
- pass.write("(")
- pass.write('tn')
- pass.write(")")
- pass.writeLine("")
- pass.writeLine("enterpass = 'Enter your password'")
- pass.writeLine("print(enterpass)")
- pass.writeLine("while true do")
- pass.writeLine("")
- pass.write("Interface = read")
- pass.write("(")
- pass.write('"')
- pass.write("*")
- pass.write('"')
- pass.write(")")
- pass.writeLine("")
- pass.writeLine("if Interface == password then break")
- pass.writeLine("else os.reboot()")
- pass.writeLine("end")
- pass.writeLine("end")
- pass.close()
- print("Completed =)")
- sleep(2)
- print("reboot computer? yes/no ")
- reb = read()
- rebyes = "yes"
- rebno = "no"
- plushka = "plushka"
- if reb == rebyes then os.reboot()
- elseif reb == rebno then shell.run("rom/programs/lua")
- elseif reb == plushka then shell.run("rom/programs/fun/worm")
- else print("Work in progress")
- sleep(5)
- os.reboot()
- end
Add Comment
Please, Sign In to add comment