Guest User

mobtrap

a guest
Jun 3rd, 2013
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.82 KB | None | 0 0
  1. local info
  2.   term.write("MobDrop(1) or TradeVillage(2): ")
  3.   info = read()
  4.   print(info)
  5.    if info == 1 then
  6.    print("Building MobDrop")
  7.     else
  8.      if info == 2 then
  9.      print("Building TradeVillage")
  10.       else
  11.        print("Error not valid build")
  12.      end
  13.    end
  14.  
  15. function up(x)
  16. for i=1,x do
  17. while not turtle.up() do
  18. turtle.digUp()
  19. turtle.attackUp()
  20. end
  21. end
  22. end
  23.  
  24. function forward(x)
  25. for i=1,x do
  26. while not turtle.forward() do
  27. turtle.dig()
  28. turtle.attack()
  29. end
  30. end
  31. end
  32.  
  33. function back(x)
  34. for i=1,x do
  35. while not turtle.back() do
  36. turtle.turnLeft()
  37. turtle.turnLeft()
  38. turtle.dig()
  39. turtle.attack()
  40. turtle.turnRight()
  41. turtle.turnRight()
  42. end
  43. end
  44. end
  45.  
  46. function down(x)
  47. for i=1,x do
  48. while not turtle.down() do
  49. turtle.digDown()
  50. turtle.attackDown()
  51. end
  52. end
  53. end
  54.  
  55.  
  56. function place(x)
  57. for i=1,x do
  58. blocks()
  59. back(1)
  60. turtle.place()
  61. end
  62. end
  63.  
  64. function pDown(x)
  65. for i=1,x do
  66. blocks()
  67. while not turtle.placeDown() do
  68. turtle.digDown()
  69. turtle.attackDown()
  70. end
  71. back(1)
  72. end
  73. end
  74.  
  75. function blocks()
  76. turtle.select(1)
  77.     if turtle.getItemCount(1)<1 then
  78.   turtle.select(16)
  79.  if turtle.detectUp() then
  80.  turtle.digUp()
  81.  turtle.select(1)
  82.  turtle.drop()
  83.  turtle.select(16)
  84.  end
  85.   turtle.placeUp()
  86.   turtle.select(1)
  87.   turtle.suckUp()
  88.   turtle.select(16)
  89.   turtle.digUp()
  90.   turtle.select(1)
  91. end
  92. end
  93.  
  94.  
  95. function floor()
  96. up(1)
  97. for i=1,5 do
  98. pDown(11)
  99. for i=1,2 do
  100. turtle.turnRight()
  101. back(1)
  102. end
  103. pDown(11)
  104. for i=1,2 do
  105. turtle.turnLeft()
  106. back(1)
  107. end
  108. end
  109. pDown(11)
  110. end
  111.  
  112. function walls(x)
  113. forward(1)
  114. turtle.turnLeft()
  115. turtle.turnLeft()
  116.   for i=1,x do
  117.    for i=1,3 do
  118.     place(10)
  119.     turtle.turnRight()
  120.     end
  121.    place(9)
  122.    up(1)
  123.    pDown(1)
  124.  turtle.turnRight()
  125.  end
  126. end
  127.  
  128. function tower()
  129. turtle.turnLeft()
  130. turtle.turnLeft()
  131. floor()
  132. walls(3)
  133. floor()
  134. end
Advertisement
Add Comment
Please, Sign In to add comment