Advertisement
Andersfc

RednetRedstone-Receiver-name it Startup

Jan 16th, 2013
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.33 KB | None | 0 0
  1. shell.run("label set Redstoner")
  2. shell.run("clear")
  3. rednet.close("right")
  4. rednet.close("left")
  5. rednet.close("top")
  6. rednet.close("bottom")
  7. rednet.close("front")
  8. rednet.close("back")
  9.  
  10. if peripheral.isPresent("right") then
  11. print("Opening Modem on the right...")
  12. rednet.open("right")
  13. end
  14. if peripheral.isPresent("left") then
  15. print("Opening Modem on the left...")
  16. rednet.open("left")
  17. end
  18. if peripheral.isPresent("top") then
  19. print("Opening Modem on the top...")
  20. rednet.open("top")
  21. end
  22. if peripheral.isPresent("bottom") then
  23. print("Opening Modem on the bottom...")
  24. rednet.open("bottom")
  25. end
  26. if peripheral.isPresent("front") then
  27. print("Opening Modem on the front...")
  28. rednet.open("front")
  29. end
  30. if peripheral.isPresent("back") then
  31. print("Opening Modem on the back...")
  32. rednet.open("back")
  33. end
  34.  
  35. x,y,z=rednet.receive()
  36. print(y)
  37.  
  38. if y == "on" then
  39. redstone.setOutput("right", true)
  40. redstone.setOutput("left", true)
  41. redstone.setOutput("front", true)
  42. redstone.setOutput("back", true)
  43. redstone.setOutput("top", true)
  44. redstone.setOutput("bottom", true)
  45. shell.run("startup")
  46. end
  47. if y == "off" then
  48. redstone.setOutput("right", false)
  49. redstone.setOutput("left", false)
  50. redstone.setOutput("front", false)
  51. redstone.setOutput("back", false)
  52. redstone.setOutput("top", false)
  53. redstone.setOutput("bottom", false)
  54. shell.run("startup")
  55. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement