Advertisement
MCFunRide

Siri For CC v2

Jun 29th, 2015
277
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.86 KB | None | 0 0
  1. -- Siri v1
  2. -- Needs Disk Drive, MoarPeripherals Chat Box and Command Block
  3.  
  4.  
  5.  
  6.  
  7. local wl = {
  8. ["Gonow64"] = true,
  9. ["Gonow32"] = true,
  10. }
  11.  
  12.  
  13.  
  14. m = peripheral.wrap("right")
  15.  
  16. function run(str)
  17. peripheral.find("command").setCommand(str)
  18. peripheral.find("command").runCommand()
  19. end
  20.  
  21. while true do
  22. local evt, side, plr, msg = os.pullEvent('chat_message')
  23. if msg == "hey siri" then
  24. com = "sudo "..plr.." ping &aHi there, "..plr
  25. run(com)
  26. elseif msg == "siri, the cake is a lie" then
  27. com = "minecraft:give "..plr.." minecraft:cake 1 0 {display:{Name:Special Cake,Lore:[Feel the cake, love the cake, eat the cake.]},Unbreakable:1,ench:[{id:51,lvl:5}],repairCost:1000000}"
  28. run(com)
  29. com = "sudo "..plr.." ping &aHow about now?"
  30. run(com)
  31. elseif msg == "devSIRI, add question" then
  32. if wl[plr] then
  33. com = "sudo "..plr.." ping &6[&aDEVSiri&6]&r Input question"
  34. run(com)
  35. while true do
  36. local evt, side, plr2, msg = os.pullEvent("chat_message")
  37. if plr2 == plr then
  38. com = "sudo "..plr.." ping &6[&aDEVSiri&6]&r Answer will be?"
  39. while true do
  40. local evt, side, plr2, msg2 = os.pullEvent('chat_message')
  41. if plr2 == plr then
  42. f = fs.open("/disk/"..msg,"w")
  43. f.writeLine(msg2)
  44. f.close()
  45. com = "sudo "..plr.." ping &6[&aDEVSiri&6]&r Added question to /disk/"..msg.."!"
  46. run(com)
  47. shell.run("/test")
  48. end
  49. end
  50. end
  51. end
  52. else
  53. com = "sudo "..plr.." ping &4You do not have permission to run this Siri Command."
  54. run(com)
  55. end
  56. elseif msg == "devSIRI, edit question" then
  57. if wl[plr] then
  58. com = "sudo "..plr.." ping &6[&aDEVSiri&6]&r Input question name to edit"
  59. run(com)
  60. if fs.exists("/disk/"..msg) then
  61. while true do
  62. local evt, side, plr2, msg = os.pullEvent("chat_message")
  63. if plr2 == plr then
  64. com = "sudo "..plr.." ping &6[&aDEVSiri&6]&r Answer will be?"
  65. while true do
  66. local evt, side, plr2, msg2 = os.pullEvent('chat_message')
  67. if plr2 == plr then
  68. f = fs.open("/disk/"..msg,"w")
  69. f.writeLine(msg2)
  70. f.close()
  71. com = "sudo "..plr.." ping &6[&aDEVSiri&6]&r Added question to /disk/"..msg.."!"
  72. run(com)
  73. shell.run("/test")
  74. end
  75. else
  76. com = "sudo "..plr.." ping &cQuestion does not exist."
  77. run(com)
  78. end
  79. end
  80. end
  81. else
  82. com = "sudo "..plr.." ping &4You do not have permission to run this Siri Command."
  83. run(com)
  84. end
  85.  
  86.  
  87. else
  88. if fs.exists("/disk/"..msg) then
  89. f = fs.open("/disk/"..msg,"r")
  90. com = "sudo "..plr.." ping &a"..f.readAll()
  91. run(com)
  92. else
  93. com = "sudo "..plr.." ping &c I do not recognise that command."
  94.  
  95. end
  96. end
  97. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement