Guest User

sm

a guest
Aug 1st, 2014
241
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.62 KB | None | 0 0
  1. -- SexBot at your service
  2.  
  3. -- Pre-code code
  4. term.clear()
  5. term.setCursorPos(1,1)
  6.  
  7. Slot14 = turtle.getItemCount(14)
  8. Slot15 = turtle.getItemCount(15)
  9. Slot16 = turtle.getItemCount(16)
  10.  
  11. if Slot14 == 0 then
  12.   term.setTextColor(colors.red)
  13.   print("ERROR: Check slot 14 for missing ender chest for torches!")
  14.   sleep(3)
  15.   term.setCursorPos(1,4)
  16.   print("Rebooting turtle, please run the program again when the problem is solved.")
  17.   sleep(3)
  18.   os.reboot()
  19.  
  20.  else
  21.   term.setTextColor(colors.lime)
  22.   print("Ender chest for torches was found in slot 14!")
  23.   term.setTextColor(colors.white)
  24.   sleep(1)
  25. end
  26.  
  27. if Slot15 == 0 then
  28.   term.setTextColor(colors.red)
  29.   print("ERROR: Check slot 15 for missing torches!")
  30.   sleep(3)
  31.   term.setCursorPos(1,4)
  32.   print("Rebooting, please run the program again when the problem is solved.")
  33.   sleep(3)
  34.   os.reboot()
  35.  
  36.  else
  37.   term.setTextColor(colors.lime)
  38.   print("Torches were found in slot 15!")
  39.   term.setTextColor(colors.white)
  40.   sleep(1)
  41. end
  42.  
  43. if Slot16 == 0 then
  44.   term.setTextColor(colors.red)
  45.   print("ERROR: Check slot 16 for missing ender chest for resources!")
  46.   sleep(3)
  47.   term.setCursorPos(1,4)
  48.   print("Rebooting, please run the program again when the problem is solved.")
  49.   sleep(3)
  50.   os.reboot()
  51.  
  52.  else
  53.   term.setTextColor(colors.lime)
  54.   print("Ender chest for resources was found in slot 16!")
  55.   term.setTextColor(colors.white)
  56.   sleep(1)
  57. end
  58.  
  59. term.clear()
  60. term.setCursorPos(1,1)
  61.  
  62.  
  63.  
  64. --QUESTION TIME
  65.  
  66.  
  67.  
  68. term.setTextColor(colors.yellow)
  69. write("How many times do you want me to strip mine? ")
  70. term.setTextColor(colors.white)
  71. term.setCursorPos(1,4)
  72.  
  73. x = read()
  74.  
  75. term.setCursorPos(1,6)
  76. term.setTextColor(colors.yellow)
  77. write("How long should each tunnel be?")
  78. term.setCursorPos(1,8)
  79. term.setTextColor(colors.white)
  80.  
  81. y = read()
  82.  
  83. term.setCursorPos(1,10)
  84. term.setTextColor(colors.lime)
  85. print("Ok, I will strip mine "..x.." times, with each tunnel being "..y.." blocks long!")
  86.  
  87. sleep(3)
  88.  
  89. term.setCursorPos(1,13)
  90.  
  91.  
  92.  
  93. -- oh lawd here it comez
  94.  
  95.  
  96.  
  97. for a = 1,x do
  98.   print("Starting strip: "..x)
  99.   turtle.turnLeft()
  100.   turtle.forward()
  101.     for b = 1,y do
  102.       if b == y then
  103.         turtle.turnLeft()
  104.         turtle.turnLeft()
  105.           for c = 1,y do
  106.             turtle.forward()
  107.            end
  108.         turtle.forward()
  109.         turtle.forward()
  110.         turtle.forward()
  111.        end
  112.       if b % 4 == 0 then
  113.         turtle.select(15)
  114.         turtle.placeDown()
  115.         turtle.select(1)
  116.        end
  117.       turtle.dig()
  118.       turtle.forward()
  119.       turtle.digDown()
  120.     end
  121.   print("I've finished mining all "..x.." strips!")
  122. end
Advertisement
Add Comment
Please, Sign In to add comment