Advertisement
Computer_Craft_Coder

My Untested Mining Turtle (LUA)

Aug 6th, 2013
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.79 KB | None | 0 0
  1. --[[ Advanced Rabbit Miner ]]--
  2.  
  3. TIRACM = WFAC
  4.  
  5. --[[ Functions ]]--
  6.  
  7. function shouldRefuel()
  8. if turtle.getFuelLevel() < 64 then
  9. print("Refueling, Please Wait a Minute...")
  10. sleep(2)
  11. turtle.refuel( 10 )
  12. print("Turtle Refueled!")
  13. sleep(1)
  14. TIRACM = true
  15. end
  16.  
  17. function storeItems()
  18. turtle.select(1)
  19. turtle.dropUp()
  20. turtle.select(2)
  21. turtle.dropUp()
  22. turtle.select(3)
  23. turtle.dropUp()
  24. turtle.select(4)
  25. turtle.dropUp()
  26. turtle.select(5)
  27. turtle.dropUp()
  28. turtle.select(6)
  29. turtle.dropUp()
  30. turtle.select(7)
  31. turtle.dropUp()
  32. turtle.select(8)
  33. turtle.dropUp()
  34. turtle.select(9)
  35. turtle.dropUp()
  36. turtle.select(10)
  37. turtle.dropUp()
  38. turtle.select(11)
  39. turtle.dropUp()
  40. turtle.select(12)
  41. turtle.dropUp()
  42. turtle.select(13)
  43. turtle.dropUp()
  44. turtle.select(14)
  45. turtle.dropUp()
  46. turtle.select(15)
  47. end
  48.  
  49. function goUp()
  50. if TIRACM = false then
  51. print("Going Up!")
  52. shouldRefuel()
  53. while TIRACM = false do
  54. turtle.up()
  55. if TIRACM = WFAC then
  56. print("Im Back!")
  57. print("Storing Items In The Chest!")
  58. sleep(2)
  59. storeItems()
  60. end
  61.  
  62. function checkTIRACM(false) -- When The Turtle Hits Bedrock, This Will Be Executed
  63. if turtle.down() == false then
  64. TIRACM = false
  65. end
  66.  
  67. function checkTIRACM(WFAC) -- When The Turtle Hit's The Chest This Will Be Executed
  68. if turtle.up() == false then
  69. TIRACM = WFAC
  70. end
  71.  
  72. function goDown()
  73. shouldRefuel()
  74. print("Going Down!")
  75. while TIRACM = true do
  76. turtle.digDown()
  77. turtle.Down()
  78. end
  79. end
  80. end
  81. end
  82.  
  83.  
  84. --[[ Code ]]--
  85.  
  86. N = "Side-Kick"
  87. V = "1.0"
  88.  
  89. print(N)
  90. print(V)
  91. print("---------------------")
  92. print("Want Me To Go Mining?")
  93. write("(y/n): ")
  94.  
  95. input = read()
  96.  
  97. if input == "y" or then
  98. shouldRefuel()
  99. elseif input == "n" then
  100. os.shutdown()
  101. else
  102. print("Sorry I Dont Understand Your Command.")
  103. print("Try: y or n (Its Case Sensitve!)")
  104. sleep(1)
  105. end
  106. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement