Advertisement
Guest User

truck

a guest
Jul 4th, 2013
2,287
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.47 KB | None | 0 0
  1. print("By Jakemg")
  2. print(" ")
  3. print(" ")
  4. print("Please make sure your enderchest it in my 1st slot :D")
  5. sleep(3)
  6. term.clear()
  7.  
  8. tArgs = { ... }
  9.  
  10. local x = tonumber(tArgs[1] or "")
  11. while not x do
  12.  print("Need a distance to travel in number form")
  13.   x = tonumber(read())
  14.   end
  15.  
  16.  
  17. local y = tonumber(tArgs[1] or "")
  18. while not y do
  19. print ("I need your y coord")
  20. y = tonumber(read())
  21. end
  22.  
  23. y = y - 5
  24.  
  25.  function drop()
  26.  if turtle.getItemCount(16) > 0 then
  27.  turtle.select(1)
  28.  turtle.digDown()
  29.  turtle.placeDown()
  30.  for i=1,16 do
  31.  turtle.select(i)
  32.  turtle.dropDown()
  33.  end
  34.  turtle.select(1)
  35.  turtle.digDown()
  36.  end
  37.  end
  38.      
  39.   function go()
  40.   while not turtle.forward() do
  41.   turtle.attack()
  42.   turtle.dig()
  43.   end
  44.   sleep(0.8)
  45.   end
  46.  
  47.   function dig()
  48.   turtle.digUp()
  49.   sleep(0)
  50.   turtle.dig()
  51.   turtle.digDown()
  52.   drop()
  53.   end
  54.  
  55.   function move()
  56.   sleep(0)
  57.   dig()
  58.   go()
  59.   end
  60.  
  61.   function row()
  62.     for i=1,x do
  63.     sleep(0)
  64.     move()
  65.     end
  66.   end
  67.  
  68.   function row1()
  69.   turtle.turnRight()
  70.   move()
  71.   turtle.turnRight()
  72.   end
  73.  
  74.   function row2()
  75.   turtle.turnLeft()
  76.   move()
  77.   turtle.turnLeft()
  78.   end
  79.  
  80.   function all()
  81.   for i=1,x do
  82.   row()
  83.   row1()
  84.   row()
  85.   row2()
  86.   end
  87.   end
  88.    
  89.   function home()
  90.   turtle.turnLeft()
  91.   for i=1,x do
  92.   sleep(0)
  93.   go()
  94.   go()
  95.   end
  96.   turtle.turnRight()
  97.   for i=1,3 do
  98.   turtle.down()
  99.   turtle.digDown()
  100.   sleep(0)
  101.   end
  102.   end
  103.  
  104.   for i=1,y do
  105.   all()
  106.   home()
  107.   end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement