<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://stationeers-wiki.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=2607%3A9000%3A2000%3A15%3A0%3A0%3A0%3AA45E</id>
	<title>Stationeers Community Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://stationeers-wiki.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=2607%3A9000%3A2000%3A15%3A0%3A0%3A0%3AA45E"/>
	<link rel="alternate" type="text/html" href="https://stationeers-wiki.com/Special:Contributions/2607:9000:2000:15:0:0:0:A45E"/>
	<updated>2026-04-03T16:34:29Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.6</generator>
	<entry>
		<id>https://stationeers-wiki.com/index.php?title=IC10&amp;diff=17177</id>
		<title>IC10</title>
		<link rel="alternate" type="text/html" href="https://stationeers-wiki.com/index.php?title=IC10&amp;diff=17177"/>
		<updated>2023-09-04T00:10:36Z</updated>

		<summary type="html">&lt;p&gt;2607:9000:2000:15:0:0:0:A45E: /* Solar Panel 2-axis tracking */ typo&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:MIPS Programming]]&lt;br /&gt;
=MIPS scripting language for IC10 housings / chips=&lt;br /&gt;
MIPS is [[Stationeers]]&#039; in-game scripting language. It runs on [[Integrated Circuit (IC10)|IC10 chips]] crafted at the [[Electronics Printer]]. &lt;br /&gt;
&lt;br /&gt;
==Registers==&lt;br /&gt;
Internal registers &#039;&#039;&#039;r?&#039;&#039;&#039;: The IC contains 16 CPU registers, numbered &#039;&#039;&#039;r0&#039;&#039;&#039; to &#039;&#039;&#039;r15&#039;&#039;&#039;. From now on referred to as &#039;&#039;&#039;r?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Device registers &#039;&#039;&#039;d? logicType&#039;&#039;&#039;: Device registers are written to and from the IC. A device register is numbered &#039;&#039;&#039;d0&#039;&#039;&#039; to &#039;&#039;&#039;d5&#039;&#039;&#039; (select via screw), or &#039;&#039;&#039;db&#039;&#039;&#039; (connected device). From now on referred to as &#039;&#039;&#039;d?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== Logic and algoritmic with &#039;&#039;&#039;Internal registers&#039;&#039;&#039; ===&lt;br /&gt;
All calculations are exclusively performed to and from &#039;&#039;&#039;r?&#039;&#039;&#039; registers, or generally more understood as variables in programming. You can use aliases to give convinent names with the &amp;lt;code&amp;gt;alias string r?|d?&amp;lt;/code&amp;gt;command (see below). &lt;br /&gt;
&lt;br /&gt;
Internal registers can be manipulated in various ways. &lt;br /&gt;
* Write constant values &amp;lt;code&amp;gt;move r? (r?|num)&amp;lt;/code&amp;gt;: Example: &amp;lt;code&amp;gt;move r0 2&amp;lt;/code&amp;gt; sets r0 to the number 2.&lt;br /&gt;
* Calculate: Calculations are done to- and from these registers, like &amp;lt;code&amp;gt;add r? a(r?|num) b(r?|num)&amp;lt;/code&amp;gt;. Example: &amp;lt;code&amp;gt;add r1 r0 3&amp;lt;/code&amp;gt; adds 3 to r0, and writes to r1.&lt;br /&gt;
&lt;br /&gt;
Note, for any kind of if statements or loop behaviours, knowing about labels, branching, and jumps is essential knowledge. See below.&lt;br /&gt;
&lt;br /&gt;
=== IO to &#039;&#039;&#039;Device registers&#039;&#039;&#039; ===&lt;br /&gt;
Acronym &#039;&#039;&#039;d?&#039;&#039;&#039; stands for device, where ? is a number corresponding to the screw device selector on the socket.&lt;br /&gt;
You can also read/write to the device where the IC is planted in using device &#039;&#039;&#039;db&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Generally, there are up to 6 devices which can be set using the screwdriver &#039;&#039;&#039;d0&#039;&#039;&#039; to &#039;&#039;&#039;d5&#039;&#039;&#039;. A special decice register &#039;&#039;&#039;db&#039;&#039;&#039; is the device wherever the IC is mounted upon. Very convinent for atmospheric devices where no seperate IC socket is reguired.&lt;br /&gt;
&lt;br /&gt;
Note, the IC is completely unaware where d? is actually connected to. So if you get a logicType error, check d? number, or check if the screw has been set opn the socket. An allias is only convinent to convey what is expected to be set on the d? screw, it does not actually set or program the screq.&lt;br /&gt;
&lt;br /&gt;
* Read from device (load) &amp;lt;code&amp;gt;l d? logicType r?&amp;lt;/code&amp;gt;: Reads logicType, like Pressure from a [[Sensors|gas sensor]], from device d? to register r?. Values can be read from connected devices and put into the register using the &#039;&#039;&#039;l&#039;&#039;&#039; (load) command. For example, if you want to load the state of a door. &amp;lt;br&amp;gt; Example: &amp;lt;code&amp;gt;l r0 Door Open&amp;lt;/code&amp;gt; reads the &#039;Open&#039; field of an object named &#039;Door&#039;, that would be connected to the IC housing of the chip.&lt;br /&gt;
* Write to a device (set) &amp;lt;code&amp;gt;s d? logicType r?&amp;lt;/code&amp;gt;: Write a value from a register back to a device using the command &amp;lt;code&amp;gt;s d? logicType r?&amp;lt;/code&amp;gt;. For example, if d0 is set to a door using the screwdriver, &amp;lt;code&amp;gt;s d0 Open 0&amp;lt;/code&amp;gt; sets the &#039;Open&#039; status of the d0 (a door) to 0, effectively closing the door.&lt;br /&gt;
&lt;br /&gt;
=== batch IO to - &#039;&#039;&#039;Device registers&#039;&#039;&#039; ===&lt;br /&gt;
&#039;&#039;&#039;Batch writing&#039;&#039;&#039; needs to be done to a specific &#039;&#039;&#039;deviceHash&#039;&#039;&#039; instead of d?. Is unique per device type, which you can find in the [[Stationpedia]] entries.&lt;br /&gt;
* &amp;lt;code&amp;gt;lb r? deviceHash logicType batchMode&amp;lt;/code&amp;gt; &lt;br /&gt;
* &amp;lt;code&amp;gt;sb deviceHash logicType r?&amp;lt;/code&amp;gt;&lt;br /&gt;
Additionally, using the following batch commands, a &#039;&#039;&#039;nameHash&#039;&#039;&#039; can be provided to only modify devices with a certain name.&lt;br /&gt;
* &amp;lt;code&amp;gt;lbn r? deviceHash nameHash logicType batchMode &amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;sbn deviceHash nameHash logicType r?&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;batchMode&#039;&#039;&#039; is a parameter equal to 0, 1, 2, or 3. These are also defined as the constants &#039;&#039;&#039;Average&#039;&#039;&#039;, &#039;&#039;&#039;Sum&#039;&#039;&#039;, &#039;&#039;&#039;Minimum&#039;&#039;&#039;, and &#039;&#039;&#039;Maximum&#039;&#039;&#039; respectively. The word or number can be used.&lt;br /&gt;
&lt;br /&gt;
Combining one of these functions with the &amp;lt;code&amp;gt;HASH()&amp;lt;/code&amp;gt; function can be advantageous:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;lbn r0 HASH(&amp;quot;StructureGasSensor&amp;quot;) HASH(&amp;quot;Sensor 1&amp;quot;) Temperature Average&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code will load the average temperature of all gas sensors on the network named &amp;quot;Sensor 1&amp;quot; onto register &#039;&#039;&#039;r0&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here are some examples demonstrating all three operations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;move r0 10&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;Sets register &#039;&#039;&#039;r0&#039;&#039;&#039; to the value 10&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;move r0 r1&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;Copies the value of register &#039;&#039;&#039;r1&#039;&#039;&#039; to register &#039;&#039;&#039;r0&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;l r0 d0 Temperature&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;Reads the Temperature parameter from device &#039;&#039;&#039;d0&#039;&#039;&#039; and places the value in register &#039;&#039;&#039;r0&#039;&#039;&#039;.&lt;br /&gt;
Note: not all devices have a Temperature parameter, check the in-game stationpedia.&lt;br /&gt;
&lt;br /&gt;
To set a device specific value (like &#039;&#039;&#039;On&#039;&#039;&#039;), you can write into this value.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;s d0 On r0&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;Writes the value from register &#039;&#039;&#039;r0&#039;&#039;&#039; out to &#039;&#039;&#039;On&#039;&#039;&#039; parameter of device &#039;&#039;&#039;d0&#039;&#039;&#039;. In this example the device will be turned On, if valve of register r0 equals 1, otherwise (register r0 equals 0) it will turned off. See section [[MIPS#Device_Variables|Device Variables]].&lt;br /&gt;
&lt;br /&gt;
It&#039;s recommended to use labels (like: &#039;&#039;someVariable&#039;&#039;) instead of a direct reference to the register. See &#039;&#039;&#039;alias&#039;&#039;&#039; in section [[MIPS#Instructions|Instructions]].&lt;br /&gt;
&lt;br /&gt;
=== Special registers ===&lt;br /&gt;
There are two more registers. One called &#039;&#039;&#039;ra&#039;&#039;&#039; (return address) and one called &#039;&#039;&#039;sp&#039;&#039;&#039; (stack pointer). The &#039;&#039;&#039;ra&#039;&#039;&#039; is used by certain jump and branching instructions (those ending with &#039;&#039;&#039;-al&#039;&#039;&#039;) to remember which line in the script it should return to. The &#039;&#039;&#039;sp&#039;&#039;&#039; tracks the next index within the stack (a memory that can store up to 512 values) to be pushed (written) to or popped (read) from. Neither &#039;&#039;&#039;ra&#039;&#039;&#039; or &#039;&#039;&#039;sp&#039;&#039;&#039; is protected, their values can be changed by instructions like any other register.&lt;br /&gt;
&lt;br /&gt;
==Stack Memory==&lt;br /&gt;
;push r?: adds the value of register &#039;&#039;&#039;r?&#039;&#039;&#039; to the stack memory at index &#039;&#039;&#039;sp&#039;&#039;&#039; and increments the &#039;&#039;&#039;sp&#039;&#039;&#039; by 1.&lt;br /&gt;
;pop r?: loads the value in the stack memory at index &amp;lt;code&amp;gt;sp-1&amp;lt;/code&amp;gt; into register &#039;&#039;&#039;r?&#039;&#039;&#039; and decrements the &#039;&#039;&#039;sp&#039;&#039;&#039; by 1.&lt;br /&gt;
;peek r?: loads the value in the stack memory at index &amp;lt;code&amp;gt;sp-1&amp;lt;/code&amp;gt; into register &#039;&#039;&#039;r?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
As mentioned previously, &#039;&#039;&#039;sp&#039;&#039;&#039; can be both written to and read from any time. When reading (&#039;&#039;&#039;peek&#039;&#039;&#039; or &#039;&#039;&#039;pop&#039;&#039;&#039;), &#039;&#039;&#039;sp&#039;&#039;&#039; must be between 1 and 512, inclusive. While writing (&#039;&#039;&#039;push&#039;&#039;&#039;), &#039;&#039;&#039;sp&#039;&#039;&#039; must be between 0 and 511, inclusive.&lt;br /&gt;
&lt;br /&gt;
Stack memory is persistent on logic chips. This means that if you have a logic chip and push values to the stack, the code that pushes those values can be removed and the stack will retain those values.&lt;br /&gt;
&lt;br /&gt;
Note that this does not carry over to any other logic chips which receive the program of the original; They will need to have their stack memories programmed individually.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Stack Traversing&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Traversing the stack can be done similarly to how an array would be traversed in some other languages:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;nowiki /&amp;gt;#this will traverse indices {min value} through {max value} - 1&lt;br /&gt;
&lt;br /&gt;
move sp {min value}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
loop:&lt;br /&gt;
&lt;br /&gt;
add sp sp 1&lt;br /&gt;
&lt;br /&gt;
peek r0&lt;br /&gt;
&amp;lt;nowiki /&amp;gt;#do something here with your stack values (loaded into r0)&lt;br /&gt;
&lt;br /&gt;
blt sp {max value} loop&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki /&amp;gt;#continue on&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively, you can use the pop function&#039;s decrementing to make a more efficient loop:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
move sp {max value}&lt;br /&gt;
&lt;br /&gt;
add sp sp 1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
loop:&lt;br /&gt;
&lt;br /&gt;
pop r0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki /&amp;gt;#do something here with your stack values (loaded into r0)&lt;br /&gt;
&lt;br /&gt;
bgt sp {min value} loop&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki /&amp;gt;#continue on&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Device Ports==&lt;br /&gt;
ICs can interact with up to 6 other devices via d0 - d5, as well as the device it&#039;s attached to via db. To change or set a device, use a screwdriver and adjust the device in the IC housing. You can read or set any of the device&#039;s properties, so it is possible to do things like read the pressure or oxygen content of a room on the same Device port. &lt;br /&gt;
&lt;br /&gt;
Additionally, is possible to set other IC housings as devices, allowing you to create programs that run across multiple ICs together. For example, an Gas Mixing IC could check the &#039;&#039;&#039; Setting&#039;&#039;&#039;  field of a Atmosphere Sensor IC and act based on the value of the sensor chip.&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;l&#039;&#039;&#039; (load) or &#039;&#039;&#039;s&#039;&#039;&#039; (set) instructions you have to read or set these values to your device. Examples:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;l r0 d0 Temperature&amp;lt;/code&amp;gt; #Reads the &#039;&#039;&#039;Temperature&#039;&#039;&#039; from an atmosphere sensor at device port &#039;&#039;&#039;d0&#039;&#039;&#039; into register &#039;&#039;&#039;r0&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;s d1 Setting r0 &amp;lt;/code&amp;gt; # Writes the value of the register &#039;&#039;&#039;r0&#039;&#039;&#039; to the device on port &#039;&#039;&#039;d1&#039;&#039;&#039; into the variable &#039;&#039;&#039;Setting&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==Labels==&lt;br /&gt;
Labels are used to make it easier to jump between lines in the script. The label will have a numerical value that is the same as its line number. Even though it&#039;s possible to use a labels value for calculations, doing so is a bad idea since any changes to the code can change the line numbers of the labels.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;main:&amp;lt;/code&amp;gt; # define a jump mark with label &#039;&#039;&#039;main&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;j main&amp;lt;/code&amp;gt; # jumps back to &#039;&#039;&#039;main&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Constants==&lt;br /&gt;
Instead of using a register to store a fixed value, a constant can be made. Using this name will refer to the assigned value. With the help of Constants you can save register places.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;define pi 3.14159&amp;lt;/code&amp;gt; # defines a Constant with name &#039;&#039;&#039;pi&#039;&#039;&#039; and set it&#039;s value to 3.14159&lt;br /&gt;
&lt;br /&gt;
You can use these constants like any other variables (see: alias in section [[MIPS#Instructions|Instructions]]). Example:&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;move r0 pi&amp;lt;/code&amp;gt; # set the value of register &#039;&#039;&#039;r0&#039;&#039;&#039; to the value of constant named &#039;&#039;&#039;pi&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==Indirect referencing==&lt;br /&gt;
This is a way of accessing a register by using another register as a pointer. Adding an additional r infront of the register turns on this behaviour. The value stored in the register being used as the pointer must be between 0 to 15, this will then point to a register from r0 to r15, higher or lower values will cause an error.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;move r0 5&amp;lt;/code&amp;gt; stores the value 5 in r0&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;move rr0 10&amp;lt;/code&amp;gt; is now the same as &amp;lt;code&amp;gt;move r5 10&amp;lt;/code&amp;gt; since r0 has the value 5, rr0 points at the register r5&lt;br /&gt;
&lt;br /&gt;
Additional r&#039;s can be added to do indirect referencing multiple times in a row.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;move r1 2&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;move r2 3&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;move rrr1 4&amp;lt;/code&amp;gt; is now the same as &amp;lt;code&amp;gt;move r3 4&amp;lt;/code&amp;gt; since r1 points at r2 which points at r3&lt;br /&gt;
&lt;br /&gt;
This also works with devices&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;move r0 2&amp;lt;/code&amp;gt; stores the value 2 in r0&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;s dr0 On 1&amp;lt;/code&amp;gt; is now the same as &amp;lt;code&amp;gt;s d2 On 1&amp;lt;/code&amp;gt;, r0 has the value 2 so dr0 points at d2&lt;br /&gt;
&lt;br /&gt;
==Comments==&lt;br /&gt;
Comments can be placed using a &#039;&#039;&#039;#&#039;&#039;&#039; symbol. All comments are ignored by the game when it reads commands. Below is an example of valid code with two comments.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; alias MyAlias r0 # Text after the hash tag will be ignored to the end of the line. &amp;lt;/code&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; # You can also write comments on their own lines, like this. &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Debugging advices==&lt;br /&gt;
The value stored in a register or variable can easily be displayed by writing it to the Setting parameter of the IC housing. This has no side effects. To see the value, just stand close to the IC housing and look directly at the housing.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;s db Setting r0&amp;lt;/code&amp;gt;. # sets/writes the value of register &#039;&#039;&#039;r0&#039;&#039;&#039; into the parameter &#039;&#039;&#039;Setting&#039;&#039;&#039; of the IC Housing(&#039;&#039;&#039;db&#039;&#039;&#039;)&lt;br /&gt;
&lt;br /&gt;
To check if a certain block of code is executed, use the above trick but with a random number that you choose, like the line number.&amp;lt;br&amp;gt; This example will display the number 137 on the IC housing.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;s db Setting 137&amp;lt;/code&amp;gt;  # sets/writes the number 137 into the parameter &#039;&#039;&#039;Setting&#039;&#039;&#039; of the IC Housing(&#039;&#039;&#039;db&#039;&#039;&#039;)&lt;br /&gt;
&lt;br /&gt;
Always use unique names for labels. When a label is named after a MIPS keyword like &amp;quot;Temperature:&amp;quot; or &amp;quot;Setting:&amp;quot; the original meaning of the keyword is overwritten, so when an instruction tries to use it an error will occur.&lt;br /&gt;
&lt;br /&gt;
A [[Cartridge#Configuration|configuration cartridge]] installed in a [[Handheld_Tablet|tablet]]  can be used to see all available values and configuration parameter for all devices you focus on.&lt;br /&gt;
&lt;br /&gt;
==Learning MIPS==&lt;br /&gt;
MIPS can be difficult to get started with. So here is a list of instructions that are useful for beginners. These can be used to write many different scripts.&lt;br /&gt;
&lt;br /&gt;
General:&lt;br /&gt;
* &amp;lt;code&amp;gt;alias&amp;lt;/code&amp;gt; make the script easier to read by assigning a name to a register or device, example: &amp;lt;code&amp;gt;alias rTemperature r15&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;label:&amp;lt;/code&amp;gt; where &amp;quot;label&amp;quot; can be replaced with almost any word, jump and branch instructions can use these in place of line numbers, example: &amp;lt;code&amp;gt;start:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;yield&amp;lt;/code&amp;gt; pause for 1-tick and then resume, if not used the script will automatically pause for 1-tick after 128 lines&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Jumps:&lt;br /&gt;
*&amp;lt;code&amp;gt;j someLabelName&amp;lt;/code&amp;gt; jump to line with &#039;&#039;&#039;someLabelName&#039;&#039;&#039;&lt;br /&gt;
*&amp;lt;code&amp;gt;jal someLabelName&amp;lt;/code&amp;gt; stores the next line number into the register ra (return address) and then jump to &#039;&#039;&#039;someLabelName&#039;&#039;&#039;&lt;br /&gt;
*&amp;lt;code&amp;gt;j ra&amp;lt;/code&amp;gt; jump to register ra (return address)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Branching (jump-if):&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;beq a(r?|num) b(r?|num) c(r?|num)&amp;lt;/code&amp;gt; if &#039;&#039;&#039;a&#039;&#039;&#039; is equal to &#039;&#039;&#039;b&#039;&#039;&#039; goto &#039;&#039;&#039;c&#039;&#039;&#039;  (label or linenumber) &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;bne a(r?|num) b(r?|num) c(r?|num)&amp;lt;/code&amp;gt; if  &#039;&#039;&#039;a&#039;&#039;&#039; not-equal &#039;&#039;&#039;b&#039;&#039;&#039; goto  &#039;&#039;&#039;c&#039;&#039;&#039; (label or linenumber) &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;bgt a(r?|num) b(r?|num) c(r?|num)&amp;lt;/code&amp;gt; if  &#039;&#039;&#039;a&#039;&#039;&#039; greater than &#039;&#039;&#039;b&#039;&#039;&#039; goto   &#039;&#039;&#039;c&#039;&#039;&#039; (label or linenumber) &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;blt a(r?|num) b(r?|num) c(r?|num)&amp;lt;/code&amp;gt; if  &#039;&#039;&#039;a&#039;&#039;&#039; less than &#039;&#039;&#039;b&#039;&#039;&#039; goto &#039;&#039;&#039;c&#039;&#039;&#039; (label or linenumber) &amp;lt;br&amp;gt;&lt;br /&gt;
The suffix -al can be added to each of these (example: beqal) to save the &#039;&#039;&#039;next&#039;&#039;&#039; line number into the &amp;quot;return address&amp;quot; register. this is called using &amp;lt;code&amp;gt;j ra&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Device interactions:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
l (load)&lt;br /&gt;
lb (load batch, requires one of the following: 0(Average) / 1(Sum) / 2(Minimum) / 3(Maximum))&lt;br /&gt;
ls (load slot)&lt;br /&gt;
s (store)&lt;br /&gt;
sb (store batch)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Logic and Math:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
seqz (common NOT-gate: turns 0 into 1, and all other values into 0)&lt;br /&gt;
move&lt;br /&gt;
add (addition)&lt;br /&gt;
sub (subtraction)&lt;br /&gt;
mul (multiplication)&lt;br /&gt;
div (division)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Common device variables:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
On (1 is on, 0 is off)&lt;br /&gt;
Open (1 is open, 0 is closed)&lt;br /&gt;
Setting (meaning varies between devices, example: a LED display(console) will show this value)&lt;br /&gt;
Activate (1 usually means running, example: a Daylight sensor is 1 when the sun shines on it)&lt;br /&gt;
Temperature (in Kelvin, Celsius - 273.15)&lt;br /&gt;
Pressure (in kPa)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Notes:&lt;br /&gt;
&amp;lt;br&amp;gt;-All instructions and variables can be seen in-game in the MIPS editor window by clicking the &amp;quot;f&amp;quot;, &amp;quot;x&amp;quot; and &amp;quot;s(x)&amp;quot; buttons on the top right.&lt;br /&gt;
&amp;lt;br&amp;gt;-The stationpedia is the best source to see which variables are available to each device.&lt;br /&gt;
&amp;lt;br&amp;gt;-Most scripts are loops, they end with a jump instruction that leads back up to the start. Otherwise they will just run once and then stop.&lt;br /&gt;
&lt;br /&gt;
Two practice scripts:&lt;br /&gt;
&amp;lt;br&amp;gt;Automatic Night Light: Load &amp;quot;Activate&amp;quot; from a Daylight sensor, flip the value with a NOT-gate, store the value to the &amp;quot;On&amp;quot; variable of one or more lights.&lt;br /&gt;
&amp;lt;br&amp;gt;Automatic Wall Cooler: Read &amp;quot;Temperature&amp;quot; from a Gas Sensor. Branch if the value is greater than X, turn on the cooler. Branch if the value is less than Y, turn off the cooler. (Wall coolers need a minumum of 12.5 kPa pressure in the connected pipe)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=Instructions=&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;alias&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;alias&lt;br /&gt;
:alias str r? d? # labels register or device reference with name.  When alias is applied to a device, it will affect what shows on the screws in the IC base.  (housing)&lt;br /&gt;
&amp;lt;code&amp;gt;alias vTemperature r0&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;alias dAutoHydro1 d0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;move&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;move    &lt;br /&gt;
:d s     # stores the value of s in d&lt;br /&gt;
&amp;lt;code&amp;gt;move r0 42 # Store 42 in register 0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;l&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;load&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;l (load)&lt;br /&gt;
:l r# d# parameter&lt;br /&gt;
Reads from a device (d#) and stores the value in a register (r#)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;l r0 d0 Setting&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;Read from the device on d0 into register 0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;l r1 d5 Pressure&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;Read the pressure from a sensor&lt;br /&gt;
&lt;br /&gt;
This also works with aliases. For example:&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
alias Sensor d0 &amp;lt;br/&amp;gt;&lt;br /&gt;
l r0 Sensor Temperature&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;ls&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;load slot&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;ls (load slot)&lt;br /&gt;
:ls r# d# slotNum parameter&lt;br /&gt;
Reads from a slot (slotNum) of a device (d#)  and stores the value in a register (r#)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ls r0 d0 2 Occupied&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;Read from the second slot of device on d0, stores 1 in r0 if it&#039;s occupied, 0 otherwise.&lt;br /&gt;
&lt;br /&gt;
And here is the code to read the charge of an AIMeE:&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
alias robot d0 &amp;lt;br/&amp;gt;&lt;br /&gt;
alias charge r0 &amp;lt;br/&amp;gt;&lt;br /&gt;
ls charge robot 0 Charge &lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;s&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;set&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;s (set)&lt;br /&gt;
:s d# parameter r#&lt;br /&gt;
Writes a setting to a device. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;s d0 Setting r0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;add&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;add     &lt;br /&gt;
:d s t   # calculates s + t and stores the result in d&lt;br /&gt;
&amp;lt;code&amp;gt;add r0 r1 1 # add 1 to r1 and store the result as r0&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;add r0 r0 1 # increment r0 by one&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;sub&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;sub     &lt;br /&gt;
:d s t   # calculates s - t and stores the result in d&lt;br /&gt;
&amp;lt;div id=&amp;quot;mul&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;mul     &lt;br /&gt;
:d s t   # calculates s * t and stores the result in d&lt;br /&gt;
&amp;lt;div id=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;div     &lt;br /&gt;
:d s t   # calculates s / t and stores the result in d&lt;br /&gt;
&amp;lt;div id=&amp;quot;mod&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;mod     &lt;br /&gt;
:d s t   &lt;br /&gt;
::# calculates s mod t and stores the result in d. Note this&lt;br /&gt;
::# doesn&#039;t behave like the % operator - the result will be &lt;br /&gt;
::# positive even if the either of the operands are negative&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;slt&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;slt     &lt;br /&gt;
:d s t   # stores 1 in d if s &amp;lt; t, 0 otherwise&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;sqrt&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;sqrt    &lt;br /&gt;
:d s     # calculates sqrt(s) and stores the result in d&lt;br /&gt;
&amp;lt;div id=&amp;quot;round&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;round   &lt;br /&gt;
:d s     # finds the rounded value of s and stores the result in d&lt;br /&gt;
&amp;lt;div id=&amp;quot;trunc&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;trunc   &lt;br /&gt;
:d s     # finds the truncated value of s and stores the result in d&lt;br /&gt;
&amp;lt;div id=&amp;quot;ceil&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;ceil   &lt;br /&gt;
: d s     # calculates the ceiling of s and stores the result in d&lt;br /&gt;
&amp;lt;div id=&amp;quot;floor&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;floor  &lt;br /&gt;
: d s     # calculates the floor of s and stores the result in d&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;max&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;max    &lt;br /&gt;
: d s t   # calculates the maximum of s and t and stores the result in d&lt;br /&gt;
&amp;lt;div id=&amp;quot;min&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;min    &lt;br /&gt;
: d s t   # calculates the minimum of s and t and stores the result in d&lt;br /&gt;
&amp;lt;div id=&amp;quot;abs&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;abs    &lt;br /&gt;
: d s     # calculates the absolute value of s and stores the result in d&lt;br /&gt;
&amp;lt;div id=&amp;quot;log&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;log    &lt;br /&gt;
: d s     # calculates the natural logarithm of s and stores the result&lt;br /&gt;
::# in d&lt;br /&gt;
&amp;lt;div id=&amp;quot;exp&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;exp    &lt;br /&gt;
: d s     # calculates the exponential of s and stores the result in d&lt;br /&gt;
&amp;lt;div id=&amp;quot;rand&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;rand   &lt;br /&gt;
: d       # selects a random number uniformly at random between 0 and 1&lt;br /&gt;
::# inclusive and stores the result in d&lt;br /&gt;
&lt;br /&gt;
::# boolean arithmetic uses the C convention that 0 is false and any non-zero&lt;br /&gt;
::# value is true.&lt;br /&gt;
&amp;lt;div id=&amp;quot;and&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;and    &lt;br /&gt;
: d s t   # stores 1 in d if both s and t have non-zero values,&lt;br /&gt;
::# 0 otherwise&lt;br /&gt;
&amp;lt;div id=&amp;quot;or&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;or     &lt;br /&gt;
: d s t   # stores 1 in d if either s or t have non-zero values,&lt;br /&gt;
::# 0 otherwise&lt;br /&gt;
&amp;lt;div id=&amp;quot;xor&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;xor    &lt;br /&gt;
: d s t   # stores 1 in d if exactly one of s and t are non-zero,&lt;br /&gt;
::# 0 otherwise&lt;br /&gt;
&amp;lt;div id=&amp;quot;nor&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;nor &lt;br /&gt;
:    d s t   # stores 1 in d if both s and t equal zero, 0 otherwise&lt;br /&gt;
::# Lines are numbered starting at zero&lt;br /&gt;
&amp;lt;div id=&amp;quot;j&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;j&lt;br /&gt;
:             a # jumps to line a.&lt;br /&gt;
&amp;lt;div id=&amp;quot;bltz&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;bltz&lt;br /&gt;
:      s   a # jumps to line a if s &amp;lt;  0&lt;br /&gt;
&amp;lt;div id=&amp;quot;blez&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;blez &lt;br /&gt;
:     s   a # jumps to line a if s &amp;lt;= 0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;bgez&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;bgez &lt;br /&gt;
:     s   a # jumps to line a if s &amp;gt;= 0&lt;br /&gt;
&amp;lt;div id=&amp;quot;bgtz&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;bgtz&lt;br /&gt;
:      s   a # jumps to line a if s &amp;gt;  0&lt;br /&gt;
&amp;lt;div id=&amp;quot;beq&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;beq &lt;br /&gt;
:      s t a # jumps to line a if s == t&lt;br /&gt;
&amp;lt;div id=&amp;quot;bne&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;bne &lt;br /&gt;
:      s t a # jumps to line a if s != t&lt;br /&gt;
&amp;lt;div id=&amp;quot;bdseal&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;bdseal&lt;br /&gt;
:    d? a(r?|num) # Jump execution to line a and store current line number if device d? is set.&lt;br /&gt;
&amp;lt;code&amp;gt;bdseal d0 32 #Store line number and jump to line 32 if d0 is assigned.&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;bdseal dThisVictim HarvestCrop #Store line in ra and jump to sub HarvestCrop if device dThisVictim is assigned.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;yield&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;yield           &lt;br /&gt;
: 	# ceases code execution for this power tick&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;lb&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;lb&lt;br /&gt;
:      r? deviceHash logicType batchMode # Loads LogicType from all output network devices with the provided type hash using the provided batch mode. Average (0), Sum (1), Minimum (2), Maximum (3). Can use either the word, or the number. The result is stored into r?.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;sb&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;sb&lt;br /&gt;
:      deviceHash logicType r? # Stores the register value to LogicType on all output network devices with the provided type hash.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;lbn&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;lbn&lt;br /&gt;
:      r? deviceHash nameHash logicType batchMode # Loads LogicType from all output network devices with the provided type and name hashes using provided batch mode. Average(0), Sum (1), Minimum (2), Maximum (3). Can use either the word, or the number. The result is stored into r?.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;sbn&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;sbn&lt;br /&gt;
:      deviceHash nameHash logicType r? # Stores the register value to LogicType on all output network devices with the provided type and name hashes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;#&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
; #&lt;br /&gt;
:     # The following text will be ignored during compiling; use this to create comments.&lt;br /&gt;
&lt;br /&gt;
[https://www.cs.tufts.edu/comp/140/lectures/Day_3/mips_summary.pdf Other examples]&lt;br /&gt;
&lt;br /&gt;
== Conditional functions cheatsheet ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! suffix !! description !! branch to line !! branch and store return address !! relative jump to line !! set register&lt;br /&gt;
|-&lt;br /&gt;
| prefix: ||  || b- || b-al || br- || s-&lt;br /&gt;
|-&lt;br /&gt;
|  || unconditional || j    || jal    || jr    || &lt;br /&gt;
|-&lt;br /&gt;
| -eq  || if a == b || beq  || beqal  || breq  || seq&lt;br /&gt;
|-&lt;br /&gt;
| -eqz || if a == 0 || beqz || beqzal || breqz || seqz&lt;br /&gt;
|-&lt;br /&gt;
| -ge  || if a &amp;gt;= b || bge  || bgeal  || brge  || sge&lt;br /&gt;
|-&lt;br /&gt;
| -gez || if a &amp;gt;= 0 || bgez || bgezal || brgez || sgez&lt;br /&gt;
|-&lt;br /&gt;
| -gt  || if a &amp;gt; b  || bgt  || bgtal  || brgt  || sgt&lt;br /&gt;
|-&lt;br /&gt;
| -gtz || if a &amp;gt; 0  || bgtz || bgtzal || brgtz || sgtz&lt;br /&gt;
|-&lt;br /&gt;
| -le  || if a &amp;lt;= b || ble  || bleal  || brle  || sle&lt;br /&gt;
|-&lt;br /&gt;
| -lez || if a &amp;lt;= 0 || blez || blezal || brlez || slez&lt;br /&gt;
|-&lt;br /&gt;
| -lt  || if a &amp;lt; b  || blt  || bltal  || brlt  || slt&lt;br /&gt;
|-&lt;br /&gt;
| -ltz || if a &amp;lt; 0  || bltz || bltzal || brltz || sltz&lt;br /&gt;
|-&lt;br /&gt;
| -ne  || if a != b || bne  || bneal  || brne  || sne&lt;br /&gt;
|-&lt;br /&gt;
| -nez || if a != 0 || bnez || bnezal || brnez || snez&lt;br /&gt;
|-&lt;br /&gt;
| -dns || if device d is not set          || bdns || bdnsal || brdns || sdns&lt;br /&gt;
|-&lt;br /&gt;
| -dse || if device d is set              || bdse || bdseal || brdse || sdse&lt;br /&gt;
|-&lt;br /&gt;
| -ap  || if a approximately equals b     || bap  || bapal  || brap  || sap&lt;br /&gt;
|-&lt;br /&gt;
| -apz || if a approximately equals 0     || bapz || bapzal || brapz || sapz&lt;br /&gt;
|-&lt;br /&gt;
| -na  || if a not approximately equals b || bna  || bnaal  || brna  || sna&lt;br /&gt;
|-&lt;br /&gt;
| -naz || if a not approximately equals 0 || bnaz || bnazal || brnaz || snaz&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
All &amp;lt;code&amp;gt;b-&amp;lt;/code&amp;gt; commands require target line as last argument, all &amp;lt;code&amp;gt;s-&amp;lt;/code&amp;gt; commands require register to store result as first argument. All &amp;lt;code&amp;gt;br-&amp;lt;/code&amp;gt; commands require number to jump relatively as last argument. e.g. &amp;lt;code&amp;gt;breq a b 3&amp;lt;/code&amp;gt; means if a=b then jump to 3 lines after.&lt;br /&gt;
&lt;br /&gt;
All approximate functions require additional argument denoting how close two numbers need to be considered equal. E.g.: &amp;lt;code&amp;gt;sap r0 100 101 0.01&amp;lt;/code&amp;gt; will consider 100 and 101 almost equal (not more than 1%=0.01 different) and will set r0 to 1. The exact formula is &amp;lt;code&amp;gt;if abs(a - b) &amp;lt;= max(c * max(abs(a), abs(b)), float.epsilon * 8)&amp;lt;/code&amp;gt; for &amp;lt;code&amp;gt;-ap&amp;lt;/code&amp;gt; and is similar for other approximate functions.&lt;br /&gt;
&lt;br /&gt;
https://en.wikipedia.org/wiki/Machine_epsilon&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039;&lt;br /&gt;
  FLT_EPSILON = 2^(−23) ≈ 1.19e−07;        &amp;lt;span style=&amp;quot;color:blue;&amp;quot;&amp;gt;float (32 bit)&amp;lt;/span&amp;gt;&lt;br /&gt;
  DBL_EPSILON = 2^(−52) ≈ 2.20e−16;        &amp;lt;span style=&amp;quot;color:#4c9700;&amp;quot;&amp;gt;double (64 bit)&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
  &amp;lt;code&amp;gt;if abs(100 - 101) &amp;lt;= max(0.01 * max(abs(100), abs(101)), float.epsilon * 8)&amp;lt;/code&amp;gt;&lt;br /&gt;
  &amp;lt;code&amp;gt;if abs(-1) &amp;lt;= max(0.01 * 101), float.epsilon * 8)&amp;lt;/code&amp;gt;&lt;br /&gt;
  &amp;lt;code&amp;gt;if 1 &amp;lt;= max(0.01 * 101, float.epsilon * 8)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
  if 1 &amp;lt;= max(1.01, FLT_EPSILON * 8)&lt;br /&gt;
  if 1 &amp;lt;= max(1.01, DBL_EPSILON * 8)&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
  &amp;lt;span style=&amp;quot;color:blue;&amp;quot;&amp;gt;if 1 &amp;lt;= max(1.01, 1.19e−07 * 8)&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=&amp;quot;color:#4c9700;&amp;quot;&amp;gt;if 1 &amp;lt;= max(1.01, 2.20e−16 * 8)&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
  &amp;lt;span style=&amp;quot;color:blue;&amp;quot;&amp;gt;if 1 &amp;lt;= max(1.01, 0.000000952)&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=&amp;quot;color:#4c9700;&amp;quot;&amp;gt;if 1 &amp;lt;= max(1.01, 0.00000000000000176)&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
  &amp;lt;span style=&amp;quot;color:blue;&amp;quot;&amp;gt;if 1 &amp;lt;= 1.01   TRUE   1&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=&amp;quot;color:#4c9700;&amp;quot;&amp;gt;if 1 &amp;lt;= 1.01   TRUE   1&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Device Variables==&lt;br /&gt;
-----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Activate&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;Activate&lt;br /&gt;
:1 if device is activated (usually means running), otherwise 0&lt;br /&gt;
:&amp;lt;code&amp;gt;l r0 d0 Activate # sets r0 to 1 if on or 0 if off&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;AirRelease&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;AirRelease&lt;br /&gt;
&amp;lt;div id=&amp;quot;Charge&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;Charge&lt;br /&gt;
:    The current charge the device has.&lt;br /&gt;
&amp;lt;div id=&amp;quot;CLearMemory&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;ClearMemory&lt;br /&gt;
:    When set to 1, clears the counter memory (e.g. ExportCount).  Will set itself back to 0 when triggered.&lt;br /&gt;
&amp;lt;div id=&amp;quot;Color&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;Color&lt;br /&gt;
:    &amp;lt;span style=&amp;quot;color:blue;&amp;quot;&amp;gt;▇▇▇&amp;lt;/span&amp;gt;&amp;amp;nbsp; 0 (or lower) = Blue&lt;br /&gt;
:    &amp;lt;span style=&amp;quot;color:grey;&amp;quot;&amp;gt;▇▇▇&amp;lt;/span&amp;gt;&amp;amp;nbsp;1 = Grey &lt;br /&gt;
:    &amp;lt;span style=&amp;quot;color:green;&amp;quot;&amp;gt;▇▇▇&amp;lt;/span&amp;gt;&amp;amp;nbsp;2 = Green &lt;br /&gt;
:    &amp;lt;span style=&amp;quot;color:orange;&amp;quot;&amp;gt;▇▇▇&amp;lt;/span&amp;gt;&amp;amp;nbsp;3 = Orange &lt;br /&gt;
:    &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;▇▇▇&amp;lt;/span&amp;gt;&amp;amp;nbsp;4 = Red &lt;br /&gt;
:    &amp;lt;span style=&amp;quot;color:yellow;&amp;quot;&amp;gt;▇▇▇&amp;lt;/span&amp;gt;&amp;amp;nbsp;5 = Yellow &lt;br /&gt;
:    &amp;lt;span style=&amp;quot;color:white;&amp;quot;&amp;gt;▇▇▇&amp;lt;/span&amp;gt;&amp;amp;nbsp;6 = White &lt;br /&gt;
:    &amp;lt;span style=&amp;quot;color:black;&amp;quot;&amp;gt;▇▇▇&amp;lt;/span&amp;gt;&amp;amp;nbsp;7 = Black &lt;br /&gt;
:    &amp;lt;span style=&amp;quot;color:brown;&amp;quot;&amp;gt;▇▇▇&amp;lt;/span&amp;gt;&amp;amp;nbsp;8 = Brown &lt;br /&gt;
:    &amp;lt;span style=&amp;quot;color:khaki;&amp;quot;&amp;gt;▇▇▇&amp;lt;/span&amp;gt;&amp;amp;nbsp;9 = Khaki &lt;br /&gt;
:    &amp;lt;span style=&amp;quot;color:pink;&amp;quot;&amp;gt;▇▇▇&amp;lt;/span&amp;gt;&amp;amp;nbsp;10 = Pink &lt;br /&gt;
:    &amp;lt;span style=&amp;quot;color:purple;&amp;quot;&amp;gt;▇▇▇&amp;lt;/span&amp;gt;&amp;amp;nbsp;11 (or higher) = Purple &lt;br /&gt;
&amp;lt;div id=&amp;quot;CompletionRatio&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;CompletionRatio&lt;br /&gt;
&amp;lt;div id=&amp;quot;ElevatorLevel&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;ElevatorLevel&lt;br /&gt;
&amp;lt;div id=&amp;quot;ElevatorSpeed&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;ElevatorSpeed&lt;br /&gt;
&amp;lt;div id=&amp;quot;Error&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;Error&lt;br /&gt;
:	1 if device is in error state, otherwise 0&lt;br /&gt;
&amp;lt;div id=&amp;quot;ExportCount&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;ExportCount&lt;br /&gt;
:    How many items exporfted since last ClearMemory.&lt;br /&gt;
&amp;lt;div id=&amp;quot;Filtration&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;Filtration&lt;br /&gt;
:	The current state of the filtration system.  For example filtration = 1 for a Hardsuit when filtration is On.&lt;br /&gt;
&amp;lt;div id=&amp;quot;Harvest&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;Harvest&lt;br /&gt;
:	Performs the harvesting action for any plant based machinery.&lt;br /&gt;
:  &amp;lt;code&amp;gt;s d0 Harvest 1 # Performs 1 harvest action on device d0&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;Horizontal&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;Horizontal&lt;br /&gt;
&amp;lt;div id=&amp;quot;HorizontalRatio&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;HorizontalRatio&lt;br /&gt;
&amp;lt;div id=&amp;quot;Idle&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;Idle&lt;br /&gt;
&amp;lt;div id=&amp;quot;ImportCount&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;ImportCount&lt;br /&gt;
&amp;lt;div id=&amp;quot;Lock&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;Lock&lt;br /&gt;
&amp;lt;div id=&amp;quot;Maximum&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;Maximum&lt;br /&gt;
&amp;lt;div id=&amp;quot;Mode&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;Mode&lt;br /&gt;
&amp;lt;div id=&amp;quot;On&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;On&lt;br /&gt;
&amp;lt;div id=&amp;quot;Open&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;Open&lt;br /&gt;
&amp;lt;div id=&amp;quot;Output&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;Output&lt;br /&gt;
&amp;lt;div id=&amp;quot;Plant&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;Plant&lt;br /&gt;
:    Performs the planting operation for any plant based machinery.&lt;br /&gt;
:  &amp;lt;code&amp;gt;s d0 Plant 1 # Plants one crop in device d0&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;PositionX&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;PositionX&lt;br /&gt;
&amp;lt;div id=&amp;quot;PositionY&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;PositionY&lt;br /&gt;
&amp;lt;div id=&amp;quot;PositionZ&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;PositionZ&lt;br /&gt;
&amp;lt;div id=&amp;quot;Power&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;Power&lt;br /&gt;
&amp;lt;div id=&amp;quot;PowerActual&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;PowerActual&lt;br /&gt;
&amp;lt;div id=&amp;quot;PowerPotential&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;PowerPotential&lt;br /&gt;
&amp;lt;div id=&amp;quot;PowerRequired&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;PowerRequired&lt;br /&gt;
&amp;lt;div id=&amp;quot;Pressure&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;Pressure&lt;br /&gt;
&amp;lt;div id=&amp;quot;PressureExternal&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;PressureExternal&lt;br /&gt;
&amp;lt;div id=&amp;quot;PressureInteral&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;PressureInteral&lt;br /&gt;
&amp;lt;div id=&amp;quot;PressureSetting&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;PressureSetting&lt;br /&gt;
&amp;lt;div id=&amp;quot;Quantity&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;Quantity&lt;br /&gt;
:	Total quantity in the device.&lt;br /&gt;
&amp;lt;div id=&amp;quot;Ratio&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;Ratio&lt;br /&gt;
:	Context specific value depending on device, 0 to 1 based ratio.&lt;br /&gt;
&amp;lt;div id=&amp;quot;RatioCarbonDioxide&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;RatioCarbonDioxide&lt;br /&gt;
&amp;lt;div id=&amp;quot;RatioNitrogen&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;RatioNitrogen&lt;br /&gt;
:	The ratio of nitrogen in device atmosphere.&lt;br /&gt;
&amp;lt;div id=&amp;quot;RatioOxygen&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;RatioOxygen&lt;br /&gt;
:	The ratio of oxygen in device atmosphere.&lt;br /&gt;
&amp;lt;div id=&amp;quot;RatioPollutant&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;RatioPollutant&lt;br /&gt;
:	The ratio of pollutant in device atmosphere.&lt;br /&gt;
&amp;lt;div id=&amp;quot;RatioVolatiles&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;RatioVolatiles&lt;br /&gt;
:	The ratio of volatiles in device atmosphere.&lt;br /&gt;
&amp;lt;div id=&amp;quot;RatioWater&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;RatioWater&lt;br /&gt;
:	The ratio of water in device atmosphere.&lt;br /&gt;
&amp;lt;div id=&amp;quot;Reagents&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;Reagents&lt;br /&gt;
&amp;lt;div id=&amp;quot;RecipeHash&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;RecipeHash&lt;br /&gt;
&amp;lt;div id=&amp;quot;RequestHash&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;RequestHash&lt;br /&gt;
&amp;lt;div id=&amp;quot;RequiredPower&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;RequiredPower&lt;br /&gt;
&amp;lt;div id=&amp;quot;Setting&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;Setting&lt;br /&gt;
&amp;lt;div id=&amp;quot;SolarAngle&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;SolarAngle&lt;br /&gt;
:    Solar angle of the device.&lt;br /&gt;
:  &amp;lt;code&amp;gt;l r0 d0 SolarAngle # Sets r0 to the solar angle of d0.&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;Temperature&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;Temperature&lt;br /&gt;
&amp;lt;div id=&amp;quot;TemperatureSettings&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;TemperatureSettings&lt;br /&gt;
&amp;lt;div id=&amp;quot;TotalMoles&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;TotalMoles&lt;br /&gt;
&amp;lt;div id=&amp;quot;VelocityMagnitude&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;VelocityMagnitude&lt;br /&gt;
&amp;lt;div id=&amp;quot;VelocityRelativeX&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;VelocityRelativeX&lt;br /&gt;
&amp;lt;div id=&amp;quot;VelocityRelativeY&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;VelocityRelativeY&lt;br /&gt;
&amp;lt;div id=&amp;quot;VelocityRelativeZ&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;VelocityRelativeZ&lt;br /&gt;
&amp;lt;div id=&amp;quot;Vertical&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;Vertical&lt;br /&gt;
:	Vertical setting of the device.&lt;br /&gt;
&amp;lt;div id=&amp;quot;VerticalRatio&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;VerticalRatio&lt;br /&gt;
:	Ratio of vertical setting for device.&lt;br /&gt;
&amp;lt;div id=&amp;quot;Volume&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;Volume&lt;br /&gt;
:	Returns the device atmosphere volume&lt;br /&gt;
&lt;br /&gt;
==Slot Variables==&lt;br /&gt;
In general (always?) slots are assigned as follows.&lt;br /&gt;
:Slot 0: Import&lt;br /&gt;
:Slot 1: Export&lt;br /&gt;
:Slot 2: Inside Machine&lt;br /&gt;
-----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Occupied&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;Occupied&lt;br /&gt;
:&amp;lt;code&amp;gt;ls r0 d0 2 Occupied #Stores 1 in r0 if d0 has more seeds&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;ls vOccupied dThisVictim 2 Occupied #stores 1 in vOccupied if dThisVictim has more seeds&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;OccupantHash&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;OccupantHash&lt;br /&gt;
&amp;lt;div id=&amp;quot;Quantity&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;Quantity&lt;br /&gt;
&amp;lt;div id=&amp;quot;Damage&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;Damage&lt;br /&gt;
&amp;lt;div id=&amp;quot;Efficiency&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;Efficiency&lt;br /&gt;
&amp;lt;div id=&amp;quot;Health&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;Health&lt;br /&gt;
&amp;lt;div id=&amp;quot;Growth&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;Growth&lt;br /&gt;
:&amp;lt;code&amp;gt;ls r0 d0 0 Growth # Store the numerical growth stage of d0 in r0&amp;lt;/code&amp;gt; &lt;br /&gt;
&amp;lt;div id=&amp;quot;Pressure&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;Pressure&lt;br /&gt;
&amp;lt;div id=&amp;quot;Temperature&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;Temperature&lt;br /&gt;
&amp;lt;div id=&amp;quot;Charge&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;Charge&lt;br /&gt;
&amp;lt;div id=&amp;quot;ChargeRatio&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;ChargeRatio&lt;br /&gt;
&amp;lt;div id=&amp;quot;Class&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;Class&lt;br /&gt;
&amp;lt;div id=&amp;quot;PressureWaste&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;PressureWaste&lt;br /&gt;
&amp;lt;div id=&amp;quot;PressureAir&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;PressureAir&lt;br /&gt;
&amp;lt;div id=&amp;quot;MaxQuantity&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;MaxQuantity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Mature&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;Mature&lt;br /&gt;
:&amp;lt;code&amp;gt;ls r0 d0 0 Mature # Store 1 in r0 if d0 has a mature crop&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;ls vMature dThisVictim 0 Mature # Store 1 in vMature if dThisVictim has a mature crop&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=Examples=&lt;br /&gt;
Previous examples were obsolete due to game changes, or confusing, they have been moved into the Discussions section&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Harvie automation===&lt;br /&gt;
This script uses the batch instruction &amp;lt;code&amp;gt;sb ...&amp;lt;/code&amp;gt; to control all Harvie devices on the network. But only one Harvie and one Tray will be the &#039;&#039;master&#039;&#039; and have their values read, the rest of the Harvies will repeat exactly what this unit does. Some problems with this design is that different types of crops mature at different speeds, and if seeds were manually planted and the master unit recieved the first seed, the harvesting action will be performed too early on all the other plants since they are growing a few seconds slower.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; data-expandtext=&amp;quot;{{int:Expand, Automated Harvie Script}}&amp;quot; data-collapsetext=&amp;quot;{{int:Collapse, Automated Harvie Script}}&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
alias dHarvie d0&lt;br /&gt;
alias dTray d1&lt;br /&gt;
&lt;br /&gt;
alias rHarvieHash r8&lt;br /&gt;
alias rTrayHash r9&lt;br /&gt;
l rHarvieHash dHarvie PrefabHash&lt;br /&gt;
l rTrayHash dTray PrefabHash&lt;br /&gt;
&lt;br /&gt;
main:&lt;br /&gt;
yield&lt;br /&gt;
 #read plant data from the Tray&lt;br /&gt;
ls r0 dTray 0 Mature&lt;br /&gt;
 #harvestable plants return 1, young plants return 0&lt;br /&gt;
 #nothing planted returns -1&lt;br /&gt;
beq r0 -1 plantCrop&lt;br /&gt;
beq r0 1 harvestCrop&lt;br /&gt;
ls r0 dTray 0 Seeding&lt;br /&gt;
 #seeds available returns 1, all seeds picked returns 0&lt;br /&gt;
 #plants too young or old for seeds returns -1&lt;br /&gt;
beq r0 1 harvestCrop&lt;br /&gt;
j main&lt;br /&gt;
&lt;br /&gt;
plantCrop:&lt;br /&gt;
 #stop the planting if no seeds available&lt;br /&gt;
 #otherwise it will plant nothing repeatedly&lt;br /&gt;
ls r0 dHarvie 0 Occupied&lt;br /&gt;
beq r0 0 main&lt;br /&gt;
sb rHarvieHash Plant 1&lt;br /&gt;
j main&lt;br /&gt;
&lt;br /&gt;
harvestCrop:&lt;br /&gt;
sb rHarvieHash Harvest 1&lt;br /&gt;
j main&lt;br /&gt;
&lt;br /&gt;
### End Script ###&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
-----&lt;br /&gt;
&lt;br /&gt;
===Solar Panel 2-axis tracking===&lt;br /&gt;
This script was copied from the [[Solar_Logic_Circuits_Guide]] (code provided by bti, comments and readability changes by Fudd79)&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; data-expandtext=&amp;quot;{{int:Expand, Solar Panel 2-axis tracking}}&amp;quot; data-collapsetext=&amp;quot;{{int:Collapse, Solar Panel 2-axis tracking}}&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# This code assumes the following:&lt;br /&gt;
# Daylight Sensor data-port points north&lt;br /&gt;
# Solar Panel data-port points east&lt;br /&gt;
&lt;br /&gt;
alias sensor d0&lt;br /&gt;
alias v_angle r0&lt;br /&gt;
alias h_angle r1&lt;br /&gt;
alias sun_up r2&lt;br /&gt;
&lt;br /&gt;
define solar_panel_hash -539224550&lt;br /&gt;
define heavy_solar_panel_hash -1545574413&lt;br /&gt;
&lt;br /&gt;
start:&lt;br /&gt;
# Check to see if sun is up&lt;br /&gt;
l sun_up sensor Activate&lt;br /&gt;
# Go to reset if it&#039;s not&lt;br /&gt;
beqz sun_up reset&lt;br /&gt;
&lt;br /&gt;
# Calculate vertical angle&lt;br /&gt;
l v_angle sensor Vertical&lt;br /&gt;
div v_angle v_angle 1.5&lt;br /&gt;
sub v_angle 50 v_angle&lt;br /&gt;
&lt;br /&gt;
# Write vertical angle to all solar panels&lt;br /&gt;
sb solar_panel_hash Vertical v_angle&lt;br /&gt;
sb heavy_solar_panel_hash Vertical v_angle&lt;br /&gt;
&lt;br /&gt;
# Obtain horizontal angle&lt;br /&gt;
l h_angle sensor Horizontal&lt;br /&gt;
&lt;br /&gt;
# Write horizontal angle to all solar panels&lt;br /&gt;
sb solar_panel_hash Horizontal h_angle&lt;br /&gt;
sb heavy_solar_panel_hash Horizontal h_angle&lt;br /&gt;
&lt;br /&gt;
# Go to start again&lt;br /&gt;
yield&lt;br /&gt;
j start&lt;br /&gt;
&lt;br /&gt;
reset:&lt;br /&gt;
# Park solar panels vertically facing sunrise&lt;br /&gt;
sb solar_panel_hash Vertical 0&lt;br /&gt;
sb heavy_solar_panel_hash Vertical 0&lt;br /&gt;
# Park solar panels horizontally facing sunrise&lt;br /&gt;
sb solar_panel_hash Horizontal -90&lt;br /&gt;
sb heavy_solar_panel_hash Horizontal -90&lt;br /&gt;
# Wait 10 seconds&lt;br /&gt;
sleep 10&lt;br /&gt;
# Go to start again&lt;br /&gt;
j start&lt;br /&gt;
&lt;br /&gt;
### End Script ###&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
-----&lt;br /&gt;
&lt;br /&gt;
===Example experiment: how many lines of code are executed each tick?===&lt;br /&gt;
To determine this, a script without &amp;lt;code&amp;gt;yield&amp;lt;/code&amp;gt; will be used. It should have as few lines as possible (so no labels are used, but a reset value at the top will be needed) and count the number of lines, the IC Housing will be used to display the result.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
move r0 1   #the first line has number 0&lt;br /&gt;
add r0 r0 3&lt;br /&gt;
s db Setting r0&lt;br /&gt;
j 1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Result (the numbers appears every 0.5 seconds):&lt;br /&gt;
&amp;lt;br&amp;gt;127&lt;br /&gt;
&amp;lt;br&amp;gt;256 (+129)&lt;br /&gt;
&amp;lt;br&amp;gt;385 (+129)&lt;br /&gt;
&amp;lt;br&amp;gt;511 (+126)&lt;br /&gt;
&amp;lt;br&amp;gt;640 (+129)&lt;br /&gt;
&amp;lt;br&amp;gt;769 (+129)&lt;br /&gt;
&amp;lt;br&amp;gt;895 (+126)&lt;br /&gt;
&amp;lt;br&amp;gt;1024 (+129)&lt;br /&gt;
&amp;lt;br&amp;gt;1153 (+129)&lt;br /&gt;
&lt;br /&gt;
There is a repeating +129, +129, +126 sequence, a hint that the real value is 128. Which also happens to be the number of lines in a script, which makes sense. A variation of this experiment will show that empty rows are also counted towards this number.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
=Links=&lt;br /&gt;
----&lt;br /&gt;
* [https://stationeering.com/tools/ic] Stationeering.com offers a programmable circuits simulator so you can develop your code without repeatedly dying in game!&lt;br /&gt;
* [http://www.easy68k.com/] EASy68K is a 68000 Structured Assembly Language IDE.&lt;br /&gt;
* [https://marketplace.visualstudio.com/items?itemName=Traineratwot.stationeers-ic10] syntax highlighting for IC10 MIPS for Visual Studio Code (updated Feb 10th 2022)&lt;br /&gt;
* [https://pastebin.com/6Uw1KSRN] syntax highlighting for IC10 MIPS for KDE kwrite/kate text editor&lt;br /&gt;
* [https://drive.google.com/file/d/1yEsJ-u94OkuMQ8K6fY7Ja1HNpLcAdjo_/view] syntax highlighting for IC10 MIPS for Notepad++&lt;br /&gt;
* [https://pastebin.com/3kmGy0NN] syntax highlighting for IC10 MIPS for Notepad++ (updated: 05/05/2021)&lt;br /&gt;
* [https://drive.google.com/file/d/1Xrv5U0ZI5jDcPv7yX7EAAxaGk5hKP0xO/view?usp=sharing] syntax highlighting for IC10 MIPS for Notepad++ (updated: 11/08/2022)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=Index=&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|+Functions &lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
*[[#abs|abs]]&lt;br /&gt;
*[[#add|add]]&lt;br /&gt;
*[[#alias|alias]]&lt;br /&gt;
*[[#and|and]]&lt;br /&gt;
*[[#beq|beq]]&lt;br /&gt;
*[[#bgez|bgez]]&lt;br /&gt;
*[[#bgtz|bgtz]]&lt;br /&gt;
*[[#blez|blez]]&lt;br /&gt;
*[[#bltz|bltz]]&lt;br /&gt;
*[[#bne|bne]]&lt;br /&gt;
*[[#breq|breq]]&lt;br /&gt;
*[[#brgez|brgez]]&lt;br /&gt;
*[[#brgtz|brgtz]]&lt;br /&gt;
*[[#brlez|brlez]]&lt;br /&gt;
*[[#brltz|brltz]]&lt;br /&gt;
*[[#brne|brne]]&lt;br /&gt;
*[[#ceil|cell]]&lt;br /&gt;
*[[#div|div]]&lt;br /&gt;
*[[#exp|exp]]&lt;br /&gt;
*[[#floor|floor]]&lt;br /&gt;
*[[#j|j]]&lt;br /&gt;
*[[#jr|jr]]&lt;br /&gt;
*[[#l|l]]&lt;br /&gt;
*[[#log|log]]&lt;br /&gt;
*[[#ls|ls]]&lt;br /&gt;
*[[#max|max]]&lt;br /&gt;
*[[#min|min]]&lt;br /&gt;
*[[#mod|mod]]&lt;br /&gt;
*[[#move|move]]&lt;br /&gt;
*[[#mul|mul]]&lt;br /&gt;
*[[#nor|nor]]&lt;br /&gt;
*[[#or|or]]&lt;br /&gt;
*[[#rand|rand]]&lt;br /&gt;
*[[#round|round]]&lt;br /&gt;
*[[#s|s]]&lt;br /&gt;
*[[#slt|slt]]&lt;br /&gt;
*[[#sqrt|sqrt]]&lt;br /&gt;
*[[#sub|sub]]&lt;br /&gt;
*[[#trunc|trunc]]&lt;br /&gt;
*[[#xor|xor]]xor&lt;br /&gt;
*[[#yield|yield]]&lt;br /&gt;
*[[##|#]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|+Device Variables &lt;br /&gt;
&amp;lt;div  class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
*[[#Activate|Activate]]&lt;br /&gt;
*[[#AirRelease|AirRelease]]&lt;br /&gt;
*[[#Charge|Charge]]&lt;br /&gt;
*[[#CLearMemory|CLearMemory]]&lt;br /&gt;
*[[#Color|Color]]&lt;br /&gt;
*[[#CompletionRatio|CompletionRatio]]&lt;br /&gt;
*[[#ElevatorLevel|ElevatorLevel]]&lt;br /&gt;
*[[#ElevatorSpeed|ElevatorSpeed]]&lt;br /&gt;
*[[#Error|Error]]&lt;br /&gt;
*[[#ExportCount|ExportCount]]&lt;br /&gt;
*[[#Filtration|Filtration]]&lt;br /&gt;
*[[#Harvest|Harvest]]&lt;br /&gt;
*[[#Horizontal|Horizontal]]&lt;br /&gt;
*[[#HorizontalRatio|HorizontalRatio]]&lt;br /&gt;
*[[#Idle|Idle]]&lt;br /&gt;
*[[#ImportCount|ImportCount]]&lt;br /&gt;
*[[#Lock|Lock]]&lt;br /&gt;
*[[#Maximum|Maximum]]&lt;br /&gt;
*[[#Mode|Mode]]&lt;br /&gt;
*[[#On|On]]&lt;br /&gt;
*[[#Open|Open]]&lt;br /&gt;
*[[#Output|Output]]&lt;br /&gt;
*[[#Plant|Plant]]&lt;br /&gt;
*[[#PositionX|PositionX]]&lt;br /&gt;
*[[#PositionY|PositionY]]&lt;br /&gt;
*[[#PositionZ|PositionZ]]&lt;br /&gt;
*[[#Power|Power]]&lt;br /&gt;
*[[#PowerActual|PowerActual]]&lt;br /&gt;
*[[#PowerPotential|PowerPotential]]&lt;br /&gt;
*[[#PowerRequired|PowerRequired]]&lt;br /&gt;
*[[#Pressure|Pressure]]&lt;br /&gt;
*[[#PressureExternal|PressureExternal]]&lt;br /&gt;
*[[#PressureInteral|PressureInteral]]&lt;br /&gt;
*[[#PressureSetting|PressureSetting]]&lt;br /&gt;
*[[#Quantity|Quantity]]&lt;br /&gt;
*[[#Ratio|Ratio]]&lt;br /&gt;
*[[#RatioCarbonDioxide|RatioCarbonDioxide]]&lt;br /&gt;
*[[#RatioNitrogen|RatioNitrogen]]&lt;br /&gt;
*[[#RatioOxygen|RatioOxygen]]&lt;br /&gt;
*[[#RatioPollutant|RatioPollutant]]&lt;br /&gt;
*[[#RatioVolatiles|RatioVolatiles]]&lt;br /&gt;
*[[#RatioWater|RatioWater]]&lt;br /&gt;
*[[#Reagents|Reagents]]&lt;br /&gt;
*[[#RecipeHash|RecipeHash]]&lt;br /&gt;
*[[#RequestHash|RequestHash]]&lt;br /&gt;
*[[#RequiredPower|RequiredPower]]&lt;br /&gt;
*[[#Setting|Setting]]&lt;br /&gt;
*[[#SolarAngle|SolarAngle]]&lt;br /&gt;
*[[#Temperature|Temperature]]&lt;br /&gt;
*[[#TemperatureSettings|TemperatureSettings]]&lt;br /&gt;
*[[#TotalMoles|TotalMoles]]&lt;br /&gt;
*[[#VelocityMagnitude|VelocityMagnitude]]&lt;br /&gt;
*[[#VelocityRelativeX|VelocityRelativeX]]&lt;br /&gt;
*[[#VelocityRelativeY|VelocityRelativeY]]&lt;br /&gt;
*[[#VelocityRelativeZ|VelocityRelativeZ]]&lt;br /&gt;
*[[#Vertical|Vertical]]&lt;br /&gt;
*[[#VerticalRatio|VerticalRatio]]&lt;br /&gt;
*[[#Volume|Volume]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|+Slot Variables &lt;br /&gt;
&amp;lt;div  class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
*[[#Occupied|Occupied]]&lt;br /&gt;
*[[#OccupantHash|OccupantHash]]&lt;br /&gt;
*[[#Quantity|Quantity]]&lt;br /&gt;
*[[#Damage|Damage]]&lt;br /&gt;
*[[#Efficiency|Efficiency]]&lt;br /&gt;
*[[#Health|Health]]&lt;br /&gt;
*[[#Growth|Growth]]&lt;br /&gt;
*[[#Pressure|Pressure]]&lt;br /&gt;
*[[#Temperature|Temperature]]&lt;br /&gt;
*[[#Charge|Charge]]&lt;br /&gt;
*[[#ChargeRatio|ChargeRatio]]&lt;br /&gt;
*[[#Class|Class]]&lt;br /&gt;
*[[#PressureWaste|PressureWaste]]&lt;br /&gt;
*[[#PressureAir|PressureAir]]&lt;br /&gt;
*[[#MaxQuantity|MaxQuantity]]&lt;br /&gt;
*[[#Mature|Mature]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>2607:9000:2000:15:0:0:0:A45E</name></author>
	</entry>
	<entry>
		<id>https://stationeers-wiki.com/index.php?title=IC10&amp;diff=17171</id>
		<title>IC10</title>
		<link rel="alternate" type="text/html" href="https://stationeers-wiki.com/index.php?title=IC10&amp;diff=17171"/>
		<updated>2023-09-03T21:33:03Z</updated>

		<summary type="html">&lt;p&gt;2607:9000:2000:15:0:0:0:A45E: /* IO to Device registers */ typo&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:MIPS Programming]]&lt;br /&gt;
=MIPS scripting language for IC10 housings / chips=&lt;br /&gt;
MIPS is [[Stationeers]]&#039; in-game scripting language. It runs on [[Integrated Circuit (IC10)|IC10 chips]] crafted at the [[Electronics Printer]]. &lt;br /&gt;
&lt;br /&gt;
==Registers==&lt;br /&gt;
Internal registers &#039;&#039;&#039;r?&#039;&#039;&#039;: The IC contains 16 CPU registers, numbered &#039;&#039;&#039;r0&#039;&#039;&#039; to &#039;&#039;&#039;r15&#039;&#039;&#039;. From now on referred to as &#039;&#039;&#039;r?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Device registers &#039;&#039;&#039;d? logicType&#039;&#039;&#039;: Device registers are written to and from the IC. A device register is numbered &#039;&#039;&#039;d0&#039;&#039;&#039; to &#039;&#039;&#039;d5&#039;&#039;&#039; (select via screw), or &#039;&#039;&#039;db&#039;&#039;&#039; (connected device). From now on referred to as &#039;&#039;&#039;d?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== Logic and algoritmic with &#039;&#039;&#039;Internal registers&#039;&#039;&#039; ===&lt;br /&gt;
All calculations are exclusively performed to and from &#039;&#039;&#039;r?&#039;&#039;&#039; registers, or generally more understood as variables in programming. You can use aliases to give convinent names with the &amp;lt;code&amp;gt;alias string r?|d?&amp;lt;/code&amp;gt;command (see below). &lt;br /&gt;
&lt;br /&gt;
Internal registers can be manipulated in various ways. &lt;br /&gt;
* Write constant values &amp;lt;code&amp;gt;move r? (r?|num)&amp;lt;/code&amp;gt;: Example: &amp;lt;code&amp;gt;move r0 2&amp;lt;/code&amp;gt; sets r0 to the number 2.&lt;br /&gt;
* Calculate: Calculations are done to- and from these registers, like &amp;lt;code&amp;gt;add r? a(r?|num) b(r?|num)&amp;lt;/code&amp;gt;. Example: &amp;lt;code&amp;gt;add r1 r0 3&amp;lt;/code&amp;gt; adds 3 to r0, and writes to r1.&lt;br /&gt;
&lt;br /&gt;
Note, for any kind of if statements or loop behaviours, knowing about labels, branching, and jumps is essential knowledge. See below.&lt;br /&gt;
&lt;br /&gt;
=== IO to &#039;&#039;&#039;Device registers&#039;&#039;&#039; ===&lt;br /&gt;
Acronym &#039;&#039;&#039;d?&#039;&#039;&#039; stands for device, where ? is a number corresponding to the screw device selector on the socket.&lt;br /&gt;
You can also read/write to the device where the IC is planted in using device &#039;&#039;&#039;db&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Generally, there are up to 6 devices which can be set using the screwdriver &#039;&#039;&#039;d0&#039;&#039;&#039; to &#039;&#039;&#039;d5&#039;&#039;&#039;. A special decice register &#039;&#039;&#039;db&#039;&#039;&#039; is the device wherever the IC is mounted upon. Very convinent for atmospheric devices where no seperate IC socket is reguired.&lt;br /&gt;
&lt;br /&gt;
Note, the IC is completely unaware where d? is actually connected to. So if you get a logicType error, check d? number, or check if the screw has been set opn the socket. An allias is only convinent to convey what is expected to be set on the d? screw, it does not actually set or program the screq.&lt;br /&gt;
&lt;br /&gt;
* Read from device (load) &amp;lt;code&amp;gt;l d? logicType r?&amp;lt;/code&amp;gt;: Reads logicType, like Pressure from a [[Sensors|gas sensor]], from device d? to register r?. Values can be read from connected devices and put into the register using the &#039;&#039;&#039;l&#039;&#039;&#039; (load) command. For example, if you want to load the state of a door. &amp;lt;br&amp;gt; Example: &amp;lt;code&amp;gt;l r0 Door Open&amp;lt;/code&amp;gt; reads the &#039;Open&#039; field of an object named &#039;Door&#039;, that would be connected to the IC housing of the chip.&lt;br /&gt;
* Write to a device (set) &amp;lt;code&amp;gt;s d? logicType r?&amp;lt;/code&amp;gt;: Write a value from a register back to a device using the command &amp;lt;code&amp;gt;s d? logicType r?&amp;lt;/code&amp;gt;. For example, if d0 is set to a door using the screwdriver, &amp;lt;code&amp;gt;s d0 Open 0&amp;lt;/code&amp;gt; sets the &#039;Open&#039; status of the d0 (a door) to 0, effectively closing the door.&lt;br /&gt;
&lt;br /&gt;
=== batch IO to - &#039;&#039;&#039;Device registers&#039;&#039;&#039; ===&lt;br /&gt;
&#039;&#039;&#039;Batch writing&#039;&#039;&#039; needs to be done to a specific &#039;&#039;&#039;deviceHash&#039;&#039;&#039; instead of d?. Is unique per device type, which you can find in the [[Stationpedia]] entries.&lt;br /&gt;
* &amp;lt;code&amp;gt;lb r? deviceHash logicType batchMode&amp;lt;/code&amp;gt; &lt;br /&gt;
* &amp;lt;code&amp;gt;sb deviceHash logicType r?&amp;lt;/code&amp;gt;&lt;br /&gt;
Additionally, using the following batch commands, a &#039;&#039;&#039;nameHash&#039;&#039;&#039; can be provided to only modify devices with a certain name.&lt;br /&gt;
* &amp;lt;code&amp;gt;lbn r? deviceHash nameHash logicType batchMode &amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;sbn deviceHash nameHash logicType r?&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;batchMode&#039;&#039;&#039; is a parameter equal to 0, 1, 2, or 3. These are also defined as the constants &#039;&#039;&#039;Average&#039;&#039;&#039;, &#039;&#039;&#039;Sum&#039;&#039;&#039;, &#039;&#039;&#039;Minimum&#039;&#039;&#039;, and &#039;&#039;&#039;Maximum&#039;&#039;&#039; respectively. The word or number can be used.&lt;br /&gt;
&lt;br /&gt;
Combining one of these functions with the &amp;lt;code&amp;gt;HASH()&amp;lt;/code&amp;gt; function can be advantageous:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;lbn r0 HASH(&amp;quot;StructureGasSensor&amp;quot;) HASH(&amp;quot;Sensor 1&amp;quot;) Temperature Average&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code will load the average temperature of all gas sensors on the network named &amp;quot;Sensor 1&amp;quot; onto register &#039;&#039;&#039;r0&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here are some examples demonstrating all three operations:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;move r0 10&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;Sets register &#039;&#039;&#039;r0&#039;&#039;&#039; to the value 10&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;move r0 r1&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;Copies the value of register &#039;&#039;&#039;r1&#039;&#039;&#039; to register &#039;&#039;&#039;r0&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;l r0 d0 Temperature&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;Reads the Temperature parameter from device &#039;&#039;&#039;d0&#039;&#039;&#039; and places the value in register &#039;&#039;&#039;r0&#039;&#039;&#039;.&lt;br /&gt;
Note: not all devices have a Temperature parameter, check the in-game stationpedia.&lt;br /&gt;
&lt;br /&gt;
To set a device specific value (like &#039;&#039;&#039;On&#039;&#039;&#039;), you can write into this value.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;s d0 On r0&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;Writes the value from register &#039;&#039;&#039;r0&#039;&#039;&#039; out to &#039;&#039;&#039;On&#039;&#039;&#039; parameter of device &#039;&#039;&#039;d0&#039;&#039;&#039;. In this example the device will be turned On, if valve of register r0 equals 1, otherwise (register r0 equals 0) it will turned off. See section [[MIPS#Device_Variables|Device Variables]].&lt;br /&gt;
&lt;br /&gt;
It&#039;s recommended to use labels (like: &#039;&#039;someVariable&#039;&#039;) instead of a direct reference to the register. See &#039;&#039;&#039;alias&#039;&#039;&#039; in section [[MIPS#Instructions|Instructions]].&lt;br /&gt;
&lt;br /&gt;
=== Special registers ===&lt;br /&gt;
There are two more registers. One called &#039;&#039;&#039;ra&#039;&#039;&#039; (return address) and one called &#039;&#039;&#039;sp&#039;&#039;&#039; (stack pointer). The &#039;&#039;&#039;ra&#039;&#039;&#039; is used by certain jump and branching instructions (those ending with &#039;&#039;&#039;-al&#039;&#039;&#039;) to remember which line in the script it should return to. The &#039;&#039;&#039;sp&#039;&#039;&#039; tracks the next index within the stack (a memory that can store up to 512 values) to be pushed (written) to or popped (read) from. Neither &#039;&#039;&#039;ra&#039;&#039;&#039; or &#039;&#039;&#039;sp&#039;&#039;&#039; is protected, their values can be changed by instructions like any other register.&lt;br /&gt;
&lt;br /&gt;
==Stack Memory==&lt;br /&gt;
;push r?: adds the value of register &#039;&#039;&#039;r?&#039;&#039;&#039; to the stack memory at index &#039;&#039;&#039;sp&#039;&#039;&#039; and increments the &#039;&#039;&#039;sp&#039;&#039;&#039; by 1.&lt;br /&gt;
;pop r?: loads the value in the stack memory at index &amp;lt;code&amp;gt;sp-1&amp;lt;/code&amp;gt; into register &#039;&#039;&#039;r?&#039;&#039;&#039; and decrements the &#039;&#039;&#039;sp&#039;&#039;&#039; by 1.&lt;br /&gt;
;peek r?: loads the value in the stack memory at index &amp;lt;code&amp;gt;sp-1&amp;lt;/code&amp;gt; into register &#039;&#039;&#039;r?&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
As mentioned previously, &#039;&#039;&#039;sp&#039;&#039;&#039; can be both written to and read from any time. When reading (&#039;&#039;&#039;peek&#039;&#039;&#039; or &#039;&#039;&#039;pop&#039;&#039;&#039;), &#039;&#039;&#039;sp&#039;&#039;&#039; must be between 1 and 512, inclusive. While writing (&#039;&#039;&#039;push&#039;&#039;&#039;), &#039;&#039;&#039;sp&#039;&#039;&#039; must be between 0 and 511, inclusive.&lt;br /&gt;
&lt;br /&gt;
Stack memory is persistent on logic chips. This means that if you have a logic chip and push values to the stack, the code that pushes those values can be removed and the stack will retain those values.&lt;br /&gt;
&lt;br /&gt;
Note that this does not carry over to any other logic chips which receive the program of the original; They will need to have their stack memories programmed individually.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Stack Traversing&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Traversing the stack can be done similarly to how an array would be traversed in some other languages:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;nowiki /&amp;gt;#this will traverse indices {min value} through {max value} - 1&lt;br /&gt;
&lt;br /&gt;
move sp {min value}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
loop:&lt;br /&gt;
&lt;br /&gt;
add sp sp 1&lt;br /&gt;
&lt;br /&gt;
peek r0&lt;br /&gt;
&amp;lt;nowiki /&amp;gt;#do something here with your stack values (loaded into r0)&lt;br /&gt;
&lt;br /&gt;
blt sp {max value} loop&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki /&amp;gt;#continue on&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Alternatively, you can use the pop function&#039;s decrementing to make a more efficient loop:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
move sp {max value}&lt;br /&gt;
&lt;br /&gt;
add sp sp 1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
loop:&lt;br /&gt;
&lt;br /&gt;
pop r0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki /&amp;gt;#do something here with your stack values (loaded into r0)&lt;br /&gt;
&lt;br /&gt;
bgt sp {min value} loop&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki /&amp;gt;#continue on&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Device Ports==&lt;br /&gt;
ICs can interact with up to 6 other devices via d0 - d5, as well as the device it&#039;s attached to via db. To change or set a device, use a screwdriver and adjust the device in the IC housing. You can read or set any of the device&#039;s properties, so it is possible to do things like read the pressure or oxygen content of a room on the same Device port. &lt;br /&gt;
&lt;br /&gt;
Additionally, is possible to set other IC housings as devices, allowing you to create programs that run across multiple ICs together. For example, an Gas Mixing IC could check the &#039;&#039;&#039; Setting&#039;&#039;&#039;  field of a Atmosphere Sensor IC and act based on the value of the sensor chip.&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;l&#039;&#039;&#039; (load) or &#039;&#039;&#039;s&#039;&#039;&#039; (set) instructions you have to read or set these values to your device. Examples:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;l r0 d0 Temperature&amp;lt;/code&amp;gt; #Reads the &#039;&#039;&#039;Temperature&#039;&#039;&#039; from an atmosphere sensor at device port &#039;&#039;&#039;d0&#039;&#039;&#039; into register &#039;&#039;&#039;r0&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;s d1 Setting r0 &amp;lt;/code&amp;gt; # Writes the value of the register &#039;&#039;&#039;r0&#039;&#039;&#039; to the device on port &#039;&#039;&#039;d1&#039;&#039;&#039; into the variable &#039;&#039;&#039;Setting&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==Labels==&lt;br /&gt;
Labels are used to make it easier to jump between lines in the script. The label will have a numerical value that is the same as its line number. Even though it&#039;s possible to use a labels value for calculations, doing so is a bad idea since any changes to the code can change the line numbers of the labels.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;main:&amp;lt;/code&amp;gt; # define a jump mark with label &#039;&#039;&#039;main&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;j main&amp;lt;/code&amp;gt; # jumps back to &#039;&#039;&#039;main&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Constants==&lt;br /&gt;
Instead of using a register to store a fixed value, a constant can be made. Using this name will refer to the assigned value. With the help of Constants you can save register places.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;define pi 3.14159&amp;lt;/code&amp;gt; # defines a Constant with name &#039;&#039;&#039;pi&#039;&#039;&#039; and set it&#039;s value to 3.14159&lt;br /&gt;
&lt;br /&gt;
You can use these constants like any other variables (see: alias in section [[MIPS#Instructions|Instructions]]). Example:&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;move r0 pi&amp;lt;/code&amp;gt; # set the value of register &#039;&#039;&#039;r0&#039;&#039;&#039; to the value of constant named &#039;&#039;&#039;pi&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==Indirect referencing==&lt;br /&gt;
This is a way of accessing a register by using another register as a pointer. Adding an additional r infront of the register turns on this behaviour. The value stored in the register being used as the pointer must be between 0 to 15, this will then point to a register from r0 to r15, higher or lower values will cause an error.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;move r0 5&amp;lt;/code&amp;gt; stores the value 5 in r0&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;move rr0 10&amp;lt;/code&amp;gt; is now the same as &amp;lt;code&amp;gt;move r5 10&amp;lt;/code&amp;gt; since r0 has the value 5, rr0 points at the register r5&lt;br /&gt;
&lt;br /&gt;
Additional r&#039;s can be added to do indirect referencing multiple times in a row.&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;move r1 2&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;move r2 3&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;move rrr1 4&amp;lt;/code&amp;gt; is now the same as &amp;lt;code&amp;gt;move r3 4&amp;lt;/code&amp;gt; since r1 points at r2 which points at r3&lt;br /&gt;
&lt;br /&gt;
This also works with devices&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;move r0 2&amp;lt;/code&amp;gt; stores the value 2 in r0&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;s dr0 On 1&amp;lt;/code&amp;gt; is now the same as &amp;lt;code&amp;gt;s d2 On 1&amp;lt;/code&amp;gt;, r0 has the value 2 so dr0 points at d2&lt;br /&gt;
&lt;br /&gt;
==Comments==&lt;br /&gt;
Comments can be placed using a &#039;&#039;&#039;#&#039;&#039;&#039; symbol. All comments are ignored by the game when it reads commands. Below is an example of valid code with two comments.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; alias MyAlias r0 # Text after the hash tag will be ignored to the end of the line. &amp;lt;/code&amp;gt; &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt; # You can also write comments on their own lines, like this. &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Debugging advices==&lt;br /&gt;
The value stored in a register or variable can easily be displayed by writing it to the Setting parameter of the IC housing. This has no side effects. To see the value, just stand close to the IC housing and look directly at the housing.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;s db Setting r0&amp;lt;/code&amp;gt;. # sets/writes the value of register &#039;&#039;&#039;r0&#039;&#039;&#039; into the parameter &#039;&#039;&#039;Setting&#039;&#039;&#039; of the IC Housing(&#039;&#039;&#039;db&#039;&#039;&#039;)&lt;br /&gt;
&lt;br /&gt;
To check if a certain block of code is executed, use the above trick but with a random number that you choose, like the line number.&amp;lt;br&amp;gt; This example will display the number 137 on the IC housing.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;s db Setting 137&amp;lt;/code&amp;gt;  # sets/writes the number 137 into the parameter &#039;&#039;&#039;Setting&#039;&#039;&#039; of the IC Housing(&#039;&#039;&#039;db&#039;&#039;&#039;)&lt;br /&gt;
&lt;br /&gt;
Always use unique names for labels. When a label is named after a MIPS keyword like &amp;quot;Temperature:&amp;quot; or &amp;quot;Setting:&amp;quot; the original meaning of the keyword is overwritten, so when an instruction tries to use it an error will occur.&lt;br /&gt;
&lt;br /&gt;
A [[Cartridge#Configuration|configuration cartridge]] installed in a [[Handheld_Tablet|tablet]]  can be used to see all available values and configuration parameter for all devices you focus on.&lt;br /&gt;
&lt;br /&gt;
==Learning MIPS==&lt;br /&gt;
MIPS can be difficult to get started with. So here is a list of instructions that are useful for beginners. These can be used to write many different scripts.&lt;br /&gt;
&lt;br /&gt;
General:&lt;br /&gt;
* &amp;lt;code&amp;gt;alias&amp;lt;/code&amp;gt; make the script easier to read by assigning a name to a register or device, example: &amp;lt;code&amp;gt;alias rTemperature r15&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;label:&amp;lt;/code&amp;gt; where &amp;quot;label&amp;quot; can be replaced with almost any word, jump and branch instructions can use these in place of line numbers, example: &amp;lt;code&amp;gt;start:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;yield&amp;lt;/code&amp;gt; pause for 1-tick and then resume, if not used the script will automatically pause for 1-tick after 128 lines&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Jumps:&lt;br /&gt;
*&amp;lt;code&amp;gt;j someLabelName&amp;lt;/code&amp;gt; jump to line with &#039;&#039;&#039;someLabelName&#039;&#039;&#039;&lt;br /&gt;
*&amp;lt;code&amp;gt;jal someLabelName&amp;lt;/code&amp;gt; stores the next line number into the register ra (return address) and then jump to &#039;&#039;&#039;someLabelName&#039;&#039;&#039;&lt;br /&gt;
*&amp;lt;code&amp;gt;j ra&amp;lt;/code&amp;gt; jump to register ra (return address)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Branching (jump-if):&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;beq a(r?|num) b(r?|num) c(r?|num)&amp;lt;/code&amp;gt; if &#039;&#039;&#039;a&#039;&#039;&#039; is equal to &#039;&#039;&#039;b&#039;&#039;&#039; goto &#039;&#039;&#039;c&#039;&#039;&#039;  (label or linenumber) &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;bne a(r?|num) b(r?|num) c(r?|num)&amp;lt;/code&amp;gt; if  &#039;&#039;&#039;a&#039;&#039;&#039; not-equal &#039;&#039;&#039;b&#039;&#039;&#039; goto  &#039;&#039;&#039;c&#039;&#039;&#039; (label or linenumber) &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;bgt a(r?|num) b(r?|num) c(r?|num)&amp;lt;/code&amp;gt; if  &#039;&#039;&#039;a&#039;&#039;&#039; greater than &#039;&#039;&#039;b&#039;&#039;&#039; goto   &#039;&#039;&#039;c&#039;&#039;&#039; (label or linenumber) &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;blt a(r?|num) b(r?|num) c(r?|num)&amp;lt;/code&amp;gt; if  &#039;&#039;&#039;a&#039;&#039;&#039; less than &#039;&#039;&#039;b&#039;&#039;&#039; goto &#039;&#039;&#039;c&#039;&#039;&#039; (label or linenumber) &amp;lt;br&amp;gt;&lt;br /&gt;
The suffix -al can be added to each of these (example: beqal) to save the &#039;&#039;&#039;next&#039;&#039;&#039; line number into the &amp;quot;return address&amp;quot; register. this is called using &amp;lt;code&amp;gt;j ra&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Device interactions:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
l (load)&lt;br /&gt;
lb (load batch, requires one of the following: 0(Average) / 1(Sum) / 2(Minimum) / 3(Maximum))&lt;br /&gt;
ls (load slot)&lt;br /&gt;
s (store)&lt;br /&gt;
sb (store batch)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Logic and Math:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
seqz (common NOT-gate: turns 0 into 1, and all other values into 0)&lt;br /&gt;
move&lt;br /&gt;
add (addition)&lt;br /&gt;
sub (subtraction)&lt;br /&gt;
mul (multiplication)&lt;br /&gt;
div (division)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Common device variables:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
On (1 is on, 0 is off)&lt;br /&gt;
Open (1 is open, 0 is closed)&lt;br /&gt;
Setting (meaning varies between devices, example: a LED display(console) will show this value)&lt;br /&gt;
Activate (1 usually means running, example: a Daylight sensor is 1 when the sun shines on it)&lt;br /&gt;
Temperature (in Kelvin, Celsius - 273.15)&lt;br /&gt;
Pressure (in kPa)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;Notes:&lt;br /&gt;
&amp;lt;br&amp;gt;-All instructions and variables can be seen in-game in the MIPS editor window by clicking the &amp;quot;f&amp;quot;, &amp;quot;x&amp;quot; and &amp;quot;s(x)&amp;quot; buttons on the top right.&lt;br /&gt;
&amp;lt;br&amp;gt;-The stationpedia is the best source to see which variables are available to each device.&lt;br /&gt;
&amp;lt;br&amp;gt;-Most scripts are loops, they end with a jump instruction that leads back up to the start. Otherwise they will just run once and then stop.&lt;br /&gt;
&lt;br /&gt;
Two practice scripts:&lt;br /&gt;
&amp;lt;br&amp;gt;Automatic Night Light: Load &amp;quot;Activate&amp;quot; from a Daylight sensor, flip the value with a NOT-gate, store the value to the &amp;quot;On&amp;quot; variable of one or more lights.&lt;br /&gt;
&amp;lt;br&amp;gt;Automatic Wall Cooler: Read &amp;quot;Temperature&amp;quot; from a Gas Sensor. Branch if the value is greater than X, turn on the cooler. Branch if the value is less than Y, turn off the cooler. (Wall coolers need a minumum of 12.5 kPa pressure in the connected pipe)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=Instructions=&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;alias&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;alias&lt;br /&gt;
:alias str r? d? # labels register or device reference with name.  When alias is applied to a device, it will affect what shows on the screws in the IC base.  (housing)&lt;br /&gt;
&amp;lt;code&amp;gt;alias vTemperature r0&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;alias dAutoHydro1 d0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;move&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;move    &lt;br /&gt;
:d s     # stores the value of s in d&lt;br /&gt;
&amp;lt;code&amp;gt;move r0 42 # Store 42 in register 0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;l&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;load&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;l (load)&lt;br /&gt;
:l r# d# parameter&lt;br /&gt;
Reads from a device (d#) and stores the value in a register (r#)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;l r0 d0 Setting&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;Read from the device on d0 into register 0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;l r1 d5 Pressure&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;Read the pressure from a sensor&lt;br /&gt;
&lt;br /&gt;
This also works with aliases. For example:&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
alias Sensor d0 &amp;lt;br/&amp;gt;&lt;br /&gt;
l r0 Sensor Temperature&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;ls&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;load slot&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;ls (load slot)&lt;br /&gt;
:ls r# d# slotNum parameter&lt;br /&gt;
Reads from a slot (slotNum) of a device (d#)  and stores the value in a register (r#)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;ls r0 d0 2 Occupied&amp;lt;/code&amp;gt;&amp;lt;br&amp;gt;Read from the second slot of device on d0, stores 1 in r0 if it&#039;s occupied, 0 otherwise.&lt;br /&gt;
&lt;br /&gt;
And here is the code to read the charge of an AIMeE:&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
alias robot d0 &amp;lt;br/&amp;gt;&lt;br /&gt;
alias charge r0 &amp;lt;br/&amp;gt;&lt;br /&gt;
ls charge robot 0 Charge &lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;s&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;set&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;s (set)&lt;br /&gt;
:s d# parameter r#&lt;br /&gt;
Writes a setting to a device. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;s d0 Setting r0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;add&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;add     &lt;br /&gt;
:d s t   # calculates s + t and stores the result in d&lt;br /&gt;
&amp;lt;code&amp;gt;add r0 r1 1 # add 1 to r1 and store the result as r0&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;add r0 r0 1 # increment r0 by one&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;sub&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;sub     &lt;br /&gt;
:d s t   # calculates s - t and stores the result in d&lt;br /&gt;
&amp;lt;div id=&amp;quot;mul&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;mul     &lt;br /&gt;
:d s t   # calculates s * t and stores the result in d&lt;br /&gt;
&amp;lt;div id=&amp;quot;div&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;div     &lt;br /&gt;
:d s t   # calculates s / t and stores the result in d&lt;br /&gt;
&amp;lt;div id=&amp;quot;mod&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;mod     &lt;br /&gt;
:d s t   &lt;br /&gt;
::# calculates s mod t and stores the result in d. Note this&lt;br /&gt;
::# doesn&#039;t behave like the % operator - the result will be &lt;br /&gt;
::# positive even if the either of the operands are negative&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;slt&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;slt     &lt;br /&gt;
:d s t   # stores 1 in d if s &amp;lt; t, 0 otherwise&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;sqrt&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;sqrt    &lt;br /&gt;
:d s     # calculates sqrt(s) and stores the result in d&lt;br /&gt;
&amp;lt;div id=&amp;quot;round&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;round   &lt;br /&gt;
:d s     # finds the rounded value of s and stores the result in d&lt;br /&gt;
&amp;lt;div id=&amp;quot;trunc&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;trunc   &lt;br /&gt;
:d s     # finds the truncated value of s and stores the result in d&lt;br /&gt;
&amp;lt;div id=&amp;quot;ceil&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;ceil   &lt;br /&gt;
: d s     # calculates the ceiling of s and stores the result in d&lt;br /&gt;
&amp;lt;div id=&amp;quot;floor&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;floor  &lt;br /&gt;
: d s     # calculates the floor of s and stores the result in d&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;max&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;max    &lt;br /&gt;
: d s t   # calculates the maximum of s and t and stores the result in d&lt;br /&gt;
&amp;lt;div id=&amp;quot;min&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;min    &lt;br /&gt;
: d s t   # calculates the minimum of s and t and stores the result in d&lt;br /&gt;
&amp;lt;div id=&amp;quot;abs&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;abs    &lt;br /&gt;
: d s     # calculates the absolute value of s and stores the result in d&lt;br /&gt;
&amp;lt;div id=&amp;quot;log&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;log    &lt;br /&gt;
: d s     # calculates the natural logarithm of s and stores the result&lt;br /&gt;
::# in d&lt;br /&gt;
&amp;lt;div id=&amp;quot;exp&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;exp    &lt;br /&gt;
: d s     # calculates the exponential of s and stores the result in d&lt;br /&gt;
&amp;lt;div id=&amp;quot;rand&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;rand   &lt;br /&gt;
: d       # selects a random number uniformly at random between 0 and 1&lt;br /&gt;
::# inclusive and stores the result in d&lt;br /&gt;
&lt;br /&gt;
::# boolean arithmetic uses the C convention that 0 is false and any non-zero&lt;br /&gt;
::# value is true.&lt;br /&gt;
&amp;lt;div id=&amp;quot;and&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;and    &lt;br /&gt;
: d s t   # stores 1 in d if both s and t have non-zero values,&lt;br /&gt;
::# 0 otherwise&lt;br /&gt;
&amp;lt;div id=&amp;quot;or&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;or     &lt;br /&gt;
: d s t   # stores 1 in d if either s or t have non-zero values,&lt;br /&gt;
::# 0 otherwise&lt;br /&gt;
&amp;lt;div id=&amp;quot;xor&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;xor    &lt;br /&gt;
: d s t   # stores 1 in d if exactly one of s and t are non-zero,&lt;br /&gt;
::# 0 otherwise&lt;br /&gt;
&amp;lt;div id=&amp;quot;nor&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;nor &lt;br /&gt;
:    d s t   # stores 1 in d if both s and t equal zero, 0 otherwise&lt;br /&gt;
::# Lines are numbered starting at zero&lt;br /&gt;
&amp;lt;div id=&amp;quot;j&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;j&lt;br /&gt;
:             a # jumps to line a.&lt;br /&gt;
&amp;lt;div id=&amp;quot;bltz&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;bltz&lt;br /&gt;
:      s   a # jumps to line a if s &amp;lt;  0&lt;br /&gt;
&amp;lt;div id=&amp;quot;blez&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;blez &lt;br /&gt;
:     s   a # jumps to line a if s &amp;lt;= 0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;bgez&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;bgez &lt;br /&gt;
:     s   a # jumps to line a if s &amp;gt;= 0&lt;br /&gt;
&amp;lt;div id=&amp;quot;bgtz&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;bgtz&lt;br /&gt;
:      s   a # jumps to line a if s &amp;gt;  0&lt;br /&gt;
&amp;lt;div id=&amp;quot;beq&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;beq &lt;br /&gt;
:      s t a # jumps to line a if s == t&lt;br /&gt;
&amp;lt;div id=&amp;quot;bne&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;bne &lt;br /&gt;
:      s t a # jumps to line a if s != t&lt;br /&gt;
&amp;lt;div id=&amp;quot;bdseal&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;bdseal&lt;br /&gt;
:    d? a(r?|num) # Jump execution to line a and store current line number if device d? is set.&lt;br /&gt;
&amp;lt;code&amp;gt;bdseal d0 32 #Store line number and jump to line 32 if d0 is assigned.&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;BR&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;bdseal dThisVictim HarvestCrop #Store line in ra and jump to sub HarvestCrop if device dThisVictim is assigned.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;yield&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;yield           &lt;br /&gt;
: 	# ceases code execution for this power tick&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;lb&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;lb&lt;br /&gt;
:      r? deviceHash logicType batchMode # Loads LogicType from all output network devices with the provided type hash using the provided batch mode. Average (0), Sum (1), Minimum (2), Maximum (3). Can use either the word, or the number. The result is stored into r?.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;sb&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;sb&lt;br /&gt;
:      deviceHash logicType r? # Stores the register value to LogicType on all output network devices with the provided type hash.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;lbn&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;lbn&lt;br /&gt;
:      r? deviceHash nameHash logicType batchMode # Loads LogicType from all output network devices with the provided type and name hashes using provided batch mode. Average(0), Sum (1), Minimum (2), Maximum (3). Can use either the word, or the number. The result is stored into r?.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;sbn&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;sbn&lt;br /&gt;
:      deviceHash nameHash logicType r? # Stores the register value to LogicType on all output network devices with the provided type and name hashes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;#&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
; #&lt;br /&gt;
:     # The following text will be ignored during compiling; use this to create comments.&lt;br /&gt;
&lt;br /&gt;
[https://www.cs.tufts.edu/comp/140/lectures/Day_3/mips_summary.pdf Other examples]&lt;br /&gt;
&lt;br /&gt;
== Conditional functions cheatsheet ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! suffix !! description !! branch to line !! branch and store return address !! relative jump to line !! set register&lt;br /&gt;
|-&lt;br /&gt;
| prefix: ||  || b- || b-al || br- || s-&lt;br /&gt;
|-&lt;br /&gt;
|  || unconditional || j    || jal    || jr    || &lt;br /&gt;
|-&lt;br /&gt;
| -eq  || if a == b || beq  || beqal  || breq  || seq&lt;br /&gt;
|-&lt;br /&gt;
| -eqz || if a == 0 || beqz || beqzal || breqz || seqz&lt;br /&gt;
|-&lt;br /&gt;
| -ge  || if a &amp;gt;= b || bge  || bgeal  || brge  || sge&lt;br /&gt;
|-&lt;br /&gt;
| -gez || if a &amp;gt;= 0 || bgez || bgezal || brgez || sgez&lt;br /&gt;
|-&lt;br /&gt;
| -gt  || if a &amp;gt; b  || bgt  || bgtal  || brgt  || sgt&lt;br /&gt;
|-&lt;br /&gt;
| -gtz || if a &amp;gt; 0  || bgtz || bgtzal || brgtz || sgtz&lt;br /&gt;
|-&lt;br /&gt;
| -le  || if a &amp;lt;= b || ble  || bleal  || brle  || sle&lt;br /&gt;
|-&lt;br /&gt;
| -lez || if a &amp;lt;= 0 || blez || blezal || brlez || slez&lt;br /&gt;
|-&lt;br /&gt;
| -lt  || if a &amp;lt; b  || blt  || bltal  || brlt  || slt&lt;br /&gt;
|-&lt;br /&gt;
| -ltz || if a &amp;lt; 0  || bltz || bltzal || brltz || sltz&lt;br /&gt;
|-&lt;br /&gt;
| -ne  || if a != b || bne  || bneal  || brne  || sne&lt;br /&gt;
|-&lt;br /&gt;
| -nez || if a != 0 || bnez || bnezal || brnez || snez&lt;br /&gt;
|-&lt;br /&gt;
| -dns || if device d is not set          || bdns || bdnsal || brdns || sdns&lt;br /&gt;
|-&lt;br /&gt;
| -dse || if device d is set              || bdse || bdseal || brdse || sdse&lt;br /&gt;
|-&lt;br /&gt;
| -ap  || if a approximately equals b     || bap  || bapal  || brap  || sap&lt;br /&gt;
|-&lt;br /&gt;
| -apz || if a approximately equals 0     || bapz || bapzal || brapz || sapz&lt;br /&gt;
|-&lt;br /&gt;
| -na  || if a not approximately equals b || bna  || bnaal  || brna  || sna&lt;br /&gt;
|-&lt;br /&gt;
| -naz || if a not approximately equals 0 || bnaz || bnazal || brnaz || snaz&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
All &amp;lt;code&amp;gt;b-&amp;lt;/code&amp;gt; commands require target line as last argument, all &amp;lt;code&amp;gt;s-&amp;lt;/code&amp;gt; commands require register to store result as first argument. All &amp;lt;code&amp;gt;br-&amp;lt;/code&amp;gt; commands require number to jump relatively as last argument. e.g. &amp;lt;code&amp;gt;breq a b 3&amp;lt;/code&amp;gt; means if a=b then jump to 3 lines after.&lt;br /&gt;
&lt;br /&gt;
All approximate functions require additional argument denoting how close two numbers need to be considered equal. E.g.: &amp;lt;code&amp;gt;sap r0 100 101 0.01&amp;lt;/code&amp;gt; will consider 100 and 101 almost equal (not more than 1%=0.01 different) and will set r0 to 1. The exact formula is &amp;lt;code&amp;gt;if abs(a - b) &amp;lt;= max(c * max(abs(a), abs(b)), float.epsilon * 8)&amp;lt;/code&amp;gt; for &amp;lt;code&amp;gt;-ap&amp;lt;/code&amp;gt; and is similar for other approximate functions.&lt;br /&gt;
&lt;br /&gt;
https://en.wikipedia.org/wiki/Machine_epsilon&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039;&lt;br /&gt;
  FLT_EPSILON = 2^(−23) ≈ 1.19e−07;        &amp;lt;span style=&amp;quot;color:blue;&amp;quot;&amp;gt;float (32 bit)&amp;lt;/span&amp;gt;&lt;br /&gt;
  DBL_EPSILON = 2^(−52) ≈ 2.20e−16;        &amp;lt;span style=&amp;quot;color:#4c9700;&amp;quot;&amp;gt;double (64 bit)&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
  &amp;lt;code&amp;gt;if abs(100 - 101) &amp;lt;= max(0.01 * max(abs(100), abs(101)), float.epsilon * 8)&amp;lt;/code&amp;gt;&lt;br /&gt;
  &amp;lt;code&amp;gt;if abs(-1) &amp;lt;= max(0.01 * 101), float.epsilon * 8)&amp;lt;/code&amp;gt;&lt;br /&gt;
  &amp;lt;code&amp;gt;if 1 &amp;lt;= max(0.01 * 101, float.epsilon * 8)&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
  if 1 &amp;lt;= max(1.01, FLT_EPSILON * 8)&lt;br /&gt;
  if 1 &amp;lt;= max(1.01, DBL_EPSILON * 8)&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
  &amp;lt;span style=&amp;quot;color:blue;&amp;quot;&amp;gt;if 1 &amp;lt;= max(1.01, 1.19e−07 * 8)&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=&amp;quot;color:#4c9700;&amp;quot;&amp;gt;if 1 &amp;lt;= max(1.01, 2.20e−16 * 8)&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
  &amp;lt;span style=&amp;quot;color:blue;&amp;quot;&amp;gt;if 1 &amp;lt;= max(1.01, 0.000000952)&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=&amp;quot;color:#4c9700;&amp;quot;&amp;gt;if 1 &amp;lt;= max(1.01, 0.00000000000000176)&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
  &amp;lt;span style=&amp;quot;color:blue;&amp;quot;&amp;gt;if 1 &amp;lt;= 1.01   TRUE   1&amp;lt;/span&amp;gt;&lt;br /&gt;
  &amp;lt;span style=&amp;quot;color:#4c9700;&amp;quot;&amp;gt;if 1 &amp;lt;= 1.01   TRUE   1&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Device Variables==&lt;br /&gt;
-----&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Activate&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;Activate&lt;br /&gt;
:1 if device is activated (usually means running), otherwise 0&lt;br /&gt;
:&amp;lt;code&amp;gt;l r0 d0 Activate # sets r0 to 1 if on or 0 if off&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;AirRelease&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;AirRelease&lt;br /&gt;
&amp;lt;div id=&amp;quot;Charge&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;Charge&lt;br /&gt;
:    The current charge the device has.&lt;br /&gt;
&amp;lt;div id=&amp;quot;CLearMemory&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;ClearMemory&lt;br /&gt;
:    When set to 1, clears the counter memory (e.g. ExportCount).  Will set itself back to 0 when triggered.&lt;br /&gt;
&amp;lt;div id=&amp;quot;Color&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;Color&lt;br /&gt;
:    &amp;lt;span style=&amp;quot;color:blue;&amp;quot;&amp;gt;▇▇▇&amp;lt;/span&amp;gt;&amp;amp;nbsp; 0 (or lower) = Blue&lt;br /&gt;
:    &amp;lt;span style=&amp;quot;color:grey;&amp;quot;&amp;gt;▇▇▇&amp;lt;/span&amp;gt;&amp;amp;nbsp;1 = Grey &lt;br /&gt;
:    &amp;lt;span style=&amp;quot;color:green;&amp;quot;&amp;gt;▇▇▇&amp;lt;/span&amp;gt;&amp;amp;nbsp;2 = Green &lt;br /&gt;
:    &amp;lt;span style=&amp;quot;color:orange;&amp;quot;&amp;gt;▇▇▇&amp;lt;/span&amp;gt;&amp;amp;nbsp;3 = Orange &lt;br /&gt;
:    &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;▇▇▇&amp;lt;/span&amp;gt;&amp;amp;nbsp;4 = Red &lt;br /&gt;
:    &amp;lt;span style=&amp;quot;color:yellow;&amp;quot;&amp;gt;▇▇▇&amp;lt;/span&amp;gt;&amp;amp;nbsp;5 = Yellow &lt;br /&gt;
:    &amp;lt;span style=&amp;quot;color:white;&amp;quot;&amp;gt;▇▇▇&amp;lt;/span&amp;gt;&amp;amp;nbsp;6 = White &lt;br /&gt;
:    &amp;lt;span style=&amp;quot;color:black;&amp;quot;&amp;gt;▇▇▇&amp;lt;/span&amp;gt;&amp;amp;nbsp;7 = Black &lt;br /&gt;
:    &amp;lt;span style=&amp;quot;color:brown;&amp;quot;&amp;gt;▇▇▇&amp;lt;/span&amp;gt;&amp;amp;nbsp;8 = Brown &lt;br /&gt;
:    &amp;lt;span style=&amp;quot;color:khaki;&amp;quot;&amp;gt;▇▇▇&amp;lt;/span&amp;gt;&amp;amp;nbsp;9 = Khaki &lt;br /&gt;
:    &amp;lt;span style=&amp;quot;color:pink;&amp;quot;&amp;gt;▇▇▇&amp;lt;/span&amp;gt;&amp;amp;nbsp;10 = Pink &lt;br /&gt;
:    &amp;lt;span style=&amp;quot;color:purple;&amp;quot;&amp;gt;▇▇▇&amp;lt;/span&amp;gt;&amp;amp;nbsp;11 (or higher) = Purple &lt;br /&gt;
&amp;lt;div id=&amp;quot;CompletionRatio&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;CompletionRatio&lt;br /&gt;
&amp;lt;div id=&amp;quot;ElevatorLevel&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;ElevatorLevel&lt;br /&gt;
&amp;lt;div id=&amp;quot;ElevatorSpeed&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;ElevatorSpeed&lt;br /&gt;
&amp;lt;div id=&amp;quot;Error&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;Error&lt;br /&gt;
:	1 if device is in error state, otherwise 0&lt;br /&gt;
&amp;lt;div id=&amp;quot;ExportCount&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;ExportCount&lt;br /&gt;
:    How many items exporfted since last ClearMemory.&lt;br /&gt;
&amp;lt;div id=&amp;quot;Filtration&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;Filtration&lt;br /&gt;
:	The current state of the filtration system.  For example filtration = 1 for a Hardsuit when filtration is On.&lt;br /&gt;
&amp;lt;div id=&amp;quot;Harvest&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;Harvest&lt;br /&gt;
:	Performs the harvesting action for any plant based machinery.&lt;br /&gt;
:  &amp;lt;code&amp;gt;s d0 Harvest 1 # Performs 1 harvest action on device d0&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;Horizontal&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;Horizontal&lt;br /&gt;
&amp;lt;div id=&amp;quot;HorizontalRatio&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;HorizontalRatio&lt;br /&gt;
&amp;lt;div id=&amp;quot;Idle&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;Idle&lt;br /&gt;
&amp;lt;div id=&amp;quot;ImportCount&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;ImportCount&lt;br /&gt;
&amp;lt;div id=&amp;quot;Lock&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;Lock&lt;br /&gt;
&amp;lt;div id=&amp;quot;Maximum&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;Maximum&lt;br /&gt;
&amp;lt;div id=&amp;quot;Mode&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;Mode&lt;br /&gt;
&amp;lt;div id=&amp;quot;On&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;On&lt;br /&gt;
&amp;lt;div id=&amp;quot;Open&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;Open&lt;br /&gt;
&amp;lt;div id=&amp;quot;Output&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;Output&lt;br /&gt;
&amp;lt;div id=&amp;quot;Plant&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;Plant&lt;br /&gt;
:    Performs the planting operation for any plant based machinery.&lt;br /&gt;
:  &amp;lt;code&amp;gt;s d0 Plant 1 # Plants one crop in device d0&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;PositionX&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;PositionX&lt;br /&gt;
&amp;lt;div id=&amp;quot;PositionY&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;PositionY&lt;br /&gt;
&amp;lt;div id=&amp;quot;PositionZ&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;PositionZ&lt;br /&gt;
&amp;lt;div id=&amp;quot;Power&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;Power&lt;br /&gt;
&amp;lt;div id=&amp;quot;PowerActual&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;PowerActual&lt;br /&gt;
&amp;lt;div id=&amp;quot;PowerPotential&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;PowerPotential&lt;br /&gt;
&amp;lt;div id=&amp;quot;PowerRequired&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;PowerRequired&lt;br /&gt;
&amp;lt;div id=&amp;quot;Pressure&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;Pressure&lt;br /&gt;
&amp;lt;div id=&amp;quot;PressureExternal&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;PressureExternal&lt;br /&gt;
&amp;lt;div id=&amp;quot;PressureInteral&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;PressureInteral&lt;br /&gt;
&amp;lt;div id=&amp;quot;PressureSetting&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;PressureSetting&lt;br /&gt;
&amp;lt;div id=&amp;quot;Quantity&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;Quantity&lt;br /&gt;
:	Total quantity in the device.&lt;br /&gt;
&amp;lt;div id=&amp;quot;Ratio&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;Ratio&lt;br /&gt;
:	Context specific value depending on device, 0 to 1 based ratio.&lt;br /&gt;
&amp;lt;div id=&amp;quot;RatioCarbonDioxide&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;RatioCarbonDioxide&lt;br /&gt;
&amp;lt;div id=&amp;quot;RatioNitrogen&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;RatioNitrogen&lt;br /&gt;
:	The ratio of nitrogen in device atmosphere.&lt;br /&gt;
&amp;lt;div id=&amp;quot;RatioOxygen&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;RatioOxygen&lt;br /&gt;
:	The ratio of oxygen in device atmosphere.&lt;br /&gt;
&amp;lt;div id=&amp;quot;RatioPollutant&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;RatioPollutant&lt;br /&gt;
:	The ratio of pollutant in device atmosphere.&lt;br /&gt;
&amp;lt;div id=&amp;quot;RatioVolatiles&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;RatioVolatiles&lt;br /&gt;
:	The ratio of volatiles in device atmosphere.&lt;br /&gt;
&amp;lt;div id=&amp;quot;RatioWater&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;RatioWater&lt;br /&gt;
:	The ratio of water in device atmosphere.&lt;br /&gt;
&amp;lt;div id=&amp;quot;Reagents&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;Reagents&lt;br /&gt;
&amp;lt;div id=&amp;quot;RecipeHash&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;RecipeHash&lt;br /&gt;
&amp;lt;div id=&amp;quot;RequestHash&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;RequestHash&lt;br /&gt;
&amp;lt;div id=&amp;quot;RequiredPower&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;RequiredPower&lt;br /&gt;
&amp;lt;div id=&amp;quot;Setting&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;Setting&lt;br /&gt;
&amp;lt;div id=&amp;quot;SolarAngle&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;SolarAngle&lt;br /&gt;
:    Solar angle of the device.&lt;br /&gt;
:  &amp;lt;code&amp;gt;l r0 d0 SolarAngle # Sets r0 to the solar angle of d0.&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;Temperature&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;Temperature&lt;br /&gt;
&amp;lt;div id=&amp;quot;TemperatureSettings&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;TemperatureSettings&lt;br /&gt;
&amp;lt;div id=&amp;quot;TotalMoles&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;TotalMoles&lt;br /&gt;
&amp;lt;div id=&amp;quot;VelocityMagnitude&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;VelocityMagnitude&lt;br /&gt;
&amp;lt;div id=&amp;quot;VelocityRelativeX&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;VelocityRelativeX&lt;br /&gt;
&amp;lt;div id=&amp;quot;VelocityRelativeY&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;VelocityRelativeY&lt;br /&gt;
&amp;lt;div id=&amp;quot;VelocityRelativeZ&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;VelocityRelativeZ&lt;br /&gt;
&amp;lt;div id=&amp;quot;Vertical&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;Vertical&lt;br /&gt;
:	Vertical setting of the device.&lt;br /&gt;
&amp;lt;div id=&amp;quot;VerticalRatio&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;VerticalRatio&lt;br /&gt;
:	Ratio of vertical setting for device.&lt;br /&gt;
&amp;lt;div id=&amp;quot;Volume&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;Volume&lt;br /&gt;
:	Returns the device atmosphere volume&lt;br /&gt;
&lt;br /&gt;
==Slot Variables==&lt;br /&gt;
In general (always?) slots are assigned as follows.&lt;br /&gt;
:Slot 0: Import&lt;br /&gt;
:Slot 1: Export&lt;br /&gt;
:Slot 2: Inside Machine&lt;br /&gt;
-----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Occupied&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;Occupied&lt;br /&gt;
:&amp;lt;code&amp;gt;ls r0 d0 2 Occupied #Stores 1 in r0 if d0 has more seeds&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;ls vOccupied dThisVictim 2 Occupied #stores 1 in vOccupied if dThisVictim has more seeds&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;OccupantHash&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;OccupantHash&lt;br /&gt;
&amp;lt;div id=&amp;quot;Quantity&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;Quantity&lt;br /&gt;
&amp;lt;div id=&amp;quot;Damage&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;Damage&lt;br /&gt;
&amp;lt;div id=&amp;quot;Efficiency&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;Efficiency&lt;br /&gt;
&amp;lt;div id=&amp;quot;Health&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;Health&lt;br /&gt;
&amp;lt;div id=&amp;quot;Growth&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;Growth&lt;br /&gt;
:&amp;lt;code&amp;gt;ls r0 d0 0 Growth # Store the numerical growth stage of d0 in r0&amp;lt;/code&amp;gt; &lt;br /&gt;
&amp;lt;div id=&amp;quot;Pressure&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;Pressure&lt;br /&gt;
&amp;lt;div id=&amp;quot;Temperature&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;Temperature&lt;br /&gt;
&amp;lt;div id=&amp;quot;Charge&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;Charge&lt;br /&gt;
&amp;lt;div id=&amp;quot;ChargeRatio&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;ChargeRatio&lt;br /&gt;
&amp;lt;div id=&amp;quot;Class&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;Class&lt;br /&gt;
&amp;lt;div id=&amp;quot;PressureWaste&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;PressureWaste&lt;br /&gt;
&amp;lt;div id=&amp;quot;PressureAir&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;PressureAir&lt;br /&gt;
&amp;lt;div id=&amp;quot;MaxQuantity&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;MaxQuantity&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;Mature&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
;Mature&lt;br /&gt;
:&amp;lt;code&amp;gt;ls r0 d0 0 Mature # Store 1 in r0 if d0 has a mature crop&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;ls vMature dThisVictim 0 Mature # Store 1 in vMature if dThisVictim has a mature crop&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=Examples=&lt;br /&gt;
Previous examples were obsolete due to game changes, or confusing, they have been moved into the Discussions section&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Harvie automation===&lt;br /&gt;
This script uses the batch instruction &amp;lt;code&amp;gt;sb ...&amp;lt;/code&amp;gt; to control all Harvie devices on the network. But only one Harvie and one Tray will be the &#039;&#039;master&#039;&#039; and have their values read, the rest of the Harvies will repeat exactly what this unit does. Some problems with this design is that different types of crops mature at different speeds, and if seeds were manually planted and the master unit recieved the first seed, the harvesting action will be performed too early on all the other plants since they are growing a few seconds slower.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; data-expandtext=&amp;quot;{{int:Expand, Automated Harvie Script}}&amp;quot; data-collapsetext=&amp;quot;{{int:Collapse, Automated Harvie Script}}&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
alias dHarvie d0&lt;br /&gt;
alias dTray d1&lt;br /&gt;
&lt;br /&gt;
alias rHarvieHash r8&lt;br /&gt;
alias rTrayHash r9&lt;br /&gt;
l rHarvieHash dHarvie PrefabHash&lt;br /&gt;
l rTrayHash dTray PrefabHash&lt;br /&gt;
&lt;br /&gt;
main:&lt;br /&gt;
yield&lt;br /&gt;
 #read plant data from the Tray&lt;br /&gt;
ls r0 dTray 0 Mature&lt;br /&gt;
 #harvestable plants return 1, young plants return 0&lt;br /&gt;
 #nothing planted returns -1&lt;br /&gt;
beq r0 -1 plantCrop&lt;br /&gt;
beq r0 1 harvestCrop&lt;br /&gt;
ls r0 dTray 0 Seeding&lt;br /&gt;
 #seeds available returns 1, all seeds picked returns 0&lt;br /&gt;
 #plants too young or old for seeds returns -1&lt;br /&gt;
beq r0 1 harvestCrop&lt;br /&gt;
j main&lt;br /&gt;
&lt;br /&gt;
plantCrop:&lt;br /&gt;
 #stop the planting if no seeds available&lt;br /&gt;
 #otherwise it will plant nothing repeatedly&lt;br /&gt;
ls r0 dHarvie 0 Occupied&lt;br /&gt;
beq r0 0 main&lt;br /&gt;
sb rHarvieHash Plant 1&lt;br /&gt;
j main&lt;br /&gt;
&lt;br /&gt;
harvestCrop:&lt;br /&gt;
sb rHarvieHash Harvest 1&lt;br /&gt;
j main&lt;br /&gt;
&lt;br /&gt;
### End Script ###&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
-----&lt;br /&gt;
&lt;br /&gt;
===Solar Panel 2-axis tracking===&lt;br /&gt;
This script was copied from the [[Solar_Logic_Circuits_Guide]] (code provided by bti, comments and readability changes by Fudd79)&lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; data-expandtext=&amp;quot;{{int:Expand, Solar Panel 2-axis tracking}}&amp;quot; data-collapsetext=&amp;quot;{{int:Collapse, Solar Panel 2-axis tracking}}&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# This code assumes the following:&lt;br /&gt;
# Daylight Sensor data-port points north&lt;br /&gt;
# Solar Panel data-port points east&lt;br /&gt;
&lt;br /&gt;
alias sensor d0&lt;br /&gt;
alias v_angle r0&lt;br /&gt;
alias h_angle r1&lt;br /&gt;
alias sun_up r2&lt;br /&gt;
&lt;br /&gt;
define solar_panel_hash -539224550&lt;br /&gt;
define heavy_solar_panel_hash -1545574413&lt;br /&gt;
&lt;br /&gt;
start:&lt;br /&gt;
# Check to see if sun is up&lt;br /&gt;
l sun_up sensor Activate&lt;br /&gt;
# Go to reset if it&#039;s not&lt;br /&gt;
beqz sun_up reset&lt;br /&gt;
&lt;br /&gt;
# Calculate vertical angle&lt;br /&gt;
l v_angle sensor Vertical&lt;br /&gt;
div v_angle v_angle 1.5&lt;br /&gt;
sub v_angle 50 v_angle&lt;br /&gt;
&lt;br /&gt;
# Write vertical angle to all solar panels&lt;br /&gt;
sb solar_panel_hash Vertical v_angle&lt;br /&gt;
sb heavy_solar_panel_hash Vertical v_angle&lt;br /&gt;
&lt;br /&gt;
# Obtain horizontal angle&lt;br /&gt;
l h_angle sensor Horizontal&lt;br /&gt;
&lt;br /&gt;
# Write vertical angle to all solar panels&lt;br /&gt;
sb solar_panel_hash Horizontal h_angle&lt;br /&gt;
sb heavy_solar_panel_hash Horizontal h_angle&lt;br /&gt;
&lt;br /&gt;
# Go to start again&lt;br /&gt;
yield&lt;br /&gt;
j start&lt;br /&gt;
&lt;br /&gt;
reset:&lt;br /&gt;
# Park solar panels vertically facing sunrise&lt;br /&gt;
sb solar_panel_hash Vertical 0&lt;br /&gt;
sb heavy_solar_panel_hash Vertical 0&lt;br /&gt;
# Park solar panels horizontally facing sunrise&lt;br /&gt;
sb solar_panel_hash Horizontal -90&lt;br /&gt;
sb heavy_solar_panel_hash Horizontal -90&lt;br /&gt;
# Wait 10 seconds&lt;br /&gt;
sleep 10&lt;br /&gt;
# Go to start again&lt;br /&gt;
j start&lt;br /&gt;
&lt;br /&gt;
### End Script ###&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
-----&lt;br /&gt;
&lt;br /&gt;
===Example experiment: how many lines of code are executed each tick?===&lt;br /&gt;
To determine this, a script without &amp;lt;code&amp;gt;yield&amp;lt;/code&amp;gt; will be used. It should have as few lines as possible (so no labels are used, but a reset value at the top will be needed) and count the number of lines, the IC Housing will be used to display the result.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
move r0 1   #the first line has number 0&lt;br /&gt;
add r0 r0 3&lt;br /&gt;
s db Setting r0&lt;br /&gt;
j 1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Result (the numbers appears every 0.5 seconds):&lt;br /&gt;
&amp;lt;br&amp;gt;127&lt;br /&gt;
&amp;lt;br&amp;gt;256 (+129)&lt;br /&gt;
&amp;lt;br&amp;gt;385 (+129)&lt;br /&gt;
&amp;lt;br&amp;gt;511 (+126)&lt;br /&gt;
&amp;lt;br&amp;gt;640 (+129)&lt;br /&gt;
&amp;lt;br&amp;gt;769 (+129)&lt;br /&gt;
&amp;lt;br&amp;gt;895 (+126)&lt;br /&gt;
&amp;lt;br&amp;gt;1024 (+129)&lt;br /&gt;
&amp;lt;br&amp;gt;1153 (+129)&lt;br /&gt;
&lt;br /&gt;
There is a repeating +129, +129, +126 sequence, a hint that the real value is 128. Which also happens to be the number of lines in a script, which makes sense. A variation of this experiment will show that empty rows are also counted towards this number.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
=Links=&lt;br /&gt;
----&lt;br /&gt;
* [https://stationeering.com/tools/ic] Stationeering.com offers a programmable circuits simulator so you can develop your code without repeatedly dying in game!&lt;br /&gt;
* [http://www.easy68k.com/] EASy68K is a 68000 Structured Assembly Language IDE.&lt;br /&gt;
* [https://marketplace.visualstudio.com/items?itemName=Traineratwot.stationeers-ic10] syntax highlighting for IC10 MIPS for Visual Studio Code (updated Feb 10th 2022)&lt;br /&gt;
* [https://pastebin.com/6Uw1KSRN] syntax highlighting for IC10 MIPS for KDE kwrite/kate text editor&lt;br /&gt;
* [https://drive.google.com/file/d/1yEsJ-u94OkuMQ8K6fY7Ja1HNpLcAdjo_/view] syntax highlighting for IC10 MIPS for Notepad++&lt;br /&gt;
* [https://pastebin.com/3kmGy0NN] syntax highlighting for IC10 MIPS for Notepad++ (updated: 05/05/2021)&lt;br /&gt;
* [https://drive.google.com/file/d/1Xrv5U0ZI5jDcPv7yX7EAAxaGk5hKP0xO/view?usp=sharing] syntax highlighting for IC10 MIPS for Notepad++ (updated: 11/08/2022)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=Index=&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|+Functions &lt;br /&gt;
&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
*[[#abs|abs]]&lt;br /&gt;
*[[#add|add]]&lt;br /&gt;
*[[#alias|alias]]&lt;br /&gt;
*[[#and|and]]&lt;br /&gt;
*[[#beq|beq]]&lt;br /&gt;
*[[#bgez|bgez]]&lt;br /&gt;
*[[#bgtz|bgtz]]&lt;br /&gt;
*[[#blez|blez]]&lt;br /&gt;
*[[#bltz|bltz]]&lt;br /&gt;
*[[#bne|bne]]&lt;br /&gt;
*[[#breq|breq]]&lt;br /&gt;
*[[#brgez|brgez]]&lt;br /&gt;
*[[#brgtz|brgtz]]&lt;br /&gt;
*[[#brlez|brlez]]&lt;br /&gt;
*[[#brltz|brltz]]&lt;br /&gt;
*[[#brne|brne]]&lt;br /&gt;
*[[#ceil|cell]]&lt;br /&gt;
*[[#div|div]]&lt;br /&gt;
*[[#exp|exp]]&lt;br /&gt;
*[[#floor|floor]]&lt;br /&gt;
*[[#j|j]]&lt;br /&gt;
*[[#jr|jr]]&lt;br /&gt;
*[[#l|l]]&lt;br /&gt;
*[[#log|log]]&lt;br /&gt;
*[[#ls|ls]]&lt;br /&gt;
*[[#max|max]]&lt;br /&gt;
*[[#min|min]]&lt;br /&gt;
*[[#mod|mod]]&lt;br /&gt;
*[[#move|move]]&lt;br /&gt;
*[[#mul|mul]]&lt;br /&gt;
*[[#nor|nor]]&lt;br /&gt;
*[[#or|or]]&lt;br /&gt;
*[[#rand|rand]]&lt;br /&gt;
*[[#round|round]]&lt;br /&gt;
*[[#s|s]]&lt;br /&gt;
*[[#slt|slt]]&lt;br /&gt;
*[[#sqrt|sqrt]]&lt;br /&gt;
*[[#sub|sub]]&lt;br /&gt;
*[[#trunc|trunc]]&lt;br /&gt;
*[[#xor|xor]]xor&lt;br /&gt;
*[[#yield|yield]]&lt;br /&gt;
*[[##|#]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|+Device Variables &lt;br /&gt;
&amp;lt;div  class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
*[[#Activate|Activate]]&lt;br /&gt;
*[[#AirRelease|AirRelease]]&lt;br /&gt;
*[[#Charge|Charge]]&lt;br /&gt;
*[[#CLearMemory|CLearMemory]]&lt;br /&gt;
*[[#Color|Color]]&lt;br /&gt;
*[[#CompletionRatio|CompletionRatio]]&lt;br /&gt;
*[[#ElevatorLevel|ElevatorLevel]]&lt;br /&gt;
*[[#ElevatorSpeed|ElevatorSpeed]]&lt;br /&gt;
*[[#Error|Error]]&lt;br /&gt;
*[[#ExportCount|ExportCount]]&lt;br /&gt;
*[[#Filtration|Filtration]]&lt;br /&gt;
*[[#Harvest|Harvest]]&lt;br /&gt;
*[[#Horizontal|Horizontal]]&lt;br /&gt;
*[[#HorizontalRatio|HorizontalRatio]]&lt;br /&gt;
*[[#Idle|Idle]]&lt;br /&gt;
*[[#ImportCount|ImportCount]]&lt;br /&gt;
*[[#Lock|Lock]]&lt;br /&gt;
*[[#Maximum|Maximum]]&lt;br /&gt;
*[[#Mode|Mode]]&lt;br /&gt;
*[[#On|On]]&lt;br /&gt;
*[[#Open|Open]]&lt;br /&gt;
*[[#Output|Output]]&lt;br /&gt;
*[[#Plant|Plant]]&lt;br /&gt;
*[[#PositionX|PositionX]]&lt;br /&gt;
*[[#PositionY|PositionY]]&lt;br /&gt;
*[[#PositionZ|PositionZ]]&lt;br /&gt;
*[[#Power|Power]]&lt;br /&gt;
*[[#PowerActual|PowerActual]]&lt;br /&gt;
*[[#PowerPotential|PowerPotential]]&lt;br /&gt;
*[[#PowerRequired|PowerRequired]]&lt;br /&gt;
*[[#Pressure|Pressure]]&lt;br /&gt;
*[[#PressureExternal|PressureExternal]]&lt;br /&gt;
*[[#PressureInteral|PressureInteral]]&lt;br /&gt;
*[[#PressureSetting|PressureSetting]]&lt;br /&gt;
*[[#Quantity|Quantity]]&lt;br /&gt;
*[[#Ratio|Ratio]]&lt;br /&gt;
*[[#RatioCarbonDioxide|RatioCarbonDioxide]]&lt;br /&gt;
*[[#RatioNitrogen|RatioNitrogen]]&lt;br /&gt;
*[[#RatioOxygen|RatioOxygen]]&lt;br /&gt;
*[[#RatioPollutant|RatioPollutant]]&lt;br /&gt;
*[[#RatioVolatiles|RatioVolatiles]]&lt;br /&gt;
*[[#RatioWater|RatioWater]]&lt;br /&gt;
*[[#Reagents|Reagents]]&lt;br /&gt;
*[[#RecipeHash|RecipeHash]]&lt;br /&gt;
*[[#RequestHash|RequestHash]]&lt;br /&gt;
*[[#RequiredPower|RequiredPower]]&lt;br /&gt;
*[[#Setting|Setting]]&lt;br /&gt;
*[[#SolarAngle|SolarAngle]]&lt;br /&gt;
*[[#Temperature|Temperature]]&lt;br /&gt;
*[[#TemperatureSettings|TemperatureSettings]]&lt;br /&gt;
*[[#TotalMoles|TotalMoles]]&lt;br /&gt;
*[[#VelocityMagnitude|VelocityMagnitude]]&lt;br /&gt;
*[[#VelocityRelativeX|VelocityRelativeX]]&lt;br /&gt;
*[[#VelocityRelativeY|VelocityRelativeY]]&lt;br /&gt;
*[[#VelocityRelativeZ|VelocityRelativeZ]]&lt;br /&gt;
*[[#Vertical|Vertical]]&lt;br /&gt;
*[[#VerticalRatio|VerticalRatio]]&lt;br /&gt;
*[[#Volume|Volume]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|+Slot Variables &lt;br /&gt;
&amp;lt;div  class=&amp;quot;mw-collapsible mw-collapsed&amp;quot;&amp;gt;&lt;br /&gt;
*[[#Occupied|Occupied]]&lt;br /&gt;
*[[#OccupantHash|OccupantHash]]&lt;br /&gt;
*[[#Quantity|Quantity]]&lt;br /&gt;
*[[#Damage|Damage]]&lt;br /&gt;
*[[#Efficiency|Efficiency]]&lt;br /&gt;
*[[#Health|Health]]&lt;br /&gt;
*[[#Growth|Growth]]&lt;br /&gt;
*[[#Pressure|Pressure]]&lt;br /&gt;
*[[#Temperature|Temperature]]&lt;br /&gt;
*[[#Charge|Charge]]&lt;br /&gt;
*[[#ChargeRatio|ChargeRatio]]&lt;br /&gt;
*[[#Class|Class]]&lt;br /&gt;
*[[#PressureWaste|PressureWaste]]&lt;br /&gt;
*[[#PressureAir|PressureAir]]&lt;br /&gt;
*[[#MaxQuantity|MaxQuantity]]&lt;br /&gt;
*[[#Mature|Mature]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>2607:9000:2000:15:0:0:0:A45E</name></author>
	</entry>
	<entry>
		<id>https://stationeers-wiki.com/index.php?title=Pipe_Volume_Pump&amp;diff=17161</id>
		<title>Pipe Volume Pump</title>
		<link rel="alternate" type="text/html" href="https://stationeers-wiki.com/index.php?title=Pipe_Volume_Pump&amp;diff=17161"/>
		<updated>2023-09-03T14:22:09Z</updated>

		<summary type="html">&lt;p&gt;2607:9000:2000:15:0:0:0:A45E: valve only goes up to 10 in-game&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Atmospherics]]&lt;br /&gt;
&amp;lt;languages /&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
{{Itembox&lt;br /&gt;
 | name        = Pipe Volume Pump&lt;br /&gt;
 | image       = [[File:ItemPipeVolumePump.png]]&lt;br /&gt;
 | stacks      = 5&lt;br /&gt;
 | createdwith = [[Hydraulic Pipe Bender]], [[Fabricator]]&lt;br /&gt;
 | cost        = 5g [[Iron]], 2g [[Gold]], 3g [[Copper]]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Description == &amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
Used to pump gasses throughout a pipe, featuring an adjustable valve 0-10 Liters and requiring power (2W per Liter). All the gasses in the pipes behind it will be completely pushed in front of it when powered, and blocks any flow of gasses in either direction when unpowered.&lt;br /&gt;
&lt;br /&gt;
Note that valve settings are for the rate at which the pump operates, in volume per tick (0.5 seconds).&lt;br /&gt;
&lt;br /&gt;
To calculate the moles per tick, use the following equation:&lt;br /&gt;
n = (P * V) / (R * T)&lt;br /&gt;
&lt;br /&gt;
Where:&lt;br /&gt;
* P = Input pressure&lt;br /&gt;
* V = The volume you set&lt;br /&gt;
* n = Moles per tick&lt;br /&gt;
* R = Gas constant (8.3144)&lt;br /&gt;
* T = Input temperature (in Kelvin)&lt;br /&gt;
&lt;br /&gt;
{{Data Network Header}}&lt;br /&gt;
&lt;br /&gt;
{{Data Parameters}}&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Parameter Name !! Data Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| Lock || Boolean || &lt;br /&gt;
|-&lt;br /&gt;
| Setting || Integer || Sets the flow rate between 0 - 100 Liters&lt;br /&gt;
|-&lt;br /&gt;
| On || Boolean || &lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{{Data Outputs}}&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Output Name !! Data Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| Maximum || &lt;br /&gt;
|-&lt;br /&gt;
| Lock || Boolean ||&lt;br /&gt;
|-&lt;br /&gt;
| Error || &lt;br /&gt;
|-&lt;br /&gt;
| Setting || &lt;br /&gt;
|-&lt;br /&gt;
| RequiredPower || &lt;br /&gt;
|-&lt;br /&gt;
| Ratio ||&lt;br /&gt;
|-&lt;br /&gt;
| PrefabHash || &lt;br /&gt;
|-&lt;br /&gt;
| Power || &lt;br /&gt;
|-&lt;br /&gt;
| On ||&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;/div&gt;</summary>
		<author><name>2607:9000:2000:15:0:0:0:A45E</name></author>
	</entry>
	<entry>
		<id>https://stationeers-wiki.com/index.php?title=Guide_(Airlock)_Atmosphere_to_Atmosphere&amp;diff=17160</id>
		<title>Guide (Airlock) Atmosphere to Atmosphere</title>
		<link rel="alternate" type="text/html" href="https://stationeers-wiki.com/index.php?title=Guide_(Airlock)_Atmosphere_to_Atmosphere&amp;diff=17160"/>
		<updated>2023-09-03T14:20:15Z</updated>

		<summary type="html">&lt;p&gt;2607:9000:2000:15:0:0:0:A45E: /* Troubleshooting */ typo&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Guides]][[Category:Atmospherics]]&lt;br /&gt;
&amp;lt;languages/&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==Description==&lt;br /&gt;
An Atmosphere to Atmosphere Airlock is a [[Room]] that can evacuate its internal volume and refill it with either of the two differing [[Atmosphere]]s it connects. It has two airtight [[Portal]]s which do not open simultaneously. An Atmosphere to Atmosphere Airlock allows passage between two environments without the exchange of [[Gas]]es or [[Pressure]].&lt;br /&gt;
&lt;br /&gt;
An Atmosphere to Atmosphere Airlock can be controlled automatically using a [[Circuitboard (Advanced Airlock)]] installed within a [[Console]] which will refer to each of the two separated environments as either &amp;quot;interior&amp;quot; or &amp;quot;exterior&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
When activated with the interior-portal open, the system will automatically close the interior-portal and will activate the interior-[[Active Vent|Active-Vent]] to try to evacuate the interior-atmosphere from the airlock chamber. Once a total vacuum is achieved within all of the [[Large Grid Atmosphere|Large Grid Volume]]s in which selected [[Gas Sensor]]s reside, the airlock will activate the exterior-Active-Vent to try to pressurize the chamber with exterior-atmosphere. Only after the internal pressure within all of the Large Grid Volumes in which selected Gas Sensors reside equals or exceeds the &amp;quot;External ###Pa&amp;quot; specified in the [[Circuitboard (Advanced Airlock)#Settings|Circuitboard&#039;s settings]] will the exterior-portal automatically open. &lt;br /&gt;
&lt;br /&gt;
When activated with the exterior-portal open, a similar process to the above is executed, swapping interior for exterior, exterior for interior, and the final airlock pressure governed by the &amp;quot;Internal ###Pa&amp;quot; setting instead.&lt;br /&gt;
&lt;br /&gt;
==Materials==&lt;br /&gt;
Material requirements for a minimnum Atmosphere to Atmosphere Airlock are:&lt;br /&gt;
* 2 x [[Portal]]: variants of either [[Kit (Airlock)]], [[Kit (Blast Door)]], [[Kit (Door)]], or [[Kit (Docking Port)]]&lt;br /&gt;
* 1 x [[Kit (Consoles) Console|Kit (Consoles) Console]] &lt;br /&gt;
* 1 x [[Circuitboard (Advanced Airlock)]]&lt;br /&gt;
* 1 x [[Glass Sheets]]&lt;br /&gt;
* 1 x [[Data Disk]]&lt;br /&gt;
* 1 x [[Kit (Sensors) Gas Sensor]]&lt;br /&gt;
* 2 x [[Kit (Active Vent)]]&lt;br /&gt;
* 2 x [[Kit (Passive Vent)]] (optional)&lt;br /&gt;
* 1 x [[Kit (Flashing Light)]] (optional)&lt;br /&gt;
* 1 x [[Kit (Power Controller)]] (optional)&lt;br /&gt;
* 4 x [[Kit (Pipe)]]&lt;br /&gt;
* # x [[Cable Coil]]&lt;br /&gt;
&lt;br /&gt;
==Construction==&lt;br /&gt;
A minimum Atmosphere to Atmosphere Airlock can be constructed using the following instructions:&lt;br /&gt;
&lt;br /&gt;
# Place two [[Portal]]s one [[Large Grid]] apart with the power and data ports facing into the airlock&#039;s interior.&lt;br /&gt;
# Using the [[Labeller]], rename each portal as &amp;quot;Interior-Door&amp;quot; and &amp;quot;Exterior-Door&amp;quot; appropriately.&lt;br /&gt;
# Ensure the &amp;quot;Exterior-Door&amp;quot; is OPEN, and the &amp;quot;Interior-Door&amp;quot; is CLOSED.&lt;br /&gt;
# Enclose the four remaining sides of the airlock chamber with airtight [[Frames]], [[Walls]], or [[Windows]].&lt;br /&gt;
# Place [[Console]], [[Active Vent]]s, [[Gas Sensor]], and optional [[Flashing Light]] and [[Power Controller]] somewhere within the airlock&#039;s interior.&lt;br /&gt;
# Ensure all placed devices are attached to the same [[Wire Network]] including the portals&#039; power and data ports.&lt;br /&gt;
# Ensure the airlock&#039;s wire network is connected to an active [[Power Supply]] and all devices can receive power.&lt;br /&gt;
# Using the Labeller, rename each Active Vent as &amp;quot;Interior Vent&amp;quot; and &amp;quot;Exterior Vent&amp;quot; appropriately.&lt;br /&gt;
# Attach a [[Pipe Network]] to each Active Vent large enough to hold the volume of the airlock or pass it through to a [[Passive Vent]] placed in the &amp;quot;interior&amp;quot; or &amp;quot;exterior&amp;quot; environment. &lt;br /&gt;
# Ensure &amp;quot;interior&amp;quot; and &amp;quot;exterior&amp;quot; pipe networks are not connected together or to any other pipe networks.[[File:Guide adv airlock bare.jpg|thumb|advanced airlock with 2 walls removed for better visibility]]&lt;br /&gt;
# Insert [[Circuitboard (Advanced Airlock)]] into the console, then place the [[Glass Sheet]] onto the console.&lt;br /&gt;
# Insert [[Data Disk]] into the side slot of Console then power on the Console.[[File:Guide adv airlock config0.png|thumb|slot to insert data disk]]&lt;br /&gt;
# &#039;&#039;&#039;The following steps may be done with the game paused.&#039;&#039;&#039;&lt;br /&gt;
# Use the console&#039;s up and down arrows to scroll through the list of devices. Click to select. Click again to deselect if incorrect&lt;br /&gt;
# Find and click &amp;quot;Exterior-Door&amp;quot; followed by all caps and green &amp;quot;EXTERIOR&amp;quot;. NOTE: SELECT THIS FIRST![[File:Guide adv airlock config1.png|thumb|make sure to click the exterior door and vent first]]&lt;br /&gt;
# Ensure the Exterior-Door&#039;s lock-indicator has turned from green to red.&lt;br /&gt;
# Find and click &amp;quot;Exterior-Vent&amp;quot; followed by all caps and green &amp;quot;EXTERIOR&amp;quot;. NOTE: SELECT THIS SECOND!&lt;br /&gt;
# Find and click &amp;quot;Interior-Door&amp;quot; followed by all caps and green &amp;quot;INTERIOR&amp;quot;.&lt;br /&gt;
# Ensure the Interior-Door&#039;s lock-indicator has turned from green to red.&lt;br /&gt;
# Find and click &amp;quot;Interior-Vent&amp;quot; followed by all caps and green &amp;quot;INTERIOR&amp;quot;.&lt;br /&gt;
# Find and click &amp;quot;Gas Sensor&amp;quot; followed by all caps and green &amp;quot;SENSOR&amp;quot;.&lt;br /&gt;
# Find and click &amp;quot;Flashing Light&amp;quot; followed by all caps and green &amp;quot;LIGHT&amp;quot;. (optional)&lt;br /&gt;
# Toward the top left of the Console find and click &amp;quot;External ###Pa&amp;quot;. Set to match the exterior-environment&#039;s typical pressure. (optional)&lt;br /&gt;
# Toward the top right of the Console find and click &amp;quot;Internal ###Pa&amp;quot;. Set to match the interior-environment&#039;s typical pressure. (optional)[[File:Guide adv airlock config3.png|thumb|set pressures appropriate to each side]]&lt;br /&gt;
# Remove Data Disk from the side slot of Console.&lt;br /&gt;
&amp;lt;br&amp;gt;If there is an error the console screen will say so and the power light will flash yellow.&lt;br /&gt;
&lt;br /&gt;
==Console Slaves==&lt;br /&gt;
Additional consoles are useful when airlocks become large or remote control is desired. Multiple [[Circuitboard (Advanced Airlock)#Console Slave|Console Slave]]s can be attached using the following instructions:&lt;br /&gt;
&lt;br /&gt;
# Using the [[Labeller]], rename the original [[Console]] as &amp;quot;Master Console&amp;quot;.&lt;br /&gt;
# Place additional consoles such that they all attached to the same [[Wire Network]] connected to the &amp;quot;Master Console&amp;quot;.&lt;br /&gt;
# Using the Labeller, rename each additional console as &amp;quot;Slave Console 1&amp;quot;, &amp;quot;Slave Console 2&amp;quot; ...&lt;br /&gt;
# Insert [[Circuitboard (Advanced Airlock)]] into each additional console, then place a [[Glass Sheet]] onto the additional consoles.&lt;br /&gt;
# Insert [[Data Disk]] into the side slot of the powered on &amp;quot;Master Console&amp;quot;.&lt;br /&gt;
# Use the &amp;quot;Master Console&#039;s&amp;quot; up and down arrows to scroll through the list of devices. Click to select. Click again to deselect if incorrect&lt;br /&gt;
# Find and click &amp;quot;Slave Console #&amp;quot; followed by all caps and green &amp;quot;MAKE SLAVE&amp;quot; for each additional console.&lt;br /&gt;
# Remove Data Disk from the side slot of &amp;quot;Master Console&amp;quot;.&lt;br /&gt;
# Power on each additional console.&lt;br /&gt;
&amp;lt;br&amp;gt;If there is an error the console screen will say so and the power light will flash yellow.&lt;br /&gt;
&lt;br /&gt;
==Troubleshooting==&lt;br /&gt;
When powered, all associated doors and vents are locked, preventing their manual use even when power is subsequently denied. This can be a problem when trapped within an airlock during a power outage. Best practise is to ensure the airlock&#039;s wire network is connected to an emergency [[Power Supply]] such as a [[Battery Cell]] equipped [[Power Controller]].&lt;br /&gt;
&lt;br /&gt;
If the &amp;quot;External #Pa&amp;quot; or &amp;quot;Internal #Pa&amp;quot; are set to 0, the corresponding pressurization phase will be skipped, speeding up the cycle time, but can result in large wind currents when doors open.&lt;br /&gt;
&lt;br /&gt;
A pressurization phase will stall if there is not enough gas available to the interior or exterior [[Active Vent]] to reach the set &amp;quot;Internal #Pa&amp;quot; or &amp;quot;External #Pa&amp;quot; specified in the [[Circuitboard (Advanced Airlock)#Settings|Circuitboard&#039;s settings]]. Such stalled pressurization can be skipped by clicking the yellow &amp;quot;Cancel Pressurize&amp;quot; button on a console.&lt;br /&gt;
&lt;br /&gt;
A depressurization phase will stall if a complete vacuum cannot be achieved within the [[Large Grid Atmosphere|Large Grid Volume]]s in which all selected [[Gas Sensor]]s reside. Such stalled depressurization can be skipped by clicking the yellow &amp;quot;Cancel Depressurize&amp;quot; button on a console, but atmospheric mixing may occur. In larger airlocks, ensure there is one Gas Sensor per Large Grid to prevent premature repressurization and the resulting mixture of interior and exterior atmospheres.&lt;br /&gt;
&lt;br /&gt;
The setup of slave consoles &amp;lt;em&amp;gt;may&amp;lt;/em&amp;gt; still be bugged in such a way that after initial setup the slave console will show the config of an airlock, but be grayed out and not accept any input. It has been noted in several community posts that saving the game, quitting out of the game, and then reloading the save will allow the slave consoles to work after the reload.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
* [[Guide (Airlock)]]&lt;br /&gt;
* [[Guide (Airlock) Atmosphere to Vacuum]]&lt;br /&gt;
* [[Guide (Airlock) Docking Ports]]&lt;br /&gt;
&lt;br /&gt;
* [[Circuitboard (Advanced Airlock)]]&lt;br /&gt;
* [[Circuitboard (Airlock)]]&lt;br /&gt;
* [[Kit (Airlock)]]&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;/div&gt;</summary>
		<author><name>2607:9000:2000:15:0:0:0:A45E</name></author>
	</entry>
	<entry>
		<id>https://stationeers-wiki.com/index.php?title=Talk:Mars&amp;diff=17156</id>
		<title>Talk:Mars</title>
		<link rel="alternate" type="text/html" href="https://stationeers-wiki.com/index.php?title=Talk:Mars&amp;diff=17156"/>
		<updated>2023-09-03T12:47:05Z</updated>

		<summary type="html">&lt;p&gt;2607:9000:2000:15:0:0:0:A45E: page is entirely wrong&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;None of the information here matches whats on https://stationeers-wiki.com/Worlds&lt;br /&gt;
&lt;br /&gt;
Which one is correct? They should be fixed&lt;/div&gt;</summary>
		<author><name>2607:9000:2000:15:0:0:0:A45E</name></author>
	</entry>
</feed>