Advertisement
SythsGod

Mob Trap Builder

Jul 5th, 2017
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.94 KB | None | 0 0
  1. -- 0.4
  2.  
  3. local fuelLevels = turtle.getFuelLevel()
  4. local selectedBox = 1
  5.  
  6. function shaft()
  7.     for i = 0, 19, 1 do
  8.         for i = 0, 3 do
  9.             placeBlock()
  10.             turtle.turnRight()
  11.         end
  12.  
  13.         turtle.up()
  14.     end
  15. end
  16.  
  17. function placeBlock()
  18.     if not turtle.place() then
  19.         selectedBox = selectedBox + 1
  20.         turtle.select(selectedBox)
  21.     end
  22. end
  23.  
  24. function placeBlockDown()
  25.     if not turtle.placeDown() and turtle.getItemCount(selectedBox) == 0 then
  26.         selectedBox = selectedBox + 1
  27.         turtle.select(selectedBox)
  28.     end
  29. end
  30.  
  31. function nextPos()
  32.     turtle.turnLeft()
  33.     turtle.forward()
  34.     turtle.turnRight()
  35.     turtle.back()
  36. end
  37.  
  38. -- buildshaft
  39. shaft()
  40.  
  41. -- get in position to build platform
  42. turtle.up()
  43. turtle.forward()
  44. turtle.turnRight()
  45. turtle.back()
  46.  
  47. --start building platform
  48. for i = 0, 8, 1 do
  49.     for j = 0, 3, 1 do
  50.         x = 3 + (2 * i)
  51.  
  52.         for k = 1, x, 1 do
  53.             placeBlockDown()
  54.             turtle.forward()
  55.         end
  56.  
  57.         turtle.turnRight()
  58.     end
  59.     nextPos()
  60. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement