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()
- local account_name_check
- local account_password_check
- 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()
- write("send your message: ")
- message = read()
- if message ~= nil then
- rednet.send(21, account_name .. ": " .. message)
- end
- end
- while true do
- id, reply = rednet.receive("swatdoge")
- print(reply)
- end
- message = nil
- chat()
- end
- end
- if pocket then
- rednet.open("back")
- else
- rednet.open("top")
- end
- local account_password
- local account_name
- banner()
- first_name()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement