Guest User

connectthree

a guest
Nov 19th, 2015
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.62 KB | None | 0 0
  1. chat = peripheral.wrap("front")
  2. rednet.open("right")
  3.  a = math.random(1,5)
  4. chat.say("Ok, I'm going in spot "..a)
  5. if a  == 1 then
  6. redstone.setOutput("back",true)
  7. end
  8. if a == 2 then
  9. redstone.setOutput("top", true)
  10. end
  11. if a == 3 then
  12. redstone.setOutput("left", true)
  13. end
  14. if a == 4 then
  15. redstone.setOutput("bottom", true)
  16. end
  17. if a == 5 then
  18. rednet.send(52,"redstone","redstone5")
  19. end
  20. sleep(2)
  21. chat.say("What space would you like to go to?")
  22. player, event, command = os.pullEvent("chat")
  23.  
  24. sleep(2)
  25.  
  26.  
  27. if string.find(command, "1") then
  28. redstone.setOutput("back", true)
  29. end
  30. if string.find(command, "2") then
  31. redstone.setOutput("top", true)
  32. end
  33. if string.find(command, "3") then
  34. redstone.setOutput("left", true)
  35. end
  36. if string.find(command, "4") then
  37. redstone.setOutput("bottom", true)
  38. end
  39. if string.find(command, "5")  then
  40. rednet.send(52,"redstone", "redstone5")
  41. end
  42. if string.find(command, "6") then
  43. rednet.send(51, "redstone", "redstone6")
  44. end
  45. if string.find(command, "7") then
  46. rednet.send(53, "redstone", "redstone7")
  47. end
  48. if string.find(command, "8") then
  49. rednet.send(55, "redstone", "redstone8")
  50. end
  51. if string.find(command, "9") then
  52. rednet.send(54, "redstone", "redstone9")
  53. end
  54. if string.find(command, "10") then
  55. rednet.send(56, "redstone", "redstone10")
  56. end
  57. if string.find(command, "11") then
  58. rednet.send(56, "redstone", "redstone11")
  59. end
  60. sleep(2)
  61. topBottom = math.random(1,2)
  62. print("This is top bottom: "..topBottom)
  63. chat.say("Alright, my turn again.")
  64. if topBottom == 1 then
  65.   repeat
  66.     aa = math.random(1,5)
  67.     print(aa)
  68.     until aa~= a and aa ~= command
  69.     sleep(2)
  70.     chat.say("I will go to spot "..aa)
  71.   end
  72.  
  73. if topBottom == 2 then
  74. end
  75.  
  76.  if command == a +5 then
  77. aa = command +5
  78. sleep(2)
  79. chat.say("I will go to spot "..aa)
  80.  
  81.  elseif command ~= a+5 then
  82.   aa = a+5
  83.   sleep(2)
  84.   chat.say("I will go to spot "..aa)
  85.   end
  86.    
  87.  if aa == 1 then
  88.  redstone.setOutput("back", true)
  89.  end
  90.  if aa == 2 then
  91.  redstone.setOutput("top", true)
  92.  end
  93.  if aa == 3 then
  94.  redstone.setOutput("left",true)
  95.  end
  96.  if aa == 4 then
  97.  redstone.setOutput("bottom", true)
  98.  end
  99.  if aa == 5 then
  100.  rednet.send(52, "redstone5", "redstone5")
  101.  end
  102.  if aa== 6 then
  103.  rednet.send(51, "redstone6", "redstone6")
  104.  end
  105.  if aa == 7 then
  106.  rednet.send(53, "redstone7", "redstone7")
  107.  end
  108.  if aa == 8 then
  109.  rednet.send(55, "redstone", "redstone8")
  110.  end
  111.  if aa== 9 then
  112.  rednet.send(54, "redstone", "redstone9")
  113.  end
  114.  if aa== 10 then
  115.  rednet.send(56, "redstone", "redstone10")
  116.  end
  117.  if aa == 11 then
  118.  rednet.send(61, "redstone", "redstone11")
  119.  end
Advertisement
Add Comment
Please, Sign In to add comment