I finally got it working! If you change lines 98-104 of control.lua to this it works for me (sorry for bad Lua code):
local list = {}
local list_i = 1
for q=1,2 do
local page = p.get_active_quick_bar_page(q)
if page ~= nil then
for i=1,10 do
local qbitem = p.get_quick_bar_slot(page*10+i)
if qbitem ~= nil then
list[list_i] = qbitem.name
list_i = list_i + 1
end
end
end
end
if p.character then
-- ab: ammoo bar. All non-empty stacks are autocrafting candidates.
local ab = p.get_inventory(defines.inventory.player_ammo)
for i=1,#ab do
if ab[i].valid_for_read then
list[list_i] = ab[i].name
list_i = list_i + 1
end
end
end
for item_i=1,#list do
item = list[item_i]
Also remove lines 89 and 90.
Ideally the for q=1,2
should go up to the number of visible quickbars, but I'm not sure how to get that setting.