Autonauts Wiki
Explore
Main Page
All Pages
Interactive Maps
Autonauts Wiki
About the game
Content
Bots
Food
Parts
Structures
Tools
Wildlife
Gameplay
Research
Academy
Programming
Guides
Controls
Speed
Structure Requirements
Games
Prototype
Autonauts
Autonauts (Console Edition)
Autonauts vs Piratebots
Community
Help
Community Portal
Admin noticeboard
FANDOM
Fan Central
BETA
Games
Anime
Movies
TV
Video
Wikis
Explore Wikis
Community Central
Start a Wiki
Don't have an account?
Register
Sign In
Sign In
Register
Autonauts Wiki
Official wiki
549
pages
Explore
Main Page
All Pages
Interactive Maps
Autonauts Wiki
About the game
Content
Bots
Food
Parts
Structures
Tools
Wildlife
Gameplay
Research
Academy
Programming
Guides
Controls
Speed
Structure Requirements
Games
Prototype
Autonauts
Autonauts (Console Edition)
Autonauts vs Piratebots
Community
Help
Community Portal
Admin noticeboard
Editing
Programming
Back to page
Edit
VisualEditor
History
Talk (2)
Edit Page
Programming
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{stub}}'''Programming''' is one of the key elements of Autonauts. All tasks can be automated with the help of programming [[Bot]]s. 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== {| class="wikitable sortable" !Command !Type !key !Result |- |{{Command|type=find|value=Stick}} |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... |- |{{Command|type=unreserve}} |unreserve | |Removes reservation on the previously found item. It can be still used as a "target". |- |{{Command|type=shout|opaque=1}} |world interaction |<span class="keyelement">z</span> |Shout (other bots can have the "Listen" command and act upon shouts). Start the text with # to get a message when the bot shouts. |- |{{Command|type=use}} |world interaction | |Use the item held in the first hand slot<ref name="internal">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.</ref> |- |{{Command|type=set}} |object interaction | |Change the active recipe on a crafting station |- |{{Command|type=engage}} |object interaction | |Engage with an object (only applicable for workbenches, stations, carts, and wheelbarrows) |- |{{Command|type=disengage}} |object interaction | |Disengage the object (see above) |- |{{Command|type=recharge}} |object interaction | |Recharge a bot that has run out of energy |- |{{Command|type=cycledown}} |backpack interaction |{{Control|.}} |Cycle items in the bot's inventory |- |{{Command|type=cycleup}} |backpack interaction |{{Control|,}} |Cycle items in the bot's inventory |- |{{Command|type=retrieve}} |backpack interaction |{{Control|q}} |Retrieve item from the backpack |- |{{Command|type=stow}} |backpack interaction |{{Control|q}} |Stow item to backpack |- |{{Command|type=swap}} |backpack interaction |{{Control|/}} |Swap held item for an item from the backpack |- |{{Command|type=move}} |move | |Move to given coordinates<ref name="target">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.</ref> |- |{{Command|type=move|value=target}} |move | |Move to object (often needs to be preceded by a Find command to work)<ref name="internal" /> |- |{{Command|type=move|value=Stick Storage 1}} |move | |Move to a structure<ref name="target" /> |- |{{Command|type=add|value=Stick Storage 1}} |hand interaction | |Add held item to a structure<ref name="target" /> |- |{{Command|type=drop}} |hand interaction | |Drop all held items at current location |- |{{Command|type=pickup|value=target}} |hand interaction | |Pick up an object (now held item) |- |{{Command|type=take|value=Stick Storage 1}} |hand interaction | |Take an object from a structure (now held item)<ref name="target" /> |- |{{Command|type=wait|opaque=1}} |flow | |Stand still the specified number of seconds (to insert this command, click twice on ground or use the Extra Instructions tab) |} <references /> == 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. {| class="wikitable" |+ !Command !Description |- |{{loop|type=hands|opaque=1}} |Repeats the enclosed code blocks until the bot's hands are full |- |{{loop|type=hands|not=|opaque=1}} |Repeats the enclosed code blocks until the bot's hands are '''not''' full |- |{{loop|type=hands|empty=|opaque=1}} |Repeats the enclosed code blocks until the bot's hands are empty |- |{{loop|type=hands|not=|empty=|opaque=1}} |Repeats the enclosed code blocks until the bot's hands are '''not''' empty |- |{{loop|type=backpack|opaque=1}} |Repeats the enclosed code blocks until the bot's backpack is full |- |{{loop|type=backpack|not=|opaque=1}} |Repeats the enclosed code blocks until the bot's backpack is '''not''' full |- |{{loop|type=backpack|empty=|opaque=1}} |Repeats the enclosed code blocks until the bot's backpack is empty |- |{{loop|type=backpack|not=|empty=|opaque=1}} |Repeats the enclosed code blocks until the bot's backpack is '''not''' empty |- |{{loop|type=?|opaque=1}} |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. |- |{{loop|type=?|not=|opaque=1}} |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. |- |{{loop|type=?|empty=|opaque=1}} |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. |- |{{loop|type=?|not=|empty=|opaque=1}} |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. |- |{{loop|type=held object|opaque=1}} |Repeats the enclosed code blocks until the item (such as a Bucket) held by the bot is full |- |{{loop|type=held object|not=|opaque=1}} |Repeats the enclosed code blocks until the item (such as a Bucket) held by the bot is '''not''' full |- |{{loop|type=held object|empty=|opaque=1}} |Repeats the enclosed code blocks until the item (such as a Bucket) held by the bot is empty |- |{{loop|type=held object|not=|empty=|opaque=1}} |Repeats the enclosed code blocks until the item (such as a Bucket) held by the bot is '''not''' empty |- |{{loop|type=times|opaque=1}} |Repeats the enclosed code blocks a specified number of times (click the square with "1" to edit the number of times |- ||{{loop|opaque=1}} |Repeats the enclosed code blocks forever |- ||{{loop|type=hear|opaque=1}} |Repeats the enclosed code blocks until the bot hears a shout (specify which shout in the white text box to the right) |- |{{Command|type=exit|opaque=1}} |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. [[Category:Guides]]
Summary:
Please note that all contributions to the Autonauts Wiki are considered to be released under the CC BY-NC-SA
Cancel
Editing help
(opens in new window)
Templates used on this page:
Template:Ambox
(
view source
)
Template:Command
(
view source
)
Template:Command/color
(
view source
)
Template:Command/loop
(
view source
)
Template:Command/loop/box
(
view source
)
Template:Command/loop/fail
(
view source
)
Template:Command/loop/left bar
(
view source
)
Template:Command/text
(
view source
)
Template:Control
(
view source
)
Template:Fullurl
(
view source
)
Template:Loop
(
view source
)
Template:Stub
(
view source
)
Follow on IG
TikTok
Join Fan Lab