carrots084

Server

Jan 28th, 2018
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.96 KB | None | 0 0
  1. for a, b in pairs(rs.getSides()) do
  2.     if peripheral.getType(b) == "manipulator" then
  3.         chat = peripheral.wrap(b)
  4.         break
  5.     end
  6. end
  7.  
  8. for a, b in pairs(rs.getSides()) do
  9.     if peripheral.getType(b) == "modem" then
  10.         rednet.open(b)
  11.         break
  12.     end
  13. end
  14.  
  15. while true do
  16.     local _, player, message, uuid = os.pullEvent("chat_message")
  17.     if message:find("[?!~`]day") then
  18.         -- TODO send to client
  19.         chat.say("Setting time to day...")
  20.     elseif message:find("[?!`~]night") then
  21.         -- TODO send to client
  22.         chat.say("Setting time to night...")
  23.     elseif message:find("[?!`~]clear") then
  24.         -- TODO send to client
  25.         chat.say("Clearing the weather...")
  26.     elseif message:find("[?!`~]rain") then
  27.         -- TODO send to client
  28.         chat.say("Makin' it rain ;)")
  29.     elseif message:find("[?!`~]storm") then
  30.         -- TODO send to client
  31.         chat.say("Creating a storm...")
  32.     end
  33. end
Advertisement
Add Comment
Please, Sign In to add comment