Archean

Archean

27 ratings
Automatic Crafter
5
   
Award
Favorite
Favorited
Unfavorite
Blueprint: Machine, Computer
File Size
Posted
Updated
393.342 KB
30 Jun, 2024 @ 5:29am
5 Oct, 2024 @ 3:10am
13 Change Notes ( view )

Subscribe to download
Automatic Crafter

Description
Automatically crafts an item, and any items required to build it.

You can queue multiple items by pressing again, or using the x10 or x100 buttons.

Setup
Press V on the crafter and container you've already built.
- Set the name of the Crafter to "crafter" (all lower case)
- Set the name of the Container to "container" (all lower case)
- Name any connected gas tanks "tank_O2", "tank_H2", "tank_H2O", or just "tank_1"
- Connect data lines from this computer to the crafter, container and tanks

- Connect the container to both the input and output of the crafter. That way the crafter it can pull resources and store the crafted items in the container. (Use both outputs on the container or a correctly configured junction)

If you don't have separate O2 and H2 tanks, the code assumes the tank is filled with 50/50 of each.
(If you have any gas in the O2/H2-named tanks, any tank without O2/H2 in the name is ignored)

These names of the containers and tanks can be changed in the code:

var $inventories = ".a{container}.b{tank_O2}.c{tank_H2}" ;if you want, add for example .d{tankO2_2).e{tankH2_2}


UI
- You can click on any ingredient item to go to that item's crafting page.
- If an ingredient in a craft is green, you have all you need to make a single item.
- Blue indicates that the ingredient will be added to the queue. It's still possible that you won't have all the mined resources you need to complete it.
- Red indicates a mined resource that's too low to complete the craft. Add some more to the container.

-The Stop button cancels the current craft, and any queued items.

-The Queue View button shows the current items in the queue. This will be updated with more needed items as the craft progresses.

Automatic queue, maintain item level
If you add an item to the Favorites list. you can set the item to automatically craft more items until it reaches your specified level.
The auto queue is checked and orders items periodically when no other items are in the queue.
If you reset or reduce the auto level of an item, whatever is currently in the crafting queue is unaffected, so clear that manually if needed.

Sleep mode and power saving
The computer will go to sleep if it hasn't been used for 5 minutes. To wake it, just click the screen.
The time before sleep engages can be set in the "Settings & sleep" menu.

If you do a lot of auto/maintain crafting, set this to 15 or 30 minutes in order to allow all your auto crafts to top up your container after use, or disable sleep mode entirely.

If you connect a power relay named "crafter_relay" to the Crafter's High Voltage line, and connect the data cable to the computer, sleep mode will also turn off the Crafter to save power, and improve performance on the server.

While the computer is in sleep mode, it still draws power, but will do virtually no processing.

Errors
It's normal for a brief flashing "Error" message during a craft, as the missing ingredients get back filled.
If the error remains, it's likely that some mined resource is missing.

Re-use in other workshop items is OK
If you want to incorporate this into your own workshop items, please do. No need to ask for permission.
(If you build something cool, or improve upon it, feel free to tell me)

Source code
If you want the code, but don't want to spawn the blueprint, the repo is here:
https://github.com/archean-cookbook/snjo-automatic-crafter
29 Comments
wf13 6 Jun @ 2:07pm 
Can you add a router to connect more devices?
ManaWei 23 May @ 2:44am 
This computer, very smart <3 absolutely love it - This is my AutoCrafting Station that I made: https://gtm.steamproxy.vip/sharedfiles/filedetails/?id=3486163516
Hope you like it, I'm kinda new at this.
Snjo  [author] 10 May @ 12:41am 
@archifoxer Reboot the crafting computer to update any bad recipes, and check that you don't have any auto-crafts set up for plastic. I was able to craft a linear track just now. If you have a reproducible bug, contact me on the discord channel.
ArchieFoxer 7 May @ 12:20pm 
Somehow the new LinearTrack component is uncraftable.
It's in the list, but the auto crafter refuses to craft the seperate parts needed.

Also since a while it often has a problem when trying to craft huge amounts of items, for example when trying to craft 5000 composite blocks it wants to craft way more plastic than needed.
Once we accidently filled a whole container with capacitators because we tried to craft 50 batteries.

Otherwise it's a really useful tool, thanks for creating it!
trucksarenoisy 26 Apr @ 9:38am 
by "it works just fine" i mean that after i made line 1 clear it worked as usual, i don't really know why it errored
trucksarenoisy 26 Apr @ 9:38am 
that's weird, it works just fine now, i guess it was a fluke
Snjo  [author] 26 Apr @ 9:11am 
@trucksarenoisy could you explain more? I see no errors on my source build. Message me on discord if you're on the archean discord.
trucksarenoisy 26 Apr @ 5:01am 
new update added a weird bug... the first line in each file needs to be clear otherwise it bugs out?
A Terrible Modder 19 Apr @ 4:12am 
works great even on the latest version
wf13 9 Jan @ 9:29pm 
@Snjo it works with many crafters, have hooked up 10