Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Revised with ChatGPT 3.5
- -- Modified to re-add the pruned while loop
- local chest = peripheral.wrap("left")
- chest.condenseItems()
- local conversionTable = {
- stone = {target = "blankSlate", sleepTime = 5},
- blankSlate = {target = "reinforcedSlate", sleepTime = 7},
- reinforcedSlate = {target = nil, sleepTime = 8}
- }
- function convertTo(targetBlock, sleepTime)
- while true do
- local found = false
- for i = 1, 27 do
- local slot = chest.getStackInSlot(i)
- if slot and slot.name == targetBlock then
- print("Converting "..slot.name.." to "..targetBlock.." in slot "..i)
- chest.pushItem("down", i, 1)
- sleep(sleepTime)
- found = true
- break
- end
- end
- if not found then
- break
- end
- end
- end
- for _, conversionInfo in pairs(conversionTable) do
- convertTo(conversionInfo.target, conversionInfo.sleepTime)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement