Advertisement
zPandro

orbHandler 1.0

Jul 5th, 2021
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. local SLOT_COUNT = 16
  2. local E_Orb = peripheral.wrap("bottom")
  3.  
  4. function getItemIndex(itemName)
  5. for slot = 1, SLOT_COUNT, 1 do
  6. local item = turtle.getItemDetail(slot)
  7. if(item ~= nil) then
  8. if(item["name"] == itemName) then
  9. return slot
  10. end
  11. end
  12. end
  13. return 17
  14. end
  15.  
  16.  
  17. function dropBlazeRods(orb)
  18. bRods = orb.getItemDetail(2)
  19. if(bRods == nil) then
  20. turtle.dropDown(1)
  21. end
  22. end
  23.  
  24. function handleBlazeRods()
  25. brod_slot = getItemIndex("minecraft:blaze_rod")
  26. if (brod_slot < 17) then
  27. turtle.select(brod_slot)
  28. dropBlazeRods(E_Orb)
  29. else
  30. turtle.suckUp()
  31. end
  32. end
  33.  
  34. function handleCrystals()
  35. bcrystal_slot = getItemIndex("powah:crystal_blazing")
  36. if (bcrystal_slot < 17) then
  37. turtle.select(bcrystal_slot)
  38. turtle.dropUp()
  39. end
  40. end
  41.  
  42. while true do
  43. turtle.suckDown()
  44. handleBlazeRods()
  45. handleCrystals()
  46. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement