Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rednet.open("top")
- chat=peripheral.wrap("left")
- chat1=peripheral.wrap("bottom")
- chat2=peripheral.wrap("right")
- chat3=peripheral.wrap("front")
- chat4=peripheral.wrap("back")
- function split(str, pat)
- local t = {}
- local fpat = "(.-)" .. pat
- local last_end = 1
- local s, e, cap = str:find(fpat, 1)
- while s do
- if s ~= 1 or cap ~= "" then
- table.insert(t,cap)
- end
- last_end = e+1
- s, e, cap = str:find(fpat, last_end)
- end
- if last_end <= #str then
- cap = str:sub(last_end)
- table.insert(t, cap)
- end
- return t
- end
- while true do
- id, msg = rednet.receive()
- msg=split(msg,":")
- if msg[1] == "spam" then
- chat.say(msg[2])
- chat1.say(msg[2])
- chat2.say(msg[2])
- chat3.say(msg[2])
- chat4.say(msg[2])
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement