thorax232

Computer Craft Castle Wall (Minecolonies)

Jun 7th, 2014
848
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.69 KB | None | 0 0
  1. function placeBlock(n) -- Place block below, move forward
  2.     for i = 1,n do
  3.         turtle.placeDown()
  4.         turtle.forward()
  5.     end
  6. end
  7. function turnAround() -- 180 deg turn
  8.     turtle.turnLeft()
  9.     turtle.turnLeft()
  10. end
  11. function backUp(n) -- Move back n times
  12.     for i = 1,n do
  13.         turtle.back()
  14.     end
  15. end
  16. function forward(n) --  Move forward n times
  17.     for i = 1,n do
  18.         turtle.forward()
  19.     end
  20. end
  21. function down(n) -- Move down n times
  22.     for i = 1,n do
  23.         turtle.down()
  24.     end
  25. end
  26. function planks()
  27.     turtle.select(1) -- Wood Plank: 16 per section
  28.     placeBlock(6) -- Place 6 wood planks
  29.     for i = 1,2 do -- Moves to second row
  30.         turtle.turnLeft()
  31.         turtle.forward()
  32.     end
  33.     placeBlock(6) -- Places second plank row
  34. end
  35. function cobblestone()
  36.     turtle.select(2) -- Cobblestone: 18 per section
  37.     turtle.up() -- Up and around to place new row on top
  38.     turnAround()
  39.     placeBlock(6) -- Uses place/forward pattern, loop not possible
  40.     turtle.up()
  41.     turnAround()
  42.     turtle.forward() -- Extra forward to account for place/forward pattern
  43.     placeBlock(6)
  44.     turtle.up()
  45.     turnAround()
  46.     placeBlock(6)
  47. end
  48. function plankEdge()
  49.     turtle.turnLeft() -- Move up and left for spider blocker
  50.     turtle.forward()
  51.     turtle.turnLeft()
  52.     turtle.up()
  53.     turtle.select(1) -- Wood Plank: 16 per section
  54.     for i = 1,4 do -- Old forward/place pattern (works here)
  55.         turtle.forward()
  56.         turtle.placeDown()
  57.     end
  58. end
  59. function pillars()
  60.     turtle.select(3) -- Wood: 12 per section
  61.     turtle.forward()
  62.     down(5) -- Start building from bottom
  63.     for i = 1,6 do
  64.         turtle.up()
  65.         turtle.placeDown()
  66.     end
  67.     backUp(2) -- Get to spot to place torch
  68.     turtle.down()
  69.     turtle.select(4) -- Torch: 2 per section
  70.     turtle.place()
  71.     turtle.up() -- Move to next pillar
  72.     forward(3)
  73.     down(6)
  74.     turtle.select(3) -- Wood: 12 per section
  75.     for i = 1,6 do
  76.         turtle.up()
  77.         turtle.placeDown()
  78.     end
  79.     forward(2) -- Move to second torch
  80.     turnAround()
  81.     turtle.down()
  82.     turtle.select(4) -- Torch: 4 per section
  83.     turtle.place() -- Place 2nd torch
  84. end
  85. function ladders()
  86.     turtle.turnRight() -- Move to position for ladders
  87.     forward(3)
  88.     turtle.turnLeft()
  89.     forward(2)
  90.     turtle.turnLeft()
  91.     down(2)
  92.     turtle.select(5) -- Ladder: 3 per section
  93.     for i = 1,3 do -- Place ladders
  94.         turtle.place()
  95.         turtle.down()
  96.     end
  97. end
  98. function moveNext()
  99.     turtle.up() -- Move into position for next section (perfect fit!)
  100.     turtle.turnRight()
  101.     forward(5)
  102.     turtle.turnLeft()
  103.     turtle.forward()
  104.     turtle.turnRight()
  105.     turtle.forward()
  106. end
  107.        
  108. --[[Computer Craft Castle Wall (Minecolonies)(In Progress)]]--
  109. --[[Start turtle one space off ground, disk drive to right]]--
  110. --[[Remove disk drive after starting if using]]--
  111. planks()
  112. turtle.forward()
  113. cobblestone()
  114. plankEdge()
  115. pillars()
  116. ladders()
  117. moveNext()
Advertisement
Add Comment
Please, Sign In to add comment