Advertisement
Guest User

Untitled

a guest
Jul 26th, 2014
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. function clear()
  2. term.clear()
  3. term.setCursorPos(1,1)
  4. end
  5.  
  6. rednet.open("back")
  7. username = "Chum"
  8. local chatBuddy = nil
  9.  
  10. function help()
  11. print("Welcome to askenef's chat shizzle 1.0")
  12. print("Press T to Type")
  13. end
  14.  
  15. clear()
  16. help()
  17.  
  18. while true do
  19. event, id, msg = os.pullEvent()
  20.  
  21. if event == "rednet_message" and id == chatBuddy then
  22. print(msg)
  23.  
  24. elseif event == "char" then
  25.  
  26. if id == "t" then
  27. write(username.." > ")
  28. msgsent = read()
  29. if chatBuddy ~= nil then
  30. rednet.send(chatBuddy,username.." > "..msgsent)
  31. else
  32. print("Quit talking to yourself, dumbass!")
  33. --always punish users for doing stuff wrong
  34. end
  35.  
  36. elseif id == "h" then
  37. write("New username: ")
  38. username = read()
  39.  
  40. elseif id == "c" then
  41. write("Chum ID: ") --put your chum's computer ID here
  42. chatBuddy = tonumber(read())
  43. clear()
  44. print("Conncted. You may chat if your chum")
  45. print("is connected to you right now")
  46.  
  47. elseif id == "a" then
  48. chatBuddy = nil
  49. clear()
  50. help()
  51.  
  52. end
  53.  
  54. end
  55.  
  56. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement