Advertisement
asixsidedsquare

RailTunneler

Jul 21st, 2017
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.96 KB | None | 0 0
  1. local component = require("component")
  2. local computer = require("computer")
  3. local robot = require("robot")
  4. local shell = require("shell")
  5. local sides = require("sides")
  6.  
  7. function placeRail()
  8. robot.down()
  9. if robot.detectDown() then
  10. robot.up()
  11. robot.select(1)
  12. robot.placeDown()
  13. end
  14. end
  15.  
  16. function placeTorch()
  17. robot.swing()
  18. robot.forward()
  19. if robot.detect() then
  20. robot.back()
  21. robot.select(5)
  22. robot.place()
  23. end
  24. end
  25.  
  26. while(true) do
  27. robot.swing()
  28. robot.forward()
  29. robot.swingUp()
  30. robot.swingDown()
  31. robot.turnRight()
  32. robot.swing()
  33. robot.forward()
  34. robot.swingUp()
  35. robot.swingDown()
  36. placeRail()
  37. robot.swing()
  38. robot.forward()
  39. robot.swingUp()
  40. robot.swingDown()
  41. robot.turnLeft()
  42. robot.swing()
  43. robot.forward()
  44. robot.swingUp()
  45. robot.swingDown()
  46. robot.turnLeft()
  47. robot.swing()
  48. robot.forward()
  49. robot.swingUp()
  50. robot.swingDown()
  51. placeRail()
  52. robot.swing()
  53. robot.forward()
  54. robot.swingUp()
  55. robot.swingDown()
  56. placeTorch()
  57. robot.turnRight()
  58. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement