Advertisement
Post_maphone

inspect

Nov 29th, 2020 (edited)
35
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.60 KB | None | 0 0
  1. -- local distance = ...
  2. -- if distance ~= nil then
  3. -- distance = tonumber(distance)
  4. -- for i = 1, distance do
  5. -- turtle.forward()
  6. -- while not turtle.forward() do
  7. -- turtle.dig()
  8. -- end
  9. -- end
  10. -- else
  11. -- print("you didn't specify a distance.")
  12. -- end
  13.  
  14. function mine(distance)
  15. if distance ~= nil and turtle.getFuelLevel() > (distance*2 + 150) then
  16. distance = tonumber(distance)
  17. for i = 1, distance do
  18. turtle.forward()
  19. while not turtle.detect() do
  20. turtle.dig()
  21. turtle.digUp()
  22. turtle.turnLeft()
  23. if look() == true then
  24. turtle.dig()
  25. turtle.forward()
  26. turtle.digUp()
  27. turtle.back()
  28. turtle.turnRight()
  29. end
  30. end
  31. end
  32. turtle.turnLeft()
  33. turtle.turnLeft()
  34. for i = 1, distance do
  35. turtle.forward()
  36. end
  37. else
  38. print("add a valid distance or input more coal.")
  39. end
  40. end
  41.  
  42.  
  43. function Oremining()
  44.  
  45. end
  46.  
  47. function inspect()
  48. local success, data = turtle.inspect()
  49.  
  50. if success then
  51. return data.name
  52. end
  53. end
  54. function look()
  55. a = {"minecraft:stone","minecraft:dirt"}
  56. for i = 0, table.getn(a) do
  57. if (inspect() == a[i]) then
  58. local ore = inspect().data.name
  59. return false
  60. else return true
  61. end
  62. end
  63. end
  64. function mineOre()
  65. local ore = look().inspect().data.name
  66. print(ore)
  67. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement