Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function banner()
- print("Welcome to SwatDoge's chat program")
- print("")
- end
- function cls()
- term.clear()
- term.setCursorPos(1, 1)
- end
- function name()
- account_name = user
- cls()
- write("What would you like your name to be? ")
- account_name = read()
- password()
- end
- function password()
- account_password = admin
- cls()
- write("Welcome "..account_name..", Type a password you'd want to use: ")
- write("")
- account_password = read()
- cls()
- login()
- end
- function first_name()
- if account_name == nil then
- name()
- else
- print(name)
- cls()
- login()
- end
- end
- function login()
- print("Login with your information.")
- write("Username: ")
- account_name_check = read()
- write("Password: ")
- account_password_check = read()
- if (account_name_check == account_name) and (account_password_check == account_password) then
- cls()
- chat()
- else
- cls()
- print("wrong username or password")
- login()
- end
- end
- function chat()
- print("Insert message: ")
- message = read()
- if message ~= nil then
- rednet.send(18, message)
- end
- end
- banner()
- first_name()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement