Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local chat = peripheral.find "chat_box"
- local side = "right"
- local onoff = false
- chat.setName "Tesla Thingy"
- function set()
- redstone.setOutput(side, onoff)
- end
- while true do
- _, _, usr, msg = os.pullEvent "chat_message"
- local cmd = string.sub(msg, 2)
- print(usr, msg, cmd)
- if cmd == "tesla" then
- onoff = not onoff
- chat.say("Acknowledged. RS: " .. tostring(onoff))
- set()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement