zverijo

Mine 0.5

Jun 1st, 2014
588
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.56 KB | None | 0 0
  1. turtle.refuel()
  2. length=0
  3. length2=0
  4. width=0
  5. torchC=0
  6. lengthSave=0
  7. widthSave=0
  8. print("Enter length")
  9. length=read()
  10. lengthSave=length
  11. print("Enter width")
  12. width=read()
  13. widthSave=width
  14. print("Enter count")
  15. Grave=tonumber(read())
  16. print("Yes Boss")
  17. function dig()
  18.  turtle.dig()
  19.  turtle.forward()
  20.  turtle.digDown()
  21.  turtle.digUp()
  22. end
  23. function chest()
  24.  if turtle.getItemCount(16)>0 then
  25.    turtle.down()
  26.    turtle.digDown()
  27.    turtle.select(2)
  28.    turtle.placeDown()
  29.    for i=16,3,-1 do turtle.select(i); turtle.dropDown() end
  30.    turtle.up()
  31.  elseif turtle.getFuelLevel()<1 then exit() end
  32. end
  33. function torch()
  34.  if torchC==0 then
  35.   turtle.select(1)
  36.   turtle.placeDown()
  37.   torchC=6
  38.   else
  39.   torchC=torchC-1
  40.  end
  41. end
  42. print(type(Grave))
  43. print(type(width))
  44. while Grave~=0 do
  45.  length=length-1
  46.  repeat
  47.   length=length-1
  48.   dig()
  49.   torch()
  50.   chest()
  51.  until length==0
  52.  if Grave==1 then exit()
  53.  end
  54.  Grave=Grave-1
  55.  if Grave%2==1 and width~=0 then
  56.   turtle.turnLeft()
  57.    width=width+1
  58.    repeat
  59.     width=width-1
  60.     dig()
  61.     torch()
  62.     chest()
  63.    until width==0
  64.   turtle.turnLeft()
  65.  elseif Grave%2==0 and width~=0 then
  66.    turtle.turnRight()
  67.    width=width+1
  68.    repeat
  69.     width=width-1
  70.     dig()
  71.     torch()
  72.     chest()
  73.    until width==0
  74.   turtle.turnRight()
  75.  elseif width==0 and Grave%2==1 then
  76.   turtle.turnLeft()
  77.   dig()
  78.   torch()
  79.   chest()
  80.   turtle.turnLeft()
  81.  elseif width==0 and Grave%2==0 then
  82.   turtle.turnRight()
  83.   dig()
  84.   torch()
  85.   chest()
  86.   turtle.turnRight()
  87.  end    
  88.  width=widthSave
  89.  length=lengthSave
  90. end
Advertisement
Add Comment
Please, Sign In to add comment