Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local chatbox = peripheral.find "chat_box"
- local prefix = os.getComputerLabel():lower()
- chatbox.setName(prefix)
- local spatial
- for _, n in pairs(peripheral.getNames()) do
- if peripheral.getType(n) == "appliedenergistics2:spatial_io_port" then
- spatial = n
- end
- end
- while true do
- local _, _, player, msg = os.pullEvent "chat_message"
- if player == "gollark" or player == "heav_" or player == "ubq323" then
- if msg:lower():match("^" .. prefix:gsub("%-", "%%-")) then
- rs.setOutput(spatial, true)
- sleep(0.2)
- rs.setOutput(spatial, false)
- chatbox.say "Done!"
- end
- if msg == "!!RESTART" then
- chatbox.say "Doing so."
- sleep(math.random(0, 10))
- chatbox.say "Delay over."
- os.reboot()
- end
- if msg == "!!PING" then
- chatbox.say "Hi, I exist."
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement