Guest User

makeitflat

a guest
Apr 25th, 2015
304
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. length = 5
  2.  
  3. width = 4
  4.  
  5. height = 2
  6.  
  7. a = turtle.getFuelLevel()
  8.  
  9. b = length * width * 2 * hoch + width + height
  10.  
  11. function walk()
  12. if turtle.forward() == false then
  13. while turtle.detect() do
  14. turtle.dig()
  15. sleep(0.5)
  16. end
  17. while turtle.forward() == false do
  18. turtle.attack()
  19. end
  20. end
  21. end
  22.  
  23. function line()
  24. for i=1,length,1 do
  25. walk()
  26. end
  27. end
  28.  
  29. function level()
  30. for y=1,width,1 do
  31. line()
  32. turtle.turnRight()
  33. walk()
  34. turtle.turnRight()
  35. line()
  36. turtle.turnLeft()
  37. walk()
  38. turtle.turnLeft()
  39. end
  40. end
  41.  
  42. if turtle.getFuelLevel() > b then
  43. print " program is running "
  44. for x=1,height,1 do
  45. turtle.turnLeft()
  46. turtle.place()
  47. level()
  48. turtle.turnLeft()
  49. while not turtle.detect() do
  50. turtle.forward()
  51. end
  52. turtle.dig()
  53. turtle.turnRight()
  54. turtle.up()
  55. end
  56. else
  57. print . . b - a . . " fuel are remaining "
  58. end
Advertisement
Add Comment
Please, Sign In to add comment