Advertisement
Guest User

lol

a guest
Jan 25th, 2020
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.39 KB | None | 0 0
  1.  
  2. --11--
  3. function forward()
  4.  while true do
  5.   if turtle.forward() then
  6.    break
  7.    else
  8.    turtle.attack()
  9.    turtle.dig()
  10.   end
  11.  end
  12. end
  13.  
  14. function up()
  15.  while true do
  16.   if turtle.up() then
  17.    break
  18.    else
  19.    turtle.digUp()
  20.    turtle.attackUp()
  21.   end
  22.  end
  23. end
  24.  
  25. function down()
  26.  while true do
  27.   if turtle.down() then
  28.    break
  29.    else turtle,attackDown()
  30.    turtle.digDown()
  31.  
  32.   end
  33.  end
  34. end
  35.  
  36.  
  37. local wherex, wherey, wherez,a,b,c,homey,turtley
  38.  
  39. function comebackhome()
  40.  
  41.  rednet.open("left")
  42.  local a,b = rednet.receive()
  43.  b = wherex
  44.  local a,b = rednet.receive()
  45.  b = wherez
  46.  local a,b = rednet.receive()
  47.  b = homey
  48.  
  49.  local x,y,z =  gps.locate()
  50.  homey - y = wherey
  51.  
  52.  
  53.  for i = 1, wherey do
  54.   up()
  55.  end
  56.  
  57.  turtle.turnRight()
  58.  turtle.turnRight()
  59.  
  60.  for i = 1, wherez do
  61.   forward()
  62.  end
  63.  
  64.  turtle.turnRight()
  65.  
  66.  for i = 1,wherex() do
  67.   forward()
  68.  end
  69.  
  70.  turtle.turnRight()
  71.  
  72. end
  73.  
  74. function cycle()
  75.  
  76.  wherey = 0
  77.  turtle.turnRight()
  78.  for i = 1,wherex do
  79.   forward()
  80.  end
  81.  
  82.  turtle.turnLeft()
  83.  
  84.  for i = 1,wherez do
  85.   forward()
  86.  end
  87.  
  88.  while true do
  89.   if turtle.detectDown() then
  90.    if not turtle.digDown() then
  91.     break --bedrock--
  92.     else down()
  93.     wherey = wherey + 1
  94.    end
  95.    else down()
  96.    wherey = wherey + 1
  97.   end
  98.  end  
  99.  
  100.  while wherey > 0 do
  101.   up()
  102.   wherey = wherey - 1
  103.  
  104.      if wherey > 0 then
  105.       up()
  106.       wherey = wherey - 1
  107.      end
  108.  
  109.   for i = 1,16 do
  110.  
  111.    if turtle.getItemDetail(i) then
  112.     if turtle.getItemDetail(i).name == "minecraft:cobblestone" then
  113.      turtle.select(i)
  114.      turtle.placeDown()
  115.     end
  116.    end
  117.   end
  118.  end
  119.  
  120.  for i = 1,16 do
  121.   turtle.select(i)
  122.  
  123.   if turtle.getItemDetail() then
  124.    if (turtle.getItemDetail().name == "minecraft:cobblestone") or (turtle.getItemDetail().name == "minecraft:stone") or (turtle.getItemDetail().name == "minecraft:dirt") then
  125.     turtle.placeDown()
  126.     turtle.Drop()
  127.    end
  128.   end
  129.    
  130.  
  131.  turtle.turnRight()
  132.  turtle.turnRight()
  133.  
  134.  for i = 1,wherez do
  135.   forward()
  136.  end
  137.  
  138.  turtle.turnRight()
  139.  
  140.  for i = 1,wherex do
  141.   forward()
  142.  end
  143.  
  144.  turtle.turnRight()
  145.  
  146.  
  147.  rednet.send(26,wherex)
  148.  os.sleep(1)
  149.  rednet.send(26,wherez)
  150.  
  151. end
  152.  
  153.  
  154. function cycle2()
  155.  for i = 1,15 do
  156.  
  157.  cycle()
  158.  wherez = wherez + 1
  159.  end
  160. end
  161.  
  162. function cycle3()
  163.  
  164.  for i = 1,15 do
  165.  
  166.   cycle2()
  167.   wherex = wherex + 1
  168.  end
  169. end
  170. ----
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement