Advertisement
Jeyjey0

back (computercraft)

Apr 19th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. os.loadAPI("mine")
  2. os.loadAPI("bridge")
  3. os.loadAPI("torch")
  4.  
  5. function clear()
  6. drop = true
  7. for i=1,16 do
  8. turtle.select(i)
  9. count = turtle.getItemCount()
  10. if count > 0 then
  11. local item = turtle.getItemDetail()
  12. if item.name == "minecraft:torch" then
  13. drop = false
  14. end
  15. end
  16. if drop then
  17. turtle.drop()
  18. else drop = true
  19. end
  20. end
  21. end
  22. function back(shaftnum)
  23. print("Go back...")
  24. while not turtle.up() do
  25. turtle.digUp()
  26. end
  27. turtle.turnLeft()
  28. turtle.turnLeft()
  29. for i=1,shaftnum*3 do
  30. mine.mine2()
  31. end
  32. while not turtle.down() do
  33. turtle.digDown()
  34. end
  35. clear()
  36. end
  37. function backandreturn(shaftnum)
  38. print("Go back...")
  39. while not turtle.up() do
  40. turtle.digUp()
  41. end
  42. turtle.turnLeft()
  43. turtle.turnLeft()
  44. for i=1,shaftnum*3 do
  45. mine.mine2()
  46. end
  47. while not turtle.down() do
  48. turtle.digDown()
  49. end
  50. clear()
  51. print("Go back...")
  52. while not turtle.up() do
  53. turtle.digUp()
  54. end
  55. turtle.turnLeft()
  56. turtle.turnLeft()
  57. for i=1,shaftnum*3 do
  58. mine.mine2()
  59. end
  60. while not turtle.down() do
  61. turtle.digDown()
  62. end
  63. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement