Autonauts

Autonauts

30 ratings
How to have your bot do things and then replace tools
By Majin Souji
Have you wanted to have a bot that Chops tree, Mines Rocks, or farms food also go grab it's own tool? Here is how!
   
Award
Favorite
Favorited
Unfavorite
Starting Up
Starting up you want to do as you learned in the tutorial and show the bot what to do with the tool. After that set that to Repeat til Hands empty this way it will stop when the tool breaks.



Finishing Touches
Next you will want to decide are you wanting it to get the tool from a chest or from the ground. Either choice will not make much of a difference.

If you want to get it off the ground just go over and pick up the tool to show the bot then have that repeat on Repeat til hands are full after you have that set both repeat sections in another repeat bracket and keep it on repeat forever.


Now if you want to use a chest then instead of picking the tool off the ground just go get it from the chest you want to have the bot go to. After that it is same as before with setting it on repeat on Repeat til hands are full after you have that set both repeat sections in another repeat bracket and keep it on repeat forever.

21 Comments
Shogal May 17, 2024 @ 12:46pm 
repeat (forever) {
... repeat (until hands empty) {
...... *** use tool ***
... }
... retreive
... repeat (until hands full) {
...... go to toolbox
...... grab from toolbox
...... stow held item
... }
}
Rivet Nobara Sep 3, 2023 @ 12:16pm 
i usually tend to do

if (hands empty) {
go to tool box
repeat (until hands full) {
grab from toolbox
store held item
}
}
repeat(until hands empty) {
repeat(until hands empty) {
*actual tool use here*
}
retrieve
}

and then repeat forever around that, and for simple things like chopping wood or mining, it should end up at 12 bytes
once i get mk1 robots and upgrades, i pretty much keep it exactly like this more or less to the end of the mk2 phase, excluding tree chopping having a threshold set via repeat until storage < X percent after each tool use (13 bytes), so that way it grabs first thing, stuffs any sized backpack, and then keeps one in hand alongside the full backpack, and then the tree choppers will stop temporarily once the log stockpile hits the threshold, as they can work with no regards to the surrounding supply unlike stone and clay
Jaryd Jan 27, 2023 @ 9:35am 
You can future proof this for when you have bots with a backpack, add a "Retreive" inbetween the two loops and add a "Put into backpack" at the end into the Until hands full loop. So your bot will have an extra tool on hand when his first breaks
Lou :) Jan 22, 2023 @ 1:59pm 
I have a quick question and i cant seem to figure it out, how do i get one robot to do multiple task example: (collect 1 pick axe (if hands is empty), (repeat)(Until hands is empty)then mine stone x6, stow it, then collect stone x6, and place in storage box,retrieve pick axe ) seems fine but the problem is he keeps collecting pick axe after i specifically say only when hand is empty how do i fix it ?
Psylem Apr 25, 2020 @ 1:02am 
Although in this case "Until hands full" is not required as some people commented, it's still good practice to include it if you have room. It's possible that the box may be busy or empty when the bot tries to "take from" and you don't always want to continue until the tool has been collected. I also like Ozyton's idea of allowing use of backpacks as soon as you can which is a great example of why you might as well add the second loop straight away.
redpepper Apr 8, 2020 @ 1:59pm 
@Xango2000 Two things:
1. Why would you specifically want to keep your bot count down? You can always make more, and the first- and second- leveled bots aren't very expensive.
2. I never thought to have my bots with extra space just go and recharge other bots. I just made two teams of designated bots for that, and two bots that just parade around with signs that the charging bots are linked to. Cool use of memory.
Xango2000 Feb 29, 2020 @ 7:04pm 
or if you really want to get fancy, have the bot make the new tool itself... which could be handy if you are trying to keep your bot count down.

also, bots that have extra memory space can be set to recharge bots (with cancel on fail)
Zulban Feb 23, 2020 @ 8:48pm 
I know this is a bit old but I figure I'd throw in my two cents. As soon as you upgrade your bots they get backpack space, at which point having the two loops become useful. Put a 'store item' at the end of the tool grabbing loop and 'retrieve item' at the end of the use tool loop. Doing it this way means the bots will carry spare tools with them which saves trips to the toolbox, meaning they spend more time actually working.
Eclectic Inventor Feb 12, 2020 @ 2:39pm 
You don't need the second loop. Just set the first to while hands full. Once that is false it will go grab a tool and return to the 2nd loop.
🖤omegamäään Ω Nov 10, 2019 @ 3:02am 
worked