Advertisement
Guest User

Untitled

a guest
Apr 30th, 2016
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. function forward(number)
  2. for i=1, number do
  3. if turtle.detect() then
  4. turtle.dig()
  5. end
  6. turtle.forward()
  7. if turtle.detectUp() then
  8. turtle.digUp()
  9. end
  10. if turtle.detectDown() then
  11. turtle.digDown()
  12. end
  13. end
  14. end
  15.  
  16. function MoveDown(local numberTiles)
  17. for i=1, numberTiles do
  18. if turtle.detectDown() then
  19. turtle.digDown()
  20. end
  21. turtle.down()
  22. end
  23. end
  24.  
  25. write("How wide is the room?")
  26. local width = tonumber(read())
  27. local halfwidth = width/2
  28. write("How long is the room?")
  29. local length = tonumber(read())
  30. turtle.turnLeft()
  31. forward(halfwidth)
  32. turtle.turnRight()
  33. for i=1, halfwidth do
  34. forward(length)
  35. turtle.turnRight()
  36. if turtle.detect() then
  37. turtle.dig()
  38. forward(1)
  39. turtle.turnRight()
  40. forward(length)
  41. turtle.turnLeft()
  42. forward(1)
  43. turtle.turnLeft()
  44. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement