Advertisement
ozozx235

pak

Dec 5th, 2022
345
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.03 KB | None | 0 0
  1. function findEmp ()
  2. for i=1,16 do
  3. if not turtle.getItemDetail(i) then
  4. return i
  5. end
  6. end
  7. end
  8. function arrComp (a,b)
  9. return textutils.serialise(a) == textutils.serialise(b)
  10. end
  11. function ObsGen ()
  12. return {
  13. {name="minecraft:cobblestone",count=24},
  14. {name="minecraft:cobblestone_slab",count=17},
  15. {name="pipez:item_pipe",count=32},
  16. {name="mekanism:ultimate_mechanical_pipe",count=20},
  17. {name="exnihilosequentia:stone_barrel",count=20},
  18. {name="minecraft:shulker_box",count=1}
  19. }
  20. end
  21. local function invTab ()
  22. local inv = {}
  23. for i=1,16 do
  24. local item = turtle.getItemDetail(i)
  25. inv[i]={idx=i,it=item}
  26. end
  27. return inv
  28. end
  29. function invItr ()
  30. local i=0
  31. inven = invTab()
  32. local n=#inven
  33. return function ()
  34.     i=i+1
  35.     if i <= n then return inven[i] end
  36.     end
  37. end
  38. function getInv ()
  39. inv = {}
  40. i=1
  41. for slot in invItr() do
  42. if slot.it then
  43. inv[i]=slot.it
  44. i=i+1
  45. end
  46. end
  47. return inv
  48. end
  49. function findI (name)
  50. for slot in invItr() do
  51. if slot.it then
  52. if slot.it.name == name then
  53. return slot.idx
  54. end
  55. end
  56. end
  57. return 0
  58. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement