Advertisement
k2green

Essence Item Crafting

Jun 6th, 2025
10
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. local args = { ... }
  2. local drawer = peripheral.wrap("front")
  3.  
  4. local function readCount()
  5. if args[1] ~= nil then
  6. local success, count = pcall(tonumber, args[1])
  7. if success then
  8. return count
  9. end
  10. end
  11.  
  12. return 64
  13. end
  14.  
  15. local count = readCount()
  16. local condition = count * 8
  17.  
  18. local function suckSlot(slot)
  19. turtle.select(slot)
  20. turtle.suck(count)
  21. end
  22.  
  23. while true do
  24. local list = drawer.list()
  25.  
  26. if list[1] ~= nil and list[1].count >= condition then
  27. for r=0,2 do
  28. for c=0,2 do
  29. if r ~= 1 or c ~= 1 then
  30. local i = r * 4 + c
  31. suckSlot(i + 1)
  32. end
  33. end
  34. end
  35.  
  36. turtle.craft()
  37.  
  38. while not turtle.dropUp() do
  39. sleep(5)
  40. end
  41. end
  42. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement