Advertisement
Spatzenhirn123

Circle

Nov 14th, 2014
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.94 KB | None | 0 0
  1. i=1
  2. turtle.select(1)
  3. function place()
  4.     if turtle.getItemCount(i)>0 then
  5.         turtle.placeDown()
  6.     else
  7.         i=i+1
  8.         turtle.select(i)
  9.         turtle.placeDown()
  10.     end
  11. end
  12. function forward()
  13.         while turtle.forward()==false do
  14.                 sleep(0.5)
  15.         end
  16. end
  17. function up()
  18.         while turtle.up()==false do
  19.                 sleep(0.5)
  20.         end
  21. end
  22. function circle()
  23.     turtle.turnLeft()
  24.     for t=1,4,1 do
  25.         for k=1,5,1 do
  26.             place()
  27.             forward()
  28.         end
  29.         turtle.turnRight()
  30.         forward()
  31.         turtle.turnLeft()
  32.         place()
  33.         forward()
  34.         place()
  35.         forward()
  36.         turtle.turnRight()
  37.         forward()
  38.         place()
  39.         forward()
  40.         turtle.turnLeft()
  41.         forward()
  42.         place()
  43.         forward()
  44.         turtle.turnRight()
  45.         forward()
  46.         place()
  47.         forward()
  48.         place()
  49.         turtle.turnLeft()
  50.         forward()
  51.         turtle.turnRight()
  52.         forward()
  53.     end
  54.     turtle.turnRight()
  55. end
  56. function Cforward()
  57.     up()
  58.     circle()
  59.     forward()
  60. end
  61. function CLeft()
  62.     up()
  63.     circle()
  64.     turtle.turnLeft()
  65.     forward()
  66.     turtle.turnRight()
  67.     forward()
  68. end
  69. function CRight()
  70.     up()
  71.     circle()
  72.     turtle.turnRight()
  73.     forward()
  74.     turtle.turnLeft()
  75.     forward()
  76. end
  77. function POS()
  78.     for f=1,10,1 do
  79.         forward()
  80.     end
  81.     turtle.turnRight()
  82.     for f=1,6,1 do
  83.         forward()
  84.     end
  85.     turtle.turnRight()
  86.     turtle.turnRight()
  87. end
  88.  
  89. -------------------------------------------------------------------------------
  90. function Halfcircle()
  91.     P()
  92.     Cforward()
  93.     Cforward()
  94.     Cforward()
  95.     Cforward()
  96.     CLeft()
  97.     Cforward()
  98.     Cforward()
  99.     CLeft()
  100.     CLeft()
  101.     Cforward()
  102.     POS()
  103.     CRight()
  104.     CRight()
  105.     CRight()
  106.     Cforward()
  107.     CRight()
  108.     CRight()
  109.     Cforward()
  110.     Cforward()
  111.     CRight()
  112.     Cforward()
  113.     Cforward()
  114.     Cforward()
  115.     O()
  116. end
  117. function P()
  118.     turtle.turnLeft()
  119.     turtle.turnLeft()
  120.     for h=1,9,1 do
  121.         forward()
  122.     end
  123.     turtle.turnLeft()
  124.     forward()
  125.     forward()
  126.     turtle.turnLeft()
  127. end
  128. function O()
  129.     for h=1,9,1 do
  130.         forward()
  131.     end
  132.     turtle.turnLeft()
  133.     forward()
  134.     forward()
  135.     turtle.turnRight()
  136. end
  137. Halfcircle()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement