Advertisement
temposabel

Untitled

Dec 18th, 2021
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.90 KB | None | 0 0
  1. --X0y7V6Qivb
  2.  
  3.  
  4. function tablelength(T)
  5. local count = 0
  6. for _ in pairs(T) do count = count + 1 end
  7. return count
  8. end
  9.  
  10.  
  11. function refuel()
  12. for i = 1,16 do
  13. turtle.select(i)
  14. print(turtle.getFuelLevel())
  15. if turtle.getFuelLevel() < 200 then
  16. turtle.refuel(10)
  17. end
  18. end
  19. end
  20.  
  21. intebajs = {'minecraft:diamond', 'minecraft:iron_ore', 'minecraft:gold_ore', 'minecraft:emerald', 'minecraft:obsidian', 'minecraft:coal'}
  22.  
  23. function in_list (tab, val)
  24. for index, value in ipairs(tab) do
  25. if value == val then
  26. return true
  27. end
  28. end
  29.  
  30. return false
  31. end
  32.  
  33. function throw_shit()
  34. for i = 1,16 do
  35. turtle.select(i)
  36. sname = turtle.getItemDetail()
  37. if sname then
  38. print(in_list(intebajs,sname.name))
  39. if not in_list(intebajs,sname.name) then turtle.dropDown() end
  40. end
  41. end
  42. end
  43.  
  44. function find(name)
  45. for i = 1,16 do
  46. sname = turtle.getItemDetail(i)
  47. if sname then
  48. sname = sname.name
  49. if name == sname
  50. then
  51. return i
  52. end
  53. end
  54. return false
  55. end
  56.  
  57. function findnextslot()
  58. for i = 1,16 do
  59. if turtle.getItemCount(i) ~= 0 then return i
  60. end
  61. end
  62. end
  63.  
  64. function mine()
  65. turtle.digDown()
  66. if turtle.select(find("minecraft:dirt")) then
  67. turtle.placeDown()
  68. end
  69. suc = turtle.forward()
  70. return suc
  71. end
  72.  
  73.  
  74. function walk (len)
  75. x = 0
  76. while x < len do
  77. if mine() then x = x + 1 end
  78. end
  79. end
  80.  
  81. local x = 0
  82. local y = 0
  83.  
  84. while true do
  85. if turtle.inspect() then
  86. print("hittade block x its:" .. x)
  87. turtle.turnRight()
  88. break
  89. end
  90. walk(1)
  91. x = x+1
  92. end
  93.  
  94. while true do
  95. if turtle.inspect() then
  96. print("hittade block y its: " .. y)
  97. turtle.turnRight()
  98. break
  99. end
  100. walk(1)
  101. y = y+1
  102. end
  103.  
  104.  
  105.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement