So, I'm facing a weird program stop that is making no sense to me what so ever. The program:
debug = true
m = peripheral.wrap("right");
craftSources = {
{
ID = 1,
craftTargets = {98, 10425}
},
{
ID = 4,
craftTargets = {1, 10425}
},
{
ID = 331,
craftTargets = {10458}
},
{
ID = 10458,
craftTargets = {256, 266}
}
}
while 0 ~= 1 do
for i, craftSource in pairs(craftSources) do
for j, craftTarget in pairs(craftSource["craftTargets"]) do
items = m.listItems()
if (items[craftSource["ID"]] ~= nil and (items[craftTarget] == nil or items[craftSource["ID"]] > items[craftTarget])) then
if debug then print("Crafting "..craftTarget) end
pcall(m.craft, craftTarget, 1)
sleep(1)
end
end
end
end
I'm using MiscPeripherials to try and get my AE system to precraft some of the items that take time to craft (such as smooth stone and the like), while still keeping some of the source material (such as cobblestone).
It works, correctly identifying what needs to be crafted, but after a random number of iterations, the program stops, with no error message. Since I have what should be an infinite loop on the outside, I'm a bit confused as to why it's stopping.
I am still running Minecraft 1.52, and CC 1.53, as some of the mods that I use have not yet updated to 1.6.
Any thoughts would be appreciated.