summaryrefslogtreecommitdiff
path: root/chat.lua
blob: e21da686fa366a1f15d5b9143ca738865adce926 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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