Advertisement
DustinRosebery

new rubberfarm

Nov 26th, 2013
288
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local t = turtle
  2.  
  3. local function forward(x)
  4.     for i = 1, x do
  5.         t.forward()
  6.     end
  7. end
  8.  
  9. local function rTurn(x)
  10.     for i = 1, x do
  11.         t.turnRight()
  12.     end
  13. end
  14.  
  15. local function lTurn(x)
  16.     for i = 1, x do
  17.         t.turnLeft()
  18.     end
  19. end
  20.  
  21. local function up(x)
  22.     for i = 1, x do
  23.         t.up()
  24.     end
  25. end
  26.  
  27. local function down(x)
  28.     for i = 1, x do
  29.         t.down()
  30.     end
  31. end
  32.  
  33. local function back(x)
  34.     for i = 1, x do
  35.         t.back()
  36.     end
  37. end
  38.  
  39. local function tap1(x)
  40.     for i = 1, x do
  41.         t.dig
  42.         lTurn(1)
  43.         forward(1)
  44.         rTurn(1)
  45.     end
  46. end
  47.  
  48. local function tap2(x)
  49.     for i = 1, x do
  50.         t.dig()
  51.         up(1)
  52.         t.dig()
  53.         down(1)
  54.         lTurn(1)
  55.         forward(1)
  56.         rTurn(1)
  57.  
  58. local function depositLoop()
  59.     for i = 16, 1, -1 do
  60.         t.select(i)
  61.         t.dropRight()
  62.     end
  63.     os.sleep(3600)
  64.     os.reboot()
  65.    
  66.  
  67. forward(1)
  68. rTurn(1)
  69. t.dig()
  70. lTurn(1)
  71.  
  72. tap1(2)
  73. tap2(3)
  74. tap1(1)
  75.  
  76. -- first row done --
  77.  
  78. lTurn(1)
  79.  
  80. tap1(2)
  81. tap2(3)
  82. tap1(3)
  83.  
  84. -- second row done --
  85.  
  86. lTurn(1)
  87.  
  88. tap1(1)
  89. tap2(4)
  90. tap1(1)
  91.  
  92. -- third row done --
  93.  
  94. lTurn(1)
  95.  
  96. tap1(5)
  97.  
  98. lTurn(1)
  99. forward(1)
  100.  
  101. depositLoop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement