Advertisement
Guest User

chatman.lua

a guest
Feb 23rd, 2020
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.47 KB | None | 0 0
  1. --[[irrelevant code
  2.  
  3. local function clear()
  4.   term.clear()
  5.   term.setCursorPos(1,1)
  6. end
  7.  
  8. clear()
  9. --]]
  10.  
  11. local chat = peripheral.wrap("right")
  12.  
  13. while true do
  14.  
  15. --message catching
  16.   local _, player, message, uuid = os.pullEvent("chat_message")
  17.  
  18. --message parsing
  19.   local tempmsg = string.sub(message,2)
  20.   tempvar = textutils.unserialize(tempmsg)
  21.  
  22. --debug
  23.   print(message)
  24.   print(tempmsg)
  25.   print(tempmsg)
  26.  
  27. --atempted function call
  28.   tempvar()
  29.  
  30. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement