Advertisement
Win4Win

YHebyDCYTd

Sep 30th, 2023 (edited)
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.59 KB | None | 0 0
  1. local chest = peripheral.wrap('bottom')
  2. local chest2 = peripheral.wrap('top')
  3. local slotList = {3, 5, 6, 7, 9, 10, 11}
  4. turtle.select(1)
  5.  
  6. function reset()
  7. for i = 2, 16 do
  8. local info = turtle.getItemDetail(i)
  9. if info and info.name == 'minecraft:redstone_block' then
  10. turtle.select(i)
  11. turtle.dropDown()
  12. elseif info and info.name == 'minecraft:nether_star' then
  13. turtle.select(i)
  14. turtle.dropUp()
  15. end
  16. end
  17. turtle.select(1)
  18. end
  19.  
  20. function find(id, inv)
  21. for i = 1, 27 do
  22. local meta = inv.getItemMeta(i)
  23. if meta and meta.name == id then
  24. return i
  25. end
  26. end
  27. return false
  28. end
  29.  
  30. while true do
  31. reset()
  32. local star = find('minecraft:nether_star', chest2)
  33. local reds = find('minecraft:redstone_block', chest)
  34. local book = turtle.getItemDetail(1)
  35. if star and book and book.damage < 744 then
  36. chest2.pushItems('down', star)
  37. print(turtle.craft())
  38. chest2.pullItems('down', 2, 1)
  39. turtle.select(2)
  40. turtle.drop()
  41. turtle.select(1)
  42. end
  43. if reds then
  44. chest.pushItems('up', reds, 8)
  45. local redsCount = turtle.getItemCount(2)
  46. turtle.select(2)
  47. if redsCount > 1 then
  48. for _, i in pairs(slotList) do
  49. turtle.transferTo(i, 1)
  50. if _ == redsCount - 1 then
  51. break
  52. end
  53. end
  54. end
  55. turtle.select(1)
  56. turtle.craft()
  57. end
  58. end
  59.  
  60. --Tome from reliquary
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement