Advertisement
Guest User

fences

a guest
Sep 2nd, 2014
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.59 KB | None | 0 0
  1. itemCount = 0
  2. f = 1
  3.  
  4. function enough()
  5.  for i = 1, 12 do
  6.   if turtle.getItemCount(i) > 0 then
  7.    itemCount = itemCount + turtle.getItemCount(i)
  8.   end
  9.  end
  10. end
  11.  
  12. function begin()
  13.  for i = 1, x do
  14.     if turtle.getItemCount(f) == 0 then
  15.      f = f + 1
  16.         turtle.select(f)
  17.         turtle.forward()
  18.      turtle.placeDown()
  19.     else
  20.      turtle.select(f)
  21.         turtle.forward()
  22.         turtle.placeDown()
  23.     end
  24.  end
  25.  turtle.turnLeft()
  26. end
  27.  
  28. function sides()
  29.  for e = 1, 3 do
  30.   for i = 1, y do
  31.    if turtle.getItemCount(f) == 0 then
  32.      f = f + 1
  33.         turtle.select(f)
  34.      turtle.forward()
  35.      turtle.placeDown()
  36.     else
  37.      turtle.select(f)
  38.         turtle.forward()
  39.      turtle.placeDown()
  40.     end
  41.   end
  42.   turtle.turnLeft()  
  43.  end
  44. end
  45.  
  46. function quarryPlacement()
  47.  turtle.digDown()
  48.  turtle.select(16)
  49.  turtle.placeDown()
  50.  turtle.up()
  51.  turtle.select(14)
  52.  turtle.placeDown()
  53.  turtle.turnRight()
  54.  turtle.forward()
  55.  turtle.down()
  56.  turtle.select(15)
  57.  turtle.placeDown()
  58. end
  59.  
  60. term.clear()
  61. term.setCursorPos(1,1)
  62. print("Place fences in slots 1-12")
  63. print("")
  64. print("Place enderQuarry in last slot")
  65. print("")
  66. print("Place tesseract in the slot 15")
  67. print("")
  68. print("Place the enderChest in slot 14")
  69. print("")
  70. print("Press any key to continue")
  71. os.pullEvent("key")
  72. term.clear()
  73. term.setCursorPos(1,1)
  74.  
  75. write("How long does one side of the quarry have to be? ")
  76. x = read()
  77.  
  78. enough()
  79. Opp = x^2
  80. y = x - 1
  81.  
  82. if Opp > itemCount then
  83. print("You don't have enough fences")
  84. else
  85.  for i = 1, 20 do
  86.   turtle.up()
  87.  end
  88.   begin()
  89.   sides()
  90.   quarryPlacement()
  91.  end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement