Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- term.clear()
- term.setCursorPos(1,1)
- textutils.slowPrint("Welcome to SmedChat!")
- term.setCursorPos(1,3)
- textutils.slowPrint("Would you like to host a chat or join one?")
- term.setCursorPos(2,5)
- write(">")
- input = read()
- if input == "host" then
- term.setCursorPos(2,7)
- textutils.slowPrint("Hosting Selected!")
- sleep(2)
- term.clear()
- term.setCursorPos(1,1)
- textutils.slowPrint("Your chat is being hosted at: 27143")
- sleep(1)
- shell.run("chat host 27143")
- elseif input == "join" then
- term.setCursorPos(2,7)
- textutils.slowPrint("Joining Selected!")
- sleep(2)
- term.clear()
- term.setCursorPos(1,1)
- textutils.slowPrint("Enter a chat address:")
- term.setCursorPos(2,3)
- write(">")
- chatid = read()
- if chatid == "27143" then
- term.clear()
- term.setCursorPos(1,1)
- textutils.slowPrint("Address Confirmed! Connecting to chatroom 27143...")
- sleep(2)
- textutils.slowPrint("Connected!")
- sleep(1)
- term.clear()
- term.setCursorPos(1,1)
- shell.run("chat join 27143 Unknown")
- else
- term.clear()
- term.setCursorPos(1,1)
- textutils.slowPrint("Address Invalid!")
- textutils.slowPrint("Returning to menu...")
- shell.run("chatmenu")
- end
- else
- term.setCursorPos(2,7)
- textutils.slowPrint("Invalid Selection")
- sleep(2)
- shell.run("chatmenu")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement