summaryrefslogtreecommitdiff
path: root/chat.lua
diff options
context:
space:
mode:
Diffstat (limited to 'chat.lua')
-rw-r--r--chat.lua19
1 files changed, 19 insertions, 0 deletions
diff --git a/chat.lua b/chat.lua
new file mode 100644
index 0000000..e21da68
--- /dev/null
+++ b/chat.lua
@@ -0,0 +1,19 @@
+local md5 = require("md5").hash
+
+local p = peripheral.find"manipulator"
+assert(p and p.hasModule"plethora:chat")
+local m = peripheral.wrap"monitor"
+assert(m)
+
+local function p(...)
+ term.redirect(m)
+ print(...)
+ term.redirect(term.native())
+end
+
+while true do
+ local _,user,msg = os.pullEvent"chat_message"
+ local h = md5(msg)
+
+ p("<"..user.."> ["..h.."] "..msg)
+end