I think something like this would fix the problem with moving the items from the seablock rock chest. At least, it works for me
function moveSeablockChest(event)
-- tiny hack to work around that SeaBlock sets up stuff after BNW on load
if global.seablocked then
return
end
local surface = game.surfaces["nauvis"]
if not surface then
return
end
-- move everything from the Home rock to the other chest
local home_rock = surface.find_entity("rock-chest", {0.5, 0.5})
if not home_rock then
return
end
for name, count in pairs(home_rock.get_inventory(defines.inventory.chest).get_contents()) do
global.seablock_chest.insert{name = name, count = count}
end
home_rock.destroy()
global.seablock_chest = nil
-- unregister handler
script.on_nth_tick(10, nil)
global.seablocked = true
end
script.on_nth_tick(10, moveSeablockChest)