Autonauts Wiki
Advertisement

This article is a stub. You can help Autonauts Wiki by expanding it.

Programming is one of the key elements of Autonauts. All tasks can be automated with the help of programming Bots. It is done through a "learning by following" system. To program a bot, you click its record button in the bot's menu, perform the tasks you want it to repeat, and then press play or stop. (Play to get it to run now, stop to save and run later).

Programming in Autonauts uses block-based visual programming principles. There are basic commands like move, pick up and drop, and also repeat loops and conditional statements to use. When in recording mode, an Extra Instructions tab appears at the bottom right of the script panel.

As you start out, what you can do with one bot will be limited by the size of the bot's memory. As you upgrade your bots, more memory will be available to make more complex programs. There are also upgrades that you can give your bots to enhance their memory, although only one memory expansion can be installed at a time. There are also some Programming Tricks that can help reduce the size of a program to fit in less memory.

Base code blocks[ | ]

Command Type key Result
Find nearest Stick in [ ]
find Look for an item in a specified area or at a specified structure. Reserves found item and sets it as "target" for instructions that follow this block.
    • NOTE**; this "find" command isn't showing up ANYWHERE in the list of available commands...
Unreserve
unreserve Removes reservation on the previously found item. It can be still used as a "target".
Shout
Go!
world interaction z Shout (other bots can have the "Listen" command and act upon shouts). Start the text with # to get a message when the bot shouts.
Use held item
world interaction Use the item held in the first hand slot[1]
Set Output To Crude Axe
object interaction Change the active recipe on a crafting station
Engage Crude Wheelbarrow
object interaction Engage with an object (only applicable for workbenches, stations, carts, and wheelbarrows)
Disengage
object interaction Disengage the object (see above)
Recharge bot
object interaction Recharge a bot that has run out of energy
Cycle held item down
backpack interaction . Cycle items in the bot's inventory
Cycle held item up
backpack interaction , Cycle items in the bot's inventory
Retrieve
backpack interaction q Retrieve item from the backpack
Stow held item
backpack interaction q Stow item to backpack
Swap held item
backpack interaction / Swap held item for an item from the backpack
Move to 1,1 [ ]
move Move to given coordinates[2]
Move to target
move Move to object (often needs to be preceded by a Find command to work)[1]
Move to Stick Storage 1 [ ]
move Move to a structure[2]
Add to Stick Storage 1 [ ]
hand interaction Add held item to a structure[2]
Drop all
hand interaction Drop all held items at current location
Pick up target
hand interaction Pick up an object (now held item)
Take from Stick Storage 1 [ ]
hand interaction Take an object from a structure (now held item)[2]
Wait
1.0
flow Stand still the specified number of seconds (to insert this command, click twice on ground or use the Extra Instructions tab)
  1. 1.0 1.1 This instruction actually represents one of several internal commands that a bot can do (which are often incompatible with one another). Should your script not work despite being seemingly correct, try re-recording the actions where the script breaks.
  2. 2.0 2.1 2.2 2.3 A blue-red target circle appears on this instruction. This makes it easier to reprogram bots, as you can change their target without having to redo the command.

Repeat code blocks[ | ]

Repeat code blocks help save memory and streamline bot programming. A bot program only enters a repeat block if the "until [...]" condition is not fulfilled. The condition will be evaluated again at the end of the repeat block, and if it is still not fulfilled the program will begin the repeat block again. Clicking the box to the right of the repeat block's condition indicates to exit the repeat block if an action within the repeat block cannot be performed (such as being told to pick up an item, but no items are available). Otherwise, the bot will pause at a blocked action until the action can be performed.

Command Description
Repeat
until hands full
Command Box
Repeats the enclosed code blocks until the bot's hands are full
Repeat
until hands not full
Command Box
Repeats the enclosed code blocks until the bot's hands are not full
Repeat
until hands empty
Command Box
Repeats the enclosed code blocks until the bot's hands are empty
Repeat
until hands not empty
Command Box
Repeats the enclosed code blocks until the bot's hands are not empty
Repeat
until backpack full
Command Box
Repeats the enclosed code blocks until the bot's backpack is full
Repeat
until backpack not full
Command Box
Repeats the enclosed code blocks until the bot's backpack is not full
Repeat
until backpack empty
Command Box
Repeats the enclosed code blocks until the bot's backpack is empty
Repeat
until backpack not empty
Command Box
Repeats the enclosed code blocks until the bot's backpack is not empty
Repeat
until ? full
?Command Box
Repeats the enclosed code blocks until the specified structure is at least 95% full (click the question mark to choose structure). Crafting stations are considered full if the queued item is on the output tile.
Repeat
until ? not full
?Command Box
Repeats the enclosed code blocks until the specified structure is less than 95% full (click the question mark to choose structure). Crafting stations are considered full if the queued item is on the output tile.
Repeat
until ? empty
?Command Box
Repeats the enclosed code blocks until the specified structure is empty (click the question mark to choose structure). Crafting stations are considered empty if the queued item is not on the output tile.
Repeat
until ? not empty
?Command Box
Repeats the enclosed code blocks until the specified structure is not empty (click the question mark to choose structure). Crafting stations are considered empty if the queued item is not on the output tile.
Repeat
until held object full
Command Box
Repeats the enclosed code blocks until the item (such as a Bucket) held by the bot is full
Repeat
until held object not full
Command Box
Repeats the enclosed code blocks until the item (such as a Bucket) held by the bot is not full
Repeat
until held object empty
Command Box
Repeats the enclosed code blocks until the item (such as a Bucket) held by the bot is empty
Repeat
until held object not empty
Command Box
Repeats the enclosed code blocks until the item (such as a Bucket) held by the bot is not empty
Repeat
times
1
Command Box
Repeats the enclosed code blocks a specified number of times (click the square with "1" to edit the number of times
Repeat
forever!
Command Box
Repeats the enclosed code blocks forever
Repeat
until hear
Go!
Command Box
Repeats the enclosed code blocks until the bot hears a shout (specify which shout in the white text box to the right)
Exit Repeat
Breaks out of the current repeat loop (to insert this command, use the Extra Instructions tab)

If code blocks[ | ]

If statements work similarly to repeat statements, but will not execute more than once even if their condition is still satisfied afterwards. They also have an optional Else block, which will execute when the If condition is not satisfied.

To insert these commands, use the Extra Instructions tab.

Advertisement