Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local chatBox = peripheral.find("chatBox")
- local enabled = false
- while true do
- local signal = redstone.getInput("right")
- if signal and not enabled then
- enabled = true
- print("Enabled")
- elseif not signal and enabled then
- enabled = false
- print("Disabled")
- end
- if enabled then
- local event, player, message = os.pullEvent("chat")
- if string.find(message, "<YOUR USERNAME HERE>") then
- chatBox.sendMessage("YOUR MESSAGE HERE")
- end
- end
- os.sleep(0.1) -- Wait for a short time before checking again
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement