Bimgo

chopper

Mar 30th, 2013
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. print( "Mettre des barrels/chests dans le Slot 1..." )
  2. print( "...un stack de sappling dans le Slot 2" )
  3. print( "...du Bonemeal dans le slot 3")
  4. print( "Appuyer une touche pour continuer..." )
  5. os.pullEvent("char")
  6.  
  7. lvl = 1
  8.  
  9. turtle.digDown()
  10. turtle.select(1)
  11. turtle.placeDown()
  12.  
  13. local function ascend()
  14. turtle.up()
  15. lvl = lvl + 1
  16. end
  17. local function descend()
  18. turtle.down()
  19. lvl = lvl - 1
  20. end
  21. local function grow()
  22. turtle.select(2)
  23. turtle.place()
  24. turtle.select(3)
  25. turtle.place()
  26. -- ascend()
  27. end
  28. local function chop()
  29. turtle.select(4)
  30. turtle.dig()
  31. turtle.forward()
  32. while turtle.detectUp() == true do
  33. print("lvl"..lvl)
  34. -- read()
  35. turtle.digUp()
  36. ascend()
  37. end
  38. print("lvl "..lvl.." max")
  39. while lvl > 1 do
  40. while turtle.detectDown() == true do
  41. print("detect down")
  42. turtle.digDown()
  43. end
  44. while turtle.detectDown() == false do
  45. descend()
  46. end
  47. end
  48. turtle.back()
  49. end
  50. local function unload()
  51. for i = 4, 16 do
  52. turtle.select(i)
  53. turtle.dropDown()
  54. end
  55. end
  56.  
  57. for t = 1, 64 do
  58. grow()
  59. chop()
  60. unload()
  61. end
Advertisement
Add Comment
Please, Sign In to add comment