From 04c3da59620c9cf3d826f209bcb4b55b255517b5 Mon Sep 17 00:00:00 2001 From: ubq323 Date: Thu, 4 Aug 2022 00:56:29 +0100 Subject: chat monitor ification --- chat.lua | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 chat.lua (limited to 'chat.lua') 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 -- cgit v1.2.3