Advertisement
MCFunRide

BaseControl for CC

May 31st, 2015
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.98 KB | None | 0 0
  1. function say(str)
  2. peripheral.find("command").setCommand("say "..str)
  3. peripheral.find("command").runCommand()
  4. end
  5.  
  6. function msg(player,message)
  7. peripheral.find("command").setCommand("msg "..player.." "..message)
  8. peripheral.find("command").runCommand()
  9. end
  10.  
  11. say("BaseControl Loaded! By: datcoder1208")
  12. while true do
  13. local event, side, player, message = os.pullEvent('chat_message')
  14. if player == "datcoder1208" and message == "BaseControl, open the door." then
  15. msg(player,"Opening doors...")
  16. rednet.open("bottom")
  17. rednet.broadcast("open")
  18. rednet.close("bottom")
  19. elseif player == "Gonow32" and message == "BaseControl, open the door." then
  20. msg(player,"Opening doors...")
  21. rednet.open("bottom")
  22. rednet.broadcast("open")
  23. rednet.close("bottom")
  24. elseif player == "datcoder1208" and message == "BaseControl, close the door." then
  25. msg(player,"Opening doors...")
  26. rednet.open("bottom")
  27. rednet.broadcast("close")
  28. rednet.close("bottom")
  29. elseif player == "Gonow32" and message == "BaseControl, close the door." then
  30. msg(player,"Opening doors...")
  31. rednet.open("bottom")
  32. rednet.broadcast("close")
  33. rednet.close("bottom")
  34. elseif player == "datcoder1208" and message == "BaseControl, activate security system." then
  35. msg(player,"SECURITY SYSTEM ARMED!")
  36. rednet.open("bottom")
  37. rednet.broadcast("securitysystemon")
  38. rednet.close("bottom")
  39. elseif player == "Gonow32" and message == "BaseControl, activate security system." then
  40. msg(player,"SECURITY SYSTEM ARMED!")
  41. rednet.open("bottom")
  42. rednet.broadcast("securitysystemon")
  43. rednet.close("bottom")
  44. elseif player == "datcoder1208" and message == "BaseControl, deactivate security system." then
  45. msg(player,"SECURITY SYSTEM DISARMED!")
  46. rednet.open("bottom")
  47. rednet.broadcast("securitysystemoff")
  48. rednet.close("bottom")
  49. elseif player == "Gonow32" and message == "BaseControl, deactivate security system." then
  50. msg(player,"SECURITY SYSTEM DISARMED!")
  51. rednet.open("bottom")
  52. rednet.broadcast("securitysystemoff")
  53. rednet.close("bottom")
  54. end
  55. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement