jcoutie

Skyscraper Capper

Jan 25th, 2014
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.99 KB | None | 0 0
  1. height = 0
  2. turtle.select(1)
  3. term.clear()
  4. term.setCursoerPos(1,1)
  5. print("Ready to cap off shafts!")
  6. print()
  7. print()
  8. print("Please ensure building material is in Slot 1")
  9. print("Place torches in Slot 16")
  10. print()
  11. print("Press any key to continue")
  12. read("input")
  13.  
  14. local function tMove(dist)
  15.   for i=1,dist do
  16.     while turtle.forward() == false do
  17.       turtle.attack()
  18.       turtle.dig()
  19.       sleep(0.5)
  20.     end
  21.   end
  22. end
  23.  
  24. --Main
  25. turtle.turnLeft()
  26. while turtle.detect() == true do
  27.   while turtle.up() == false do
  28.     turtle.digUp()
  29.     turtle.attackUp()
  30.     sleep(0.5)
  31.   end
  32.   height = height + 1
  33. end
  34. turtle.turnRight()
  35. for i=1,4 do
  36.   tMove(6)
  37.   turtle.turnLeft()
  38.   tMove(6)
  39.   turtle.placeDown()
  40.   turtle.select(16)
  41.   turtle.place()
  42.   turtle.select(1)
  43.   turtle.turnRight()
  44.   turtle.turnRight()
  45. end
  46. for i=1,height do
  47.   while turtle.down() == false do
  48.     turtle.attackDown()
  49.     turtle.digDown()
  50.     sleep(0.5)
  51.   end
  52. end
  53. turtle.turnRight()
  54. turtle.turnRight()
Advertisement
Add Comment
Please, Sign In to add comment