Advertisement
LostMiner

Untitled

Oct 28th, 2016
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ------Tunneling Automaton - V2------
  2.  
  3. ----Variables----
  4.  
  5. t = turtle
  6.  
  7. ----Basic Controls----
  8.  
  9. function digForward()
  10.     t.digForward()
  11. end
  12. function moveForward()
  13.     t.forward()
  14. end
  15. function goForward()
  16.     if t.detect() then
  17.         digForward()
  18.         moveForward()
  19.     else
  20.         moveForward()
  21.     end
  22. end
  23.  
  24. function length()
  25.     num = t.getItemCount(2)
  26.     return num
  27. end
  28.  
  29. function refuel()
  30.     t.select(1)
  31.     t.refuel(1)
  32. end
  33.  
  34. ----Bridge----
  35.  
  36. function bridge()
  37.     t.select(2)
  38.     num = length()
  39.     while num > 0 do
  40.         goForward()
  41.         t.placeDown()
  42.         num = num - 1
  43.     end
  44. end
  45.  
  46. ----Main----
  47. function main()
  48.     refuel()
  49.     bridge()
  50. end
  51.  
  52. --Run--
  53. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement