Advertisement
jserve

Untitled

Jan 30th, 2021 (edited)
444
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.43 KB | None | 0 0
  1. local distance = 32
  2. local stop = false
  3.  
  4. while not stop do
  5.     local success, data = turtle.inspectDown()
  6.     if success then
  7.      if data.name == "minecraft:rail" then
  8.         turtle.digDown()
  9.         turtle.select(2)
  10.         turtle.placeDown()
  11.         turtle.turnLeft()
  12.         forward = turtle.forward()
  13.         if not forward then
  14.             turtle.dig()
  15.             turtle.forward()
  16.         end
  17.         turtle.select(3)
  18.         if turtle.detectDown() then
  19.             turtle.digDown()
  20.         end
  21.         turtle.placeDown()
  22.         turtle.turnRight()
  23.         turtle.turnRight()
  24.         turtle.forward()
  25.         turtle.turnLeft()
  26.         if turtle.getItemCount(2) > 0 then        
  27.             for i = 1, distance do
  28.                 canForward = turtle.forward()
  29.                 if not canForward then
  30.                     stop = true
  31.                     break
  32.                 end
  33.                 local success = turtle.inspectDown()
  34.                 if not success then
  35.                     turtle.select(4)
  36.                     turtle.placeDown()
  37.                     if turtle.getItemCount(4) == 0 then
  38.                         for i = 5, 16 do
  39.                             data = turtle.getItemDetail(i)
  40.                             if data then
  41.                                 if data.name ==  "minecraft:rail" then
  42.                                     turtle.select(i)
  43.                                     turtle.transferTo(4, 64)
  44.                                     break                              
  45.                                 end
  46.                             end
  47.                         end
  48.                         if turtle.getItemCount(4) == 0 then
  49.                             stop = true
  50.                         end
  51.                     end
  52.                 end
  53.             end
  54.          else
  55.             stop = true
  56.          end
  57.      end
  58.     else
  59.         stop = true
  60.     end
  61. end
  62. print ("The End of the World!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement