Guest User

tunnel2

a guest
Feb 2nd, 2013
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.05 KB | None | 0 0
  1. tArgs = { ... }
  2. todo = tonumber(tArgs[1])
  3. --
  4.  
  5. turtle.select(1)
  6.  
  7. function refill()
  8.   if turtle.getItemCount(3) == 0 then
  9.   turtle.select(5)
  10.   turtle.turnRight()
  11.   turtle.turnRight()
  12.   turtle.place()
  13.   turtle.suck()
  14.   turtle.dig()
  15.   turtle.turnRight()
  16.   turtle.turnRight()
  17.   end
  18. end
  19.  
  20.  
  21. function checkslot()
  22. if turtle.getItemCount(1) <=6 then
  23. turtle.select(2)
  24. turtle.transferTo(1)
  25. turtle.select(1)
  26.   if turtle.getItemCount(2) <=6 then
  27.   turtle.select(3)
  28.   turtle.transferTo(1)
  29.   turtle.select(1)
  30.   end
  31.  end
  32. end
  33.  
  34. function checkwallLU()
  35. checkslot()
  36. turtle.turnLeft()
  37. turtle.place()
  38. turtle.down()
  39. turtle.place()
  40. turtle.up()
  41. turtle.turnRight()
  42. os.sleep(0.1)
  43. end
  44.  
  45. function checkwallU()
  46. checkslot()
  47. turtle.turnRight()
  48. turtle.place()
  49. turtle.placeUp()
  50. end
  51.  
  52. function checkwallD()
  53. checkslot()
  54. turtle.place()
  55. turtle.placeDown()
  56. turtle.turnLeft()
  57. end
  58.  
  59. for i = 1, todo do
  60. turtle.select(1)
  61. checkslot()
  62. refill()
  63. turtle.dig()
  64. turtle.forward()
  65. checkwallU()
  66. turtle.digDown()
  67. turtle.down()
  68. checkwallD()
  69. turtle.up()
  70. checkwallLU()
  71. end
Advertisement
Add Comment
Please, Sign In to add comment