Advertisement
Guest User

minasegu

a guest
Jun 30th, 2015
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.72 KB | None | 0 0
  1.  
  2. --No siguis maricon i paga pel programa cabron
  3.  
  4. function clc()
  5.     term.clear()
  6.     term.setCursorPos(1,1)
  7. end
  8.  
  9. function tup()
  10.     while turtle.up() == false  do
  11.         turtle.digUp()
  12.         turtle.attackUp()
  13.     end
  14. end
  15.  
  16. function tdn()
  17.     while turtle.down() == false do
  18.         turtle.digDown()
  19.         turtle.attackDown()
  20.     end
  21. end
  22.  
  23. function trt()
  24.     turtle.turnRight()
  25.     while turtle.forward() == false do
  26.         turtle.dig()
  27.         turtle.attack()
  28.     end
  29. end
  30.  
  31. function tlt()
  32.     turtle.turnLeft()
  33.     while turtle.forward() == false do
  34.         turtle.dig()
  35.         turtle.attack()
  36.     end
  37. end
  38.  
  39. function tfd()
  40.     while turtle.forward() == false do
  41.         turtle.dig()
  42.         turtle.attack()
  43.     end
  44. end
  45.  
  46. function tbk()
  47.     if turtle.back() == false then
  48.         turtle.turnRight(2)
  49.         while turtle.forward() == false do
  50.             turtle.dig()
  51.             turtle.attack()
  52.         end
  53.         turtle.turnRight()
  54.         turtle.turnRight()
  55.     else
  56.     end
  57. end
  58.  
  59. function cup()
  60.     turtle.select(1)
  61.     if turtle.compareUp() == false then
  62.         turtle.select(2)
  63.         while turtle.placeUp() == false do
  64.             turtle.digUp()
  65.             turtle.attackUp()
  66.         end
  67.     else
  68.     end
  69. end
  70.  
  71. function cfd()
  72.     turtle.select(1)
  73.     if turtle.compare() == false then
  74.         turtle.select(2)
  75.         while turtle.place() == false do
  76.             turtle.dig()
  77.             turtle.attack()
  78.         end
  79.     else
  80.     end
  81. end
  82.  
  83. function cdn()
  84.     turtle.select(1)
  85.     if turtle.compareDown() == false then
  86.         turtle.select(2)
  87.         while turtle.placeDown() == false do
  88.             turtle.digDown()
  89.             turtle.attackDown()
  90.         end
  91.     else
  92.     end
  93. end
  94.  
  95.  
  96. clc()
  97. write('Distancia del tunel? ')
  98. x = read()
  99. j = 0
  100. clc()
  101. print('Tunel en progres :)...')
  102. print()
  103. print()
  104. print('<                         >')
  105. term.setCursorPos(13,5)
  106. print('0%')
  107.  
  108. for i=1,x-1 do
  109.     if j%11 == 0 then
  110.         turtle.turnRight()
  111.         turtle.turnRight()
  112.         turtle.select(16)
  113.         turtle.place()
  114.         turtle.select(1)
  115.         turtle.turnRight()
  116.         turtle.turnRight()
  117.     elseif (j-5)%11 == 0 then
  118.         turtle.turnRight()
  119.         turtle.turnRight()
  120.         turtle.select(16)
  121.         turtle.place()
  122.         turtle.select(1)
  123.         turtle.turnRight()
  124.         turtle.turnRight()
  125.     end
  126.     j = j+1
  127.     tfd()
  128.     cdn()
  129.     cfd()
  130.     tup()
  131.     cfd()
  132.     tup()
  133.     cfd()
  134.     cup()
  135.     tlt()
  136.     cfd()
  137.     cup()
  138.     turtle.turnRight()
  139.     cfd()
  140.     tdn()
  141.     cfd()
  142.     turtle.turnLeft()
  143.     cfd()
  144.     tdn()
  145.     cfd()
  146.     cdn()
  147.     turtle.turnRight()
  148.     cfd()
  149.     turtle.turnRight()
  150.     tfd()
  151.     tfd()
  152.     cfd()
  153.     cdn()
  154.     turtle.turnLeft()
  155.     cfd()
  156.     tup()
  157.     cfd()
  158.     turtle.turnRight()
  159.     cfd()
  160.     tup()
  161.     cfd()
  162.     cup()
  163.     turtle.turnLeft()
  164.     cfd()
  165.     turtle.turnLeft()
  166.     tfd()
  167.     turtle.turnRight()
  168.     tdn()
  169.     tdn()
  170.    
  171.     p = (i/x-(i/x)%0.0001)*100
  172.     term.setCursorPos(13,5)
  173.     n = tostring(p)
  174.     term.clearLine()
  175.     print(n .. '%')
  176.     term.setCursorPos(2,4)
  177.     while p>4 do
  178.         p = p-4
  179.         write('=')
  180.     end
  181. end
  182.  
  183. term.setCursorPos(13,5)
  184. term.clearLine()
  185. print('100%')
  186. print()
  187. print('Feina feta.')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement