Autonauts

Autonauts

View Stats:
test Nov 5, 2019 @ 9:32am
Help with programming
Hi,

Long story short. I had a robot take a log from the log storage and chop it into planks.

I wanted to make it do that until the plank storage was full and then stop but then start working again when the plank storage wasnt full anymore.

Thought that by setting "repeat until ? is full" would make it restart working but that didnt work and then I added a repeat forever on top of everything but that didnt work either.

Is it possible to do what I want?

This is my last attempt
https://imgur.com/tu9JUQF

EDIT: What im ultimately trying to do is to make is so that my robots wont craft things more than necessary and try to keep stull clean/neat/organized somewhat.
Last edited by test; Nov 5, 2019 @ 9:51am
< >
Showing 1-6 of 6 comments
Ice Koobs Nov 5, 2019 @ 9:56am 
Hi, I'll be moving this post to Coding and General Help, if you need to reply to anything on here you'll need to log into your account that owns Autonauts.
auchmithie Nov 5, 2019 @ 10:03am 
Not sure if this helps, but this is my plank maker that stops when planks are full and restarts when when needed


https://steamcommunity.com/sharedfiles/filedetails/?id=1906954872
Maxi Nov 5, 2019 @ 11:48am 
just add forever loop after the loop of do it until storage is full.
test Nov 5, 2019 @ 9:21pm 
Originally posted by Ice Koobs:
Hi, I'll be moving this post to Coding and General Help, if you need to reply to anything on here you'll need to log into your account that owns Autonauts.

Uhm .... ok



Originally posted by auchmithie:
Not sure if this helps, but this is my plank maker that stops when planks are full and restarts when when needed


https://steamcommunity.com/sharedfiles/filedetails/?id=1906954872

Thank you, I will try this.
TheBeardyMan Nov 6, 2019 @ 12:45am 
Your original code:

Repeat forever:
..Repeat until Plank storage full:
....Move to Log storage 1
....Take from Log storage 1
....Move to Chopping Block 1
....Add to Chopping Block 1

should work provided that you have another bot taking the planks to the plank storage.

But even a Mk0 bot's 12 instruction memory is enough for a bot to make the planks and take them to the storage itself:

Repeat forever:
..Move to Log storage 1
..Take from Log storage 1
..Move to Chopping Block 1
..Add to Chopping Block 1
..Repeat until Chopping Block 1 empty:
....Find nearest Plank in Chopping Block 1
....Move to Plank
....Pick up Plank
....Move to Plank storage
....Add to Plank storage

There's no need for the bot to check the state of the plank storage to determine when to stop work - when it tries to add a plank to a full storage, it will wait at that point in its script until a plank is removed from the storage to make room.
test Nov 6, 2019 @ 2:50am 
Originally posted by TheBeardyMan:
should work provided that you have another bot taking the planks to the plank storage.

I did have another bot doing that but bot making the planks would stop once it was full and never start again even tho the planks in there were being used up.

Originally posted by TheBeardyMan:
But even a Mk0 bot's 12 instruction memory is enough for a bot to make the planks and take them to the storage itself:

Repeat forever:
..Move to Log storage 1
..Take from Log storage 1
..Move to Chopping Block 1
..Add to Chopping Block 1
..Repeat until Chopping Block 1 empty:
....Find nearest Plank in Chopping Block 1
....Move to Plank
....Pick up Plank
....Move to Plank storage
....Add to Plank storage

There's no need for the bot to check the state of the plank storage to determine when to stop work - when it tries to add a plank to a full storage, it will wait at that point in its script until a plank is removed from the storage to make room.

Yeah thats what I attempted to do once but ran out of memory, must've messed something up.

Thank you, ill will definitely try this!
Last edited by test; Nov 6, 2019 @ 2:51am
< >
Showing 1-6 of 6 comments
Per page: 1530 50