Advertisement
kovakovi2000

CC: PA - Time wand mover

Jun 16th, 2025
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.99 KB | None | 0 0
  1. local chest = peripheral.wrap("top")  -- or the side it's on, e.g., "top", "left", etc.
  2. local machine = peripheral.wrap("bottom")  -- or the side it's on, e.g., "back", "right", etc.
  3. local numberOfMachine = 5
  4.  
  5. local processingTimeInTick = numberOfMachine * 8 * 2
  6. local processingTimeInSeconds = processingTimeInTick / 20  -- Convert ticks to seconds
  7. local rechargeTimeInSeconds = 1  -- Time to recharge the machine
  8. local totalProcessingTimeInSeconds = processingTimeInSeconds + rechargeTimeInSeconds
  9. -- Main loop
  10.  
  11. machine.pushItems(peripheral.getName(chest), 1)
  12. while true do
  13.   local items = chest.list()
  14.  
  15.   for slot, item in pairs(items) do
  16.     local details = chest.getItemDetail(slot, true)
  17.     if details and details.nbt and string.sub(details.nbt, 1, 8) == "866815d7" then
  18.       chest.pushItems(peripheral.getName(machine), slot)
  19.       sleep(totalProcessingTimeInSeconds)  -- Wait for the machine to process the item
  20.       machine.pushItems(peripheral.getName(chest), 1)
  21.     end
  22.   end
  23. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement