Advertisement
Chatenium

Untitled

Jul 9th, 2023 (edited)
19
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.47 KB | None | 0 0
  1. sortProgressItem = 1
  2. function sortItems()
  3. data = turtle.getItemDetail(sortProgressItem)
  4. print(sortProgressItem)
  5. if data then
  6. if (data.name ~= "minecraft:iron_ingot") then
  7. turtle.select(sortProgressItem)
  8. turtle.dropDown()
  9. end
  10. print(data.name)
  11. else
  12. print("No item")
  13. end
  14. sortProgressItem = sortProgressItem + 1
  15. if(sortProgressItem == 17) then
  16. print("done")
  17. else
  18. sortItems()
  19. end
  20. end
  21.  
  22. function goToStartLocation()
  23. print("Start position")
  24. print("Mennyit mennyen elore?")
  25. start_forward = tonumber(read())
  26. if start_forward == nil then
  27. print("Hiba! Újraindítás...")
  28. goToStartLocation()
  29. else
  30. print("Mennyit mennyen fel?")
  31. start_up = tonumber(read())
  32. if start_up == nil then
  33. print("Hiba! Újraindítás...")
  34. goToStartLocation()
  35. else
  36. print("Indulás!")
  37. moveToStart(start_forward, start_up)
  38. end
  39. end
  40. end
  41.  
  42. turtle_posForward = tonumber(0)
  43. turtle_posUp = tonumber(0)
  44.  
  45. function moveToStart(start_forward, start_up)
  46. print(start_forward)
  47. local success, data = turtle.inspect()
  48. if(turtle.posForward ~= start_forward) then
  49. if(success) then
  50. turtle.dig()
  51. turtle.forward()
  52. turtle_posForward = turtle_posForward + 1
  53. moveToStart(start_forward, start_up)
  54. else
  55. turtle.forward()
  56. turtle_posForward = turtle_posForward + 1
  57. moveToStart(start_forward, start_up)
  58. end
  59. else
  60. print("Ok, ready to go up")
  61. end
  62. end
  63.  
  64. goToStartLocation()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement