Advertisement
Guest User

Untitled

a guest
Sep 14th, 2016
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.61 KB | None | 0 0
  1. local robot = require("robot")
  2. local shell = require("shell")
  3. local component = require("component")
  4.  
  5.  
  6. print(" +----------MINERv2000----------+\n")
  7. print(" | Made by Habitus |\n")
  8. print(" +------------------------------+\n\n")
  9. print(" Did you give me a pickaxe ?\n")
  10. print(" I need torches in the Green slot!\n")
  11. print(" How far do you want me to go?\n")
  12.  
  13. repeat
  14. lenght = io.read("*number")
  15. lenght_count = 0
  16. print(" How many lines do you want me to do?")
  17. row = io.read("*number")
  18. row_count = 0
  19. torch = 10
  20. torch_count = 0
  21.  
  22. print(" +----------YES MASTER----------+\n")
  23.  
  24. while lenght_count <= lenght do
  25. robot.swing()
  26. robot.forward()
  27. robot.swingDown()
  28. robot.swingUp()
  29. lenght_count = lenght_count+1
  30. print("-> Process = ",(lenght_count),"/", (lenght), "\n")
  31. end
  32.  
  33. robot.turnRight()
  34. robot.turnRight()
  35.  
  36. while lenght_count >= 0 do
  37.  
  38. if torch_count < torch then
  39. robot.forward()
  40. lenght_count = lenght_count-1
  41. torch_count = torch_count+1
  42. end
  43. if torch_count == torch-1 then
  44. robot.turnRight()
  45. robot.swing()
  46. robot.select(1)
  47. robot.place()
  48. robot.turnLeft()
  49. torch_count = 0
  50. end
  51. end
  52.  
  53.  
  54. robot.turnRight()
  55. if robot.detect() then
  56. robot.swing()
  57. end
  58. robot.forward()
  59. if robot.detect() then
  60. robot.swing()
  61. end
  62. robot.forward()
  63. if robot.detect() then
  64. robot.swing()
  65. end
  66. robot.forward()
  67. robot.turnRight()
  68. robot.swing()
  69. robot.forward()
  70.  
  71. row_count = row_count + 1
  72.  
  73. lenght_count = 0
  74. until row_count == row
  75. print(row_count)
  76. --lenght = 0
  77. print(" +----------FINISHEDez----------+\n")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement