Advertisement
Guest User

dig

a guest
Mar 29th, 2015
237
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.97 KB | None | 0 0
  1. --Variables
  2. go = true
  3. chk = true
  4. dnc = 10
  5. trvd = 0
  6. --Functions
  7. dig = function()
  8.  turtle.dig()
  9.  turtle.digUp()
  10.  turtle.forward()
  11.  chkDrp()
  12.  trvd = (trvd+1)
  13. end
  14.  
  15. chkDrp = function()
  16.  inv = 1
  17.  while chk == true do
  18.   if turtle.getItemCount(inv) == 0 then
  19.    chk = false
  20.   else
  21.    inv = inv+1
  22.    if inv == 17 then
  23.     drpOf()
  24.    end
  25.   end
  26.  end
  27.  chk = true
  28. end
  29.  
  30. drpOf = function()
  31.  go = false
  32. end
  33.  
  34. strp = function()
  35.  sf = 0
  36.  while dnc ~= sf do
  37.   chkDrp()
  38.   dig()
  39.   sf = sf+1
  40.  end
  41. end
  42.  
  43. ary = function()
  44.  while go == true do
  45.   strp()
  46.   turtle.turnLeft()
  47.   dig()
  48.   dig()
  49.   dig()
  50.   dig()
  51.   turtle.turnRight()
  52.   turtle.turnRight()
  53.   dig()
  54.   dig()
  55.   dig()
  56.   dig()
  57.   dig()
  58.   dig()
  59.   dig()
  60.   dig()
  61.   turtle.turnRight()
  62.   strp()
  63.   turtle.turnRight()
  64.   dig()
  65.   dig()
  66.   dig()
  67.   dig()
  68.   turtle.turnRight()
  69.   turtle.turnRight()
  70.   dig()
  71.   dig()
  72.   dig()
  73.   dig()
  74.   dig()
  75.   dig()
  76.   dig()
  77.   dig()
  78.   turtle.turnLeft()
  79.  end
  80. end
  81. --Code
  82. ary()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement