HandyHands - Automatic handcrafting

by Qon

Automatically start handcrafting an item that is quickbar filtered (or in logistics requests) that you don't have enough of whenever your crafting queue is empty. Prioritises items in your cursor and what you need the most. It's like having logistics deliveries for early game!

Utilities
3 years ago
0.13 - 1.1
9.31K

g [Resolved] Update for 0.17?

5 years ago

Changing the info.json file doesn't work this time :(

5 years ago

I'm too attached to this add-on to let it go, so I've changed it to work with the player inventory instead of the quickbar. To do that, edit the control.lua (control (2).lua too if you have it)

Look for the line that says

local qb = p.get_quick_bar()

and change it to

local qb = p.get_main_inventory()

Seems to work so far!

5 years ago

This doesn't really work for me, it only seems to craft ammo. Nothing on my quickbar gets crafted.

5 years ago
(updated 5 years ago)

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.

5 years ago

I'm going to update this mod for 0.17! I'm really happy that people enjoy this mod and still request it and crave it after 2 years with no updates. Sorry! But I'm downloading Factorio 0.17 atm. You make it worth it. I should maybe get back to playing the game too :)

5 years ago

I've updated it. Hopefully it works for everyone. Limited time means limited testing. But better than nothing (like the last 2 years) I guess.

5 years ago

Qon, thank you so much for your work and the new update works great on 0.17. Is there any way you could push an update that allows for quickbar -and- inventory autocrafting? The older version allowed for it and I really found it useful

5 years ago
(updated 5 years ago)

I forgot about that. I was gone for 2 years D:
Was it really like that?
I'll look into it.

5 years ago

Changed it! HH v1.7.2 now auto crafts anything that you have a manual crafting amount for even if it's not on your quick bar.

5 years ago

Thanks so much!

New response