<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.starbasegame.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Spacebar</id>
	<title>Starbase wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.starbasegame.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Spacebar"/>
	<link rel="alternate" type="text/html" href="https://wiki.starbasegame.com/index.php?title=Special:Contributions/Spacebar"/>
	<updated>2026-06-05T03:14:10Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.37.1</generator>
	<entry>
		<id>https://wiki.starbasegame.com/index.php?title=User:Spacebar&amp;diff=4721</id>
		<title>User:Spacebar</title>
		<link rel="alternate" type="text/html" href="https://wiki.starbasegame.com/index.php?title=User:Spacebar&amp;diff=4721"/>
		<updated>2019-06-11T12:57:44Z</updated>

		<summary type="html">&lt;p&gt;Spacebar: Created page with &amp;quot;Username: Spacebar Discord : Spacebar#0690 Space Engineers player, Blender artist, modding SE for a year and a half&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Username: Spacebar&lt;br /&gt;
Discord : Spacebar#0690&lt;br /&gt;
Space Engineers player, Blender artist, modding SE for a year and a half&lt;/div&gt;</summary>
		<author><name>Spacebar</name></author>
	</entry>
	<entry>
		<id>https://wiki.starbasegame.com/index.php?title=YOLOL_chip_socket&amp;diff=4714</id>
		<title>YOLOL chip socket</title>
		<link rel="alternate" type="text/html" href="https://wiki.starbasegame.com/index.php?title=YOLOL_chip_socket&amp;diff=4714"/>
		<updated>2019-06-10T20:08:17Z</updated>

		<summary type="html">&lt;p&gt;Spacebar: /* Summary */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Chip socket.png|300px]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[YOLOL]] chip socket is a base device, which relays [[Generator|power]] and connection to a [[Data networks|data network]] for the [[YOLOL Chip|YOLOL chip]].&amp;lt;br&amp;gt;&lt;br /&gt;
Other option for mounting YOLOL chips is the [[Modular device rack]].&lt;br /&gt;
&lt;br /&gt;
== Basic information ==&lt;br /&gt;
&lt;br /&gt;
Chip sockets have:&lt;br /&gt;
* Four [[Cable tool|cable]] slots&lt;br /&gt;
* [[Bolt tool|Bolting]] spots in each corner&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[File:Chip socket example.png|400px]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Chip sockets are placed to any construct (ship, station or machine) that requires YOLOL to work.&amp;lt;br&amp;gt;&lt;br /&gt;
The socket is then bolted to the structure and cabled to a network with [[Generator|power]] and YOLOL chip's target devices.&lt;br /&gt;
&lt;br /&gt;
Several chip sockets can be placed side by side and they connect to each other without cables.&lt;br /&gt;
&lt;br /&gt;
== Device fields ==&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! YOLOL field&lt;br /&gt;
! description&lt;br /&gt;
! range&lt;br /&gt;
|-&lt;br /&gt;
! '''CurrentState'''&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! '''OnState'''&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
! '''OffState'''&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
!'''ButtonStyle'''&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:Devices and machines|Chip socket]]&lt;/div&gt;</summary>
		<author><name>Spacebar</name></author>
	</entry>
	<entry>
		<id>https://wiki.starbasegame.com/index.php?title=Data_networks&amp;diff=4713</id>
		<title>Data networks</title>
		<link rel="alternate" type="text/html" href="https://wiki.starbasegame.com/index.php?title=Data_networks&amp;diff=4713"/>
		<updated>2019-06-10T18:24:39Z</updated>

		<summary type="html">&lt;p&gt;Spacebar: /* Summary */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Data networks enable the creation, maintenance and control of large number of [[Devices and machines|devices]]. [[Universal tool|Universal tool]] and [[Cable tool|cable tool]] are the tools generally used for managing data networks.&amp;lt;br&amp;gt;&lt;br /&gt;
Data networks enable designers and pioneers to create, modify and maintain devices, such as [[Generator|power generators]], programmable logic [[YOLOL Chip|chips]] and more mundane devices such as [[Hinges|doors]] and elevators. &amp;lt;br&amp;gt;&lt;br /&gt;
The signals are controlled with [[YOLOL|programming language YOLOL]] that is accessible to everyone.&lt;br /&gt;
&lt;br /&gt;
== Terminology ==&lt;br /&gt;
&lt;br /&gt;
Objects have physical '''sockets''' and virtual '''device fields''' inside them.&lt;br /&gt;
* '''Sockets''' are used to connect objects to data networks with cables or directly through other devices.&lt;br /&gt;
* '''Device fields''' are configured and accessed when objects share the same data network.&lt;br /&gt;
** A device field controls one specific attribute or feature within a [[Devices and machines|device]].&lt;br /&gt;
*** The device field can for example be the amount of generated heat within a [[Thrusters|thruster]], or a value that can be manually changed such as button states in [[Buttons|buttons]].&lt;br /&gt;
** These device field names can generally be configured by using the appropriate [[Universal tool|tool]].&lt;br /&gt;
&amp;lt;!-- Device fields --&amp;gt;&lt;br /&gt;
&amp;lt;!-- device field --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Data network resources ==&lt;br /&gt;
&lt;br /&gt;
Data networks are connected together with cables.&amp;lt;br&amp;gt;&lt;br /&gt;
When devices are connected together, the data network can transfer two different resources.&amp;lt;br&amp;gt;&lt;br /&gt;
# '''Electricity'''&lt;br /&gt;
# '''Signals'''&lt;br /&gt;
&lt;br /&gt;
'''Electricity: all objects within the data network share power'''&lt;br /&gt;
* A [[Generator|generator]] attached to a data network tries to supply power to multiple [[Devices and machines|devices or machines]].&lt;br /&gt;
** This is why it is important to have multiple generators if there are many devices connected to the data network that need power.&lt;br /&gt;
&lt;br /&gt;
'''Signals: all objects within the data network are able to communicate with each other'''&lt;br /&gt;
* Cables can connect to each other directly.&lt;br /&gt;
* Sockets may have multiple connections and cables may branch.&lt;br /&gt;
* There are no limits to how many data networks can exist e.g. on one spaceship.&lt;br /&gt;
** A branched data network doesn't break as easily during combat.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- cable network --&amp;gt;&lt;br /&gt;
&amp;lt;!-- signal network --&amp;gt;&lt;br /&gt;
[[Category:Networks|Data network]]&lt;/div&gt;</summary>
		<author><name>Spacebar</name></author>
	</entry>
	<entry>
		<id>https://wiki.starbasegame.com/index.php?title=YOLOL&amp;diff=4712</id>
		<title>YOLOL</title>
		<link rel="alternate" type="text/html" href="https://wiki.starbasegame.com/index.php?title=YOLOL&amp;diff=4712"/>
		<updated>2019-06-10T18:06:43Z</updated>

		<summary type="html">&lt;p&gt;Spacebar: /* Nesting if statements */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
YOLOL is a programming language used to control and manage electrical [[Devices and machines|devices]].&amp;lt;br&amp;gt;&lt;br /&gt;
The code is written on lines in [[YOLOL Chip|YOLOL chips]] which are then inserted into [[Chip socket|chip sockets]], that read and relay their messages.&amp;lt;br&amp;gt;&lt;br /&gt;
The programming language enables the programming and controlling of almost any device within the known universe.&lt;br /&gt;
&lt;br /&gt;
== Basic information ==&lt;br /&gt;
&lt;br /&gt;
=== How it works? ===&lt;br /&gt;
The code is written to and executed from programmable chips, and can be used to both monitor and control electrical [[Devices and machines|devices]] connected to a [[Data networks|data network]].&amp;lt;br&amp;gt;&lt;br /&gt;
Lines of code are executed in sequence from top to bottom, repeating the cycle of the chip after the last line has been executed, unless the script includes programmed instructions for specific line changes or stopping the execution completely.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To put it simply:&lt;br /&gt;
&lt;br /&gt;
# Code execution starts from line 1&lt;br /&gt;
# After reading line 1, it proceeds to the next line based on the chip's time interval&lt;br /&gt;
# The process is then repeated for the line 2, 3, 4... etc.&lt;br /&gt;
# The chip will begin executing line 1 again after the last line has been executed (unless the script includes programmed instructions for specific line changes or stopping the execution completely)&lt;br /&gt;
&lt;br /&gt;
=== Related pages ===&lt;br /&gt;
&lt;br /&gt;
* [[Data networks]]&lt;br /&gt;
* [[Devices and machines]]&lt;br /&gt;
* [[Universal tool|Universal tool]]&lt;br /&gt;
* [[YOLOL Chip|Chip]]&lt;br /&gt;
&lt;br /&gt;
== Command references ==&lt;br /&gt;
&lt;br /&gt;
=== Case insensitive ===&lt;br /&gt;
&lt;br /&gt;
The programming language is fully case '''insensitive'''.&amp;lt;br&amp;gt;&lt;br /&gt;
This means that the following two example scripts function identically to each other:&lt;br /&gt;
&lt;br /&gt;
 if '''ButtonState''' == 1 then '''DoorState''' = 1 end&lt;br /&gt;
&lt;br /&gt;
 IF '''buttonstate''' == 1 THEN '''doorstate''' = 1 END&lt;br /&gt;
* Both scripts set the '''doorstate''' into 1, if '''buttonstate''' value is 1.&lt;br /&gt;
* The characters in the programming language can be written in either lowercase or uppercase letters.&lt;br /&gt;
** They are still parsed as case insensitive.&lt;br /&gt;
** This way it's possible to have the code look a bit more organized.&lt;br /&gt;
&lt;br /&gt;
=== Variables ===&lt;br /&gt;
&lt;br /&gt;
* The variables in the programming language are weakly typed (don't enforce type validity), and support two data types: '''Fixed-point decimals''' (up to 0.001 precision) and '''Strings'''.&lt;br /&gt;
** To put it simply, the variables can either be introduced as strings or numbers, ignoring the earlier variable type if the previous type is not identical, without causing an error.&lt;br /&gt;
* Each variable is always of a single type, though it will be implicitly converted when required.&lt;br /&gt;
* The default value of an uninitialized variable is 0, and null values are not supported.&lt;br /&gt;
* True/False are numerical values of non-0 and 0.&lt;br /&gt;
** True =! 0&lt;br /&gt;
** False == 0&lt;br /&gt;
&lt;br /&gt;
Assigning a value to a variable always converts the variable to the newly assigned value's type.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
&lt;br /&gt;
 ultimateAutopilot= 128.6432&lt;br /&gt;
* This results in the variable '''ultimateAutopilot''' containing a numeric value of 128.6432&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 ultimateAutopilot= &amp;quot;Error prone&amp;quot;&lt;br /&gt;
* This results in the variable '''ultimateAutopilot''' to be a string variable &amp;quot;''Error prone''&amp;quot;, and numeric value of 128.6432 is removed.&lt;br /&gt;
&lt;br /&gt;
==== Decimals ====&lt;br /&gt;
&lt;br /&gt;
Numeric values in the programming language are 64-bit integers.&amp;lt;br&amp;gt;&lt;br /&gt;
The variables hold decimal numbers up to four decimal accuracy.&lt;br /&gt;
&lt;br /&gt;
 pieVariable= 3.1415&lt;br /&gt;
* The above script assigns a numeric value of 3.1415 to the variable '''pieVariable'''.&lt;br /&gt;
** Supplying more precise values than the variables can store works, but doesn't affect the end result.&lt;br /&gt;
&lt;br /&gt;
 notPieVariable= 0.5772156649&lt;br /&gt;
* The above script attempts to assign a numeric value of 0.5772156649 to the variable '''notPieVariable'''.&lt;br /&gt;
* The end result however is notPieVariable == 0.5772&lt;br /&gt;
** Here, the more precise values are cut, leaving only four decimals behind.&lt;br /&gt;
&lt;br /&gt;
==== Strings ====&lt;br /&gt;
&lt;br /&gt;
To specify a string literal in the programming language, the desired string value must be surrounded with double quotation marks.&lt;br /&gt;
&lt;br /&gt;
 badRobots= &amp;quot;saltberia&amp;quot; &lt;br /&gt;
* This script assigns the string value of &amp;quot;''saltberia''&amp;quot; to the variable '''badRobots'''.&lt;br /&gt;
&lt;br /&gt;
==== Device fields / External variables ====&lt;br /&gt;
&lt;br /&gt;
External variables and device fields can be used in the programming language with the following syntax:&amp;lt;br&amp;gt;&lt;br /&gt;
* ''':variableName'''&lt;br /&gt;
**'''variableName''' being the configured device field id.&lt;br /&gt;
A colon prefix  ''':'''  is used to tell the script that an externable variable is being accessed, instead of using one that may or may not be declared or used in the script.&amp;lt;br&amp;gt;&lt;br /&gt;
A programmable [[YOLOL Chip|chip]] that is connected to a [[Devices and machines|device]] has access to all the devices in the same [[Data networks|network]].&amp;lt;br&amp;gt;&lt;br /&gt;
It can then modify and listen to any device fields it has access to.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 if ''':ButtonState''' == 1 then ''':DoorState''' = 1 end&lt;br /&gt;
* The script above will send the value of 1 to any devices listening to the device field '''DoorState''' if the value of '''ButtonState''' is 1 in the data network.&lt;br /&gt;
&lt;br /&gt;
== Operators and commands ==&lt;br /&gt;
&lt;br /&gt;
Note that the available operators may be limited by the type of the programmable [[YOLOL Chip|chip]].&amp;lt;br&amp;gt;&lt;br /&gt;
Basic chips have a limited selection of functions while more advanced ones can perform more complex operations natively.&lt;br /&gt;
&lt;br /&gt;
=== Basic arithmetic and assignment operators ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Operation || Numeric operation || String operation&lt;br /&gt;
|-&lt;br /&gt;
| A + B || Addition || String A is appended by String B.&lt;br /&gt;
|-&lt;br /&gt;
| A - B || Subtraction || The last appearance of String B in String A is removed from String A.&lt;br /&gt;
|-&lt;br /&gt;
| A * B || Multiplication || Runtime error. The rest of the line is skipped.&lt;br /&gt;
|-&lt;br /&gt;
| A / B || Division || Runtime error. The rest of the line is skipped.&lt;br /&gt;
|-&lt;br /&gt;
| A ++ || PostIncrement (A=A+1) || Appends a space to String A. Evaluates to the original value.&lt;br /&gt;
|-&lt;br /&gt;
| A -- || PostDecrement (A=A-1) || Removes the last character of the string. Results in runtime error when trying to remove &amp;quot;&amp;quot;. Evaluates to the original value.&lt;br /&gt;
|-&lt;br /&gt;
| ++ A  || PreIncrement (A=A+1) || Appends a space to String A. Evaluates to the modified value.&lt;br /&gt;
|-&lt;br /&gt;
| -- A || PreDecrement (A=A-1) || Removes the last character of the string. Results in runtime error when trying to remove &amp;quot;&amp;quot;. Evaluates to the modified value.&lt;br /&gt;
|-&lt;br /&gt;
| A = B || Assignment (Variable A is set to the value of variable B) || Assignment&lt;br /&gt;
|-&lt;br /&gt;
| A += B || Addition-assignment (A=A+B) || A is assigned the value of string-operation A+B&lt;br /&gt;
|-&lt;br /&gt;
| A -= B || Subtraction-assignment (A=A-B) || A is assigned the value of string-operation A-B&lt;br /&gt;
|-&lt;br /&gt;
| A *= B || Multiplication-assignment (A=A*B) || Runtime error for string variables. The rest of the line is skipped.&lt;br /&gt;
|-&lt;br /&gt;
| A /= B || Division-assignment (A=A/B) || Runtime error for string variables. The rest of the line is skipped.&lt;br /&gt;
|-&lt;br /&gt;
| A %= B || Modulo-assignment (A=A%B) || Runtime error for string variables. The rest of the line is skipped.&lt;br /&gt;
|-&lt;br /&gt;
| A ^ B || Exponentiation || Runtime error for string variables. The rest of the line is skipped.&lt;br /&gt;
|-&lt;br /&gt;
| A % B || Modulo || Runtime error for string variables. The rest of the line is skipped.&lt;br /&gt;
|-&lt;br /&gt;
| ABS A || Modulus (absol value) (A=A if A&amp;gt;=0, else A=-A) || Runtime error for string variables. The rest of the line is skipped.&lt;br /&gt;
|-&lt;br /&gt;
| A! || Factorial || Runtime error for string variables. The rest of the line is skipped.&lt;br /&gt;
|-&lt;br /&gt;
| SQRT A || Square root of A || Runtime error for string variables. The rest of the line is skipped.&lt;br /&gt;
|-&lt;br /&gt;
| SIN A || Sine of A (degrees) || Runtime error for string variables. The rest of the line is skipped.&lt;br /&gt;
|-&lt;br /&gt;
| COS A || Cosine of A (degrees) || Runtime error for string variables. The rest of the line is skipped.&lt;br /&gt;
|-&lt;br /&gt;
| TAN A || Tangent of A (degrees) || Runtime error for string variables. The rest of the line is skipped.&lt;br /&gt;
|-&lt;br /&gt;
| ARCSIN A || Inverse sine of A (degrees) || Runtime error for string variables. The rest of the line is skipped.&lt;br /&gt;
|-&lt;br /&gt;
| ARCCOS A || Inverse cosine of A (degrees) || Runtime error for string variables. The rest of the line is skipped.&lt;br /&gt;
|-&lt;br /&gt;
| ARCTAN A || Inverse tangent of A (degrees) || Runtime error for string variables. The rest of the line is skipped.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Logical operators ===&lt;br /&gt;
&lt;br /&gt;
Logical operators are checks that identify if the statement is true or false.&amp;lt;br&amp;gt;&lt;br /&gt;
All logical operations return either '''&amp;quot;0 for False&amp;quot;''' or '''&amp;quot;1 for True&amp;quot;'''&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Operation || Numeric operation || String operation&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt; B || Less than || returns 1 if String A is first in alphabetical order, returns 0 if not.&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;gt; B || Greater than || returns 0 if String A is first in alphabetical order, returns 1 if not.&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;= B ||Less than or equal to || returns 1 if String A is first in alphabetical order or identical to String B, returns 0 if not.&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;gt;= B || Greater than or equal to || returns 0 if String A is first in alphabetical order or identical to String B, returns 1 if not.&lt;br /&gt;
|-&lt;br /&gt;
| A ~= B || Not equal to || returns 1 if String A is not equal to String B, 0 if it is.&lt;br /&gt;
|-&lt;br /&gt;
| A == B || Equal to || returns 1 if String A is equal to String B, 0 if not.&lt;br /&gt;
|}&lt;br /&gt;
It's also possible to use '''not''', '''and''' and '''or''' keywords to set up more complicated conditions than simple variable value checks.&lt;br /&gt;
&lt;br /&gt;
=== Mixing variable types in operations ===&lt;br /&gt;
&lt;br /&gt;
Mixing variable types in an operation handles the operation using all parameters as ''strings''.&lt;br /&gt;
&lt;br /&gt;
 previouslyNumber= &amp;quot;10&amp;quot; + 15&lt;br /&gt;
* The above script results in '''previouslyNumber''' containing the string value &amp;quot;1015&amp;quot;.&lt;br /&gt;
** Note that the involved parameters themselves don't change types, their values are just cast as strings for the purpose of the operation:&lt;br /&gt;
 &lt;br /&gt;
 purelyNumber = 15&lt;br /&gt;
 purelyString = &amp;quot;10&amp;quot; + purelyNumber&lt;br /&gt;
* When this script has executed, '''purelyString''' contains the string value of &amp;quot;1015&amp;quot;, while '''purelyNumber''' still contains the numeric value of 15.&lt;br /&gt;
&lt;br /&gt;
=== Goto ===&lt;br /&gt;
&lt;br /&gt;
Goto syntax is used when the normal script reading order from 1-&amp;gt;20 is not desired, or needs to be altered.&lt;br /&gt;
&lt;br /&gt;
Goto is used with the following syntax:&lt;br /&gt;
*'''goto lineNumber'''&lt;br /&gt;
** lineNumber is the line which the command will take the script execution.&amp;lt;br&amp;gt;&lt;br /&gt;
** Any remaining script that is on the same line after the goto-command will not be executed.&lt;br /&gt;
*** using if statements before goto ignores goto syntax, assuming the if-statement is false&lt;br /&gt;
** Multiple goto commands can be added on the same line using conditionals, as '''False''' goto commands are skipped.&lt;br /&gt;
&lt;br /&gt;
 if variable == 5 then '''goto 4''' end '''goto 6'''&lt;br /&gt;
&lt;br /&gt;
The script above will go to line number 4, if '''variable''' has a value of 5.&amp;lt;br&amp;gt;&lt;br /&gt;
Otherwise it will go to line number 6.&lt;br /&gt;
&lt;br /&gt;
=== If-else conditional ===&lt;br /&gt;
&lt;br /&gt;
If-else statements are used to branch out the script into different paths.&amp;lt;br&amp;gt;&lt;br /&gt;
They use the following syntax:&lt;br /&gt;
* '''if ''condition'' then ''statement'' else ''statement'' end'''&lt;br /&gt;
** Condition is a statement that results in a numeric value (where 0 is parsed as False, anything else as True), and statements are pieces of script that are run.&lt;br /&gt;
** All If-else conditional stations must have '''end''' syntax written after statement is complete.&lt;br /&gt;
&lt;br /&gt;
If can be used to branch script execution into two possible outcomes temporarily based on variable value(s).&amp;lt;br&amp;gt;&lt;br /&gt;
'''Example:'''&amp;lt;br&amp;gt;&lt;br /&gt;
 '''if''' variable ~= 2 '''then''' endResult = 3 '''else''' endResult = 4 '''end'''&lt;br /&gt;
&lt;br /&gt;
* This script sets the value of '''endResult''' to 3 if '''variable''' does not have the value of 2.&lt;br /&gt;
* If '''variable''''s value is 2, '''endResult''' is set to the value of 4.&lt;br /&gt;
&lt;br /&gt;
Note that the else statement -part can be left out if not needed.&amp;lt;br&amp;gt;&lt;br /&gt;
'''Example:'''&amp;lt;br&amp;gt;&lt;br /&gt;
 '''if''' variable ~= 2 '''then''' endResult = 3 '''end'''&lt;br /&gt;
*This script only sets the value of 3 to '''endResult''' if '''variable''' does not have a value of 2, and doesn't do anything else.&lt;br /&gt;
&lt;br /&gt;
==== Nesting if statements ====&lt;br /&gt;
&lt;br /&gt;
It is possible to place if-conditionals inside the true/false statement blocks to achieve further branching of execution.&amp;lt;br&amp;gt;&lt;br /&gt;
Example:&amp;lt;br&amp;gt;&lt;br /&gt;
 '''if''' variable == 0 '''then''' endResult = 1 '''else''' '''if''' variable == 1 '''then''' endResult = 2 '''end end''' &lt;br /&gt;
* This script sets '''endResult''' to 1 if '''variable''' equals 0.&lt;br /&gt;
* If '''variable''' doesn't equal 0, but it equals 1, '''endResult''' is set to 2.&lt;br /&gt;
&lt;br /&gt;
Example:&amp;lt;br&amp;gt;&lt;br /&gt;
 '''if''' variable == 0 '''then''' '''if''' endResult == 1 '''then''' endResult = 2 '''end''' '''else''' endResult = 1 '''end'''&lt;br /&gt;
* This script sets '''endResult''' to 2 if '''variable''' has a value of 0, and '''endResult''' equals to 1.&lt;br /&gt;
* Otherwise it sets '''endResult''' to 1.&lt;br /&gt;
&lt;br /&gt;
Note that it may be easier to plan and debug the script flow by formatting the script containing nested if-statements to a neater indented form.&amp;lt;br&amp;gt;&lt;br /&gt;
Also note that writing the script like this won't work on the [[YOLOL Chip|chip]], but doing this can still be useful when debugging scripts.&lt;br /&gt;
&lt;br /&gt;
This is the second nested example formatted:&lt;br /&gt;
&lt;br /&gt;
 '''if''' variable == 0 '''then'''&lt;br /&gt;
     '''if''' otherVariable == 1 '''then'''&lt;br /&gt;
         otherVariable = 2&lt;br /&gt;
     '''end'''&lt;br /&gt;
 '''else'''&lt;br /&gt;
     otherVariable = 1&lt;br /&gt;
 '''end'''&lt;br /&gt;
&lt;br /&gt;
=== Comments ===&lt;br /&gt;
&lt;br /&gt;
Comments are useful when writing code that is used by a lot of programmers.&amp;lt;br&amp;gt;&lt;br /&gt;
Note that comments also use up space from the pre-determined 70 character line limit and are not excluded from it.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Commenting is used with the following syntax:&lt;br /&gt;
*// '''text'''&lt;br /&gt;
** Text can be any single-line set of characters.&lt;br /&gt;
&lt;br /&gt;
 '''//''' This is a comment. It will explain how other lines of script work.&lt;br /&gt;
* An example of a possible comment syntax&lt;br /&gt;
&lt;br /&gt;
== Errors ==&lt;br /&gt;
&lt;br /&gt;
There are two types of errors that can happen with the programming language.&lt;br /&gt;
# Syntax errors&lt;br /&gt;
# Runtime errors&lt;br /&gt;
&lt;br /&gt;
* Syntax errors come from invalid and unparseable script and will result in the whole line not being executed.&lt;br /&gt;
* Runtime errors are only catchable while the script is being executed. They result in the execution of the line being interrupted, but any effects until the error will remain.&lt;br /&gt;
&lt;br /&gt;
[[Category:Networks|YOLOL]]&lt;/div&gt;</summary>
		<author><name>Spacebar</name></author>
	</entry>
	<entry>
		<id>https://wiki.starbasegame.com/index.php?title=YOLOL&amp;diff=4711</id>
		<title>YOLOL</title>
		<link rel="alternate" type="text/html" href="https://wiki.starbasegame.com/index.php?title=YOLOL&amp;diff=4711"/>
		<updated>2019-06-10T18:05:31Z</updated>

		<summary type="html">&lt;p&gt;Spacebar: /* Operators and commands */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
YOLOL is a programming language used to control and manage electrical [[Devices and machines|devices]].&amp;lt;br&amp;gt;&lt;br /&gt;
The code is written on lines in [[YOLOL Chip|YOLOL chips]] which are then inserted into [[Chip socket|chip sockets]], that read and relay their messages.&amp;lt;br&amp;gt;&lt;br /&gt;
The programming language enables the programming and controlling of almost any device within the known universe.&lt;br /&gt;
&lt;br /&gt;
== Basic information ==&lt;br /&gt;
&lt;br /&gt;
=== How it works? ===&lt;br /&gt;
The code is written to and executed from programmable chips, and can be used to both monitor and control electrical [[Devices and machines|devices]] connected to a [[Data networks|data network]].&amp;lt;br&amp;gt;&lt;br /&gt;
Lines of code are executed in sequence from top to bottom, repeating the cycle of the chip after the last line has been executed, unless the script includes programmed instructions for specific line changes or stopping the execution completely.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To put it simply:&lt;br /&gt;
&lt;br /&gt;
# Code execution starts from line 1&lt;br /&gt;
# After reading line 1, it proceeds to the next line based on the chip's time interval&lt;br /&gt;
# The process is then repeated for the line 2, 3, 4... etc.&lt;br /&gt;
# The chip will begin executing line 1 again after the last line has been executed (unless the script includes programmed instructions for specific line changes or stopping the execution completely)&lt;br /&gt;
&lt;br /&gt;
=== Related pages ===&lt;br /&gt;
&lt;br /&gt;
* [[Data networks]]&lt;br /&gt;
* [[Devices and machines]]&lt;br /&gt;
* [[Universal tool|Universal tool]]&lt;br /&gt;
* [[YOLOL Chip|Chip]]&lt;br /&gt;
&lt;br /&gt;
== Command references ==&lt;br /&gt;
&lt;br /&gt;
=== Case insensitive ===&lt;br /&gt;
&lt;br /&gt;
The programming language is fully case '''insensitive'''.&amp;lt;br&amp;gt;&lt;br /&gt;
This means that the following two example scripts function identically to each other:&lt;br /&gt;
&lt;br /&gt;
 if '''ButtonState''' == 1 then '''DoorState''' = 1 end&lt;br /&gt;
&lt;br /&gt;
 IF '''buttonstate''' == 1 THEN '''doorstate''' = 1 END&lt;br /&gt;
* Both scripts set the '''doorstate''' into 1, if '''buttonstate''' value is 1.&lt;br /&gt;
* The characters in the programming language can be written in either lowercase or uppercase letters.&lt;br /&gt;
** They are still parsed as case insensitive.&lt;br /&gt;
** This way it's possible to have the code look a bit more organized.&lt;br /&gt;
&lt;br /&gt;
=== Variables ===&lt;br /&gt;
&lt;br /&gt;
* The variables in the programming language are weakly typed (don't enforce type validity), and support two data types: '''Fixed-point decimals''' (up to 0.001 precision) and '''Strings'''.&lt;br /&gt;
** To put it simply, the variables can either be introduced as strings or numbers, ignoring the earlier variable type if the previous type is not identical, without causing an error.&lt;br /&gt;
* Each variable is always of a single type, though it will be implicitly converted when required.&lt;br /&gt;
* The default value of an uninitialized variable is 0, and null values are not supported.&lt;br /&gt;
* True/False are numerical values of non-0 and 0.&lt;br /&gt;
** True =! 0&lt;br /&gt;
** False == 0&lt;br /&gt;
&lt;br /&gt;
Assigning a value to a variable always converts the variable to the newly assigned value's type.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
&lt;br /&gt;
 ultimateAutopilot= 128.6432&lt;br /&gt;
* This results in the variable '''ultimateAutopilot''' containing a numeric value of 128.6432&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 ultimateAutopilot= &amp;quot;Error prone&amp;quot;&lt;br /&gt;
* This results in the variable '''ultimateAutopilot''' to be a string variable &amp;quot;''Error prone''&amp;quot;, and numeric value of 128.6432 is removed.&lt;br /&gt;
&lt;br /&gt;
==== Decimals ====&lt;br /&gt;
&lt;br /&gt;
Numeric values in the programming language are 64-bit integers.&amp;lt;br&amp;gt;&lt;br /&gt;
The variables hold decimal numbers up to four decimal accuracy.&lt;br /&gt;
&lt;br /&gt;
 pieVariable= 3.1415&lt;br /&gt;
* The above script assigns a numeric value of 3.1415 to the variable '''pieVariable'''.&lt;br /&gt;
** Supplying more precise values than the variables can store works, but doesn't affect the end result.&lt;br /&gt;
&lt;br /&gt;
 notPieVariable= 0.5772156649&lt;br /&gt;
* The above script attempts to assign a numeric value of 0.5772156649 to the variable '''notPieVariable'''.&lt;br /&gt;
* The end result however is notPieVariable == 0.5772&lt;br /&gt;
** Here, the more precise values are cut, leaving only four decimals behind.&lt;br /&gt;
&lt;br /&gt;
==== Strings ====&lt;br /&gt;
&lt;br /&gt;
To specify a string literal in the programming language, the desired string value must be surrounded with double quotation marks.&lt;br /&gt;
&lt;br /&gt;
 badRobots= &amp;quot;saltberia&amp;quot; &lt;br /&gt;
* This script assigns the string value of &amp;quot;''saltberia''&amp;quot; to the variable '''badRobots'''.&lt;br /&gt;
&lt;br /&gt;
==== Device fields / External variables ====&lt;br /&gt;
&lt;br /&gt;
External variables and device fields can be used in the programming language with the following syntax:&amp;lt;br&amp;gt;&lt;br /&gt;
* ''':variableName'''&lt;br /&gt;
**'''variableName''' being the configured device field id.&lt;br /&gt;
A colon prefix  ''':'''  is used to tell the script that an externable variable is being accessed, instead of using one that may or may not be declared or used in the script.&amp;lt;br&amp;gt;&lt;br /&gt;
A programmable [[YOLOL Chip|chip]] that is connected to a [[Devices and machines|device]] has access to all the devices in the same [[Data networks|network]].&amp;lt;br&amp;gt;&lt;br /&gt;
It can then modify and listen to any device fields it has access to.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 if ''':ButtonState''' == 1 then ''':DoorState''' = 1 end&lt;br /&gt;
* The script above will send the value of 1 to any devices listening to the device field '''DoorState''' if the value of '''ButtonState''' is 1 in the data network.&lt;br /&gt;
&lt;br /&gt;
== Operators and commands ==&lt;br /&gt;
&lt;br /&gt;
Note that the available operators may be limited by the type of the programmable [[YOLOL Chip|chip]].&amp;lt;br&amp;gt;&lt;br /&gt;
Basic chips have a limited selection of functions while more advanced ones can perform more complex operations natively.&lt;br /&gt;
&lt;br /&gt;
=== Basic arithmetic and assignment operators ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Operation || Numeric operation || String operation&lt;br /&gt;
|-&lt;br /&gt;
| A + B || Addition || String A is appended by String B.&lt;br /&gt;
|-&lt;br /&gt;
| A - B || Subtraction || The last appearance of String B in String A is removed from String A.&lt;br /&gt;
|-&lt;br /&gt;
| A * B || Multiplication || Runtime error. The rest of the line is skipped.&lt;br /&gt;
|-&lt;br /&gt;
| A / B || Division || Runtime error. The rest of the line is skipped.&lt;br /&gt;
|-&lt;br /&gt;
| A ++ || PostIncrement (A=A+1) || Appends a space to String A. Evaluates to the original value.&lt;br /&gt;
|-&lt;br /&gt;
| A -- || PostDecrement (A=A-1) || Removes the last character of the string. Results in runtime error when trying to remove &amp;quot;&amp;quot;. Evaluates to the original value.&lt;br /&gt;
|-&lt;br /&gt;
| ++ A  || PreIncrement (A=A+1) || Appends a space to String A. Evaluates to the modified value.&lt;br /&gt;
|-&lt;br /&gt;
| -- A || PreDecrement (A=A-1) || Removes the last character of the string. Results in runtime error when trying to remove &amp;quot;&amp;quot;. Evaluates to the modified value.&lt;br /&gt;
|-&lt;br /&gt;
| A = B || Assignment (Variable A is set to the value of variable B) || Assignment&lt;br /&gt;
|-&lt;br /&gt;
| A += B || Addition-assignment (A=A+B) || A is assigned the value of string-operation A+B&lt;br /&gt;
|-&lt;br /&gt;
| A -= B || Subtraction-assignment (A=A-B) || A is assigned the value of string-operation A-B&lt;br /&gt;
|-&lt;br /&gt;
| A *= B || Multiplication-assignment (A=A*B) || Runtime error for string variables. The rest of the line is skipped.&lt;br /&gt;
|-&lt;br /&gt;
| A /= B || Division-assignment (A=A/B) || Runtime error for string variables. The rest of the line is skipped.&lt;br /&gt;
|-&lt;br /&gt;
| A %= B || Modulo-assignment (A=A%B) || Runtime error for string variables. The rest of the line is skipped.&lt;br /&gt;
|-&lt;br /&gt;
| A ^ B || Exponentiation || Runtime error for string variables. The rest of the line is skipped.&lt;br /&gt;
|-&lt;br /&gt;
| A % B || Modulo || Runtime error for string variables. The rest of the line is skipped.&lt;br /&gt;
|-&lt;br /&gt;
| ABS A || Modulus (absol value) (A=A if A&amp;gt;=0, else A=-A) || Runtime error for string variables. The rest of the line is skipped.&lt;br /&gt;
|-&lt;br /&gt;
| A! || Factorial || Runtime error for string variables. The rest of the line is skipped.&lt;br /&gt;
|-&lt;br /&gt;
| SQRT A || Square root of A || Runtime error for string variables. The rest of the line is skipped.&lt;br /&gt;
|-&lt;br /&gt;
| SIN A || Sine of A (degrees) || Runtime error for string variables. The rest of the line is skipped.&lt;br /&gt;
|-&lt;br /&gt;
| COS A || Cosine of A (degrees) || Runtime error for string variables. The rest of the line is skipped.&lt;br /&gt;
|-&lt;br /&gt;
| TAN A || Tangent of A (degrees) || Runtime error for string variables. The rest of the line is skipped.&lt;br /&gt;
|-&lt;br /&gt;
| ARCSIN A || Inverse sine of A (degrees) || Runtime error for string variables. The rest of the line is skipped.&lt;br /&gt;
|-&lt;br /&gt;
| ARCCOS A || Inverse cosine of A (degrees) || Runtime error for string variables. The rest of the line is skipped.&lt;br /&gt;
|-&lt;br /&gt;
| ARCTAN A || Inverse tangent of A (degrees) || Runtime error for string variables. The rest of the line is skipped.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Logical operators ===&lt;br /&gt;
&lt;br /&gt;
Logical operators are checks that identify if the statement is true or false.&amp;lt;br&amp;gt;&lt;br /&gt;
All logical operations return either '''&amp;quot;0 for False&amp;quot;''' or '''&amp;quot;1 for True&amp;quot;'''&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Operation || Numeric operation || String operation&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt; B || Less than || returns 1 if String A is first in alphabetical order, returns 0 if not.&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;gt; B || Greater than || returns 0 if String A is first in alphabetical order, returns 1 if not.&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;= B ||Less than or equal to || returns 1 if String A is first in alphabetical order or identical to String B, returns 0 if not.&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;gt;= B || Greater than or equal to || returns 0 if String A is first in alphabetical order or identical to String B, returns 1 if not.&lt;br /&gt;
|-&lt;br /&gt;
| A ~= B || Not equal to || returns 1 if String A is not equal to String B, 0 if it is.&lt;br /&gt;
|-&lt;br /&gt;
| A == B || Equal to || returns 1 if String A is equal to String B, 0 if not.&lt;br /&gt;
|}&lt;br /&gt;
It's also possible to use '''not''', '''and''' and '''or''' keywords to set up more complicated conditions than simple variable value checks.&lt;br /&gt;
&lt;br /&gt;
=== Mixing variable types in operations ===&lt;br /&gt;
&lt;br /&gt;
Mixing variable types in an operation handles the operation using all parameters as ''strings''.&lt;br /&gt;
&lt;br /&gt;
 previouslyNumber= &amp;quot;10&amp;quot; + 15&lt;br /&gt;
* The above script results in '''previouslyNumber''' containing the string value &amp;quot;1015&amp;quot;.&lt;br /&gt;
** Note that the involved parameters themselves don't change types, their values are just cast as strings for the purpose of the operation:&lt;br /&gt;
 &lt;br /&gt;
 purelyNumber = 15&lt;br /&gt;
 purelyString = &amp;quot;10&amp;quot; + purelyNumber&lt;br /&gt;
* When this script has executed, '''purelyString''' contains the string value of &amp;quot;1015&amp;quot;, while '''purelyNumber''' still contains the numeric value of 15.&lt;br /&gt;
&lt;br /&gt;
=== Goto ===&lt;br /&gt;
&lt;br /&gt;
Goto syntax is used when the normal script reading order from 1-&amp;gt;20 is not desired, or needs to be altered.&lt;br /&gt;
&lt;br /&gt;
Goto is used with the following syntax:&lt;br /&gt;
*'''goto lineNumber'''&lt;br /&gt;
** lineNumber is the line which the command will take the script execution.&amp;lt;br&amp;gt;&lt;br /&gt;
** Any remaining script that is on the same line after the goto-command will not be executed.&lt;br /&gt;
*** using if statements before goto ignores goto syntax, assuming the if-statement is false&lt;br /&gt;
** Multiple goto commands can be added on the same line using conditionals, as '''False''' goto commands are skipped.&lt;br /&gt;
&lt;br /&gt;
 if variable == 5 then '''goto 4''' end '''goto 6'''&lt;br /&gt;
&lt;br /&gt;
The script above will go to line number 4, if '''variable''' has a value of 5.&amp;lt;br&amp;gt;&lt;br /&gt;
Otherwise it will go to line number 6.&lt;br /&gt;
&lt;br /&gt;
=== If-else conditional ===&lt;br /&gt;
&lt;br /&gt;
If-else statements are used to branch out the script into different paths.&amp;lt;br&amp;gt;&lt;br /&gt;
They use the following syntax:&lt;br /&gt;
* '''if ''condition'' then ''statement'' else ''statement'' end'''&lt;br /&gt;
** Condition is a statement that results in a numeric value (where 0 is parsed as False, anything else as True), and statements are pieces of script that are run.&lt;br /&gt;
** All If-else conditional stations must have '''end''' syntax written after statement is complete.&lt;br /&gt;
&lt;br /&gt;
If can be used to branch script execution into two possible outcomes temporarily based on variable value(s).&amp;lt;br&amp;gt;&lt;br /&gt;
'''Example:'''&amp;lt;br&amp;gt;&lt;br /&gt;
 '''if''' variable ~= 2 '''then''' endResult = 3 '''else''' endResult = 4 '''end'''&lt;br /&gt;
&lt;br /&gt;
* This script sets the value of '''endResult''' to 3 if '''variable''' does not have the value of 2.&lt;br /&gt;
* If '''variable''''s value is 2, '''endResult''' is set to the value of 4.&lt;br /&gt;
&lt;br /&gt;
Note that the else statement -part can be left out if not needed.&amp;lt;br&amp;gt;&lt;br /&gt;
'''Example:'''&amp;lt;br&amp;gt;&lt;br /&gt;
 '''if''' variable ~= 2 '''then''' endResult = 3 '''end'''&lt;br /&gt;
*This script only sets the value of 3 to '''endResult''' if '''variable''' does not have a value of 2, and doesn't do anything else.&lt;br /&gt;
&lt;br /&gt;
==== Nesting if statements ====&lt;br /&gt;
&lt;br /&gt;
It is possible to place if-conditionals inside the true/false statement blocks to achieve further branching of execution.&amp;lt;br&amp;gt;&lt;br /&gt;
Example:&amp;lt;br&amp;gt;&lt;br /&gt;
 '''if''' variable == 0 '''then''' endResult = 1 '''else''' '''if''' variable == 1 '''then''' endResult = 2 '''end end''' &lt;br /&gt;
* This script sets '''endResult''' to 1 if '''variable''' equals 0.&lt;br /&gt;
* If '''variable''' doesn't equal 0, but it equals 1, '''endResult''' is set to 2.&lt;br /&gt;
&lt;br /&gt;
Example:&amp;lt;br&amp;gt;&lt;br /&gt;
 '''if''' variable == 0 '''then''' '''if''' endResult == 1 '''then''' endResult = 2 '''end''' '''else''' endResult = 1 '''end'''&lt;br /&gt;
* This script sets '''endResult''' to 2 if '''variable''' has a value of 0, and '''endResult''' equals to 1.&lt;br /&gt;
* Otherwise it sets '''endResult''' to 1.&lt;br /&gt;
&lt;br /&gt;
Note that it may be easier to plan and debug the script flow by formatting the script containing nested if-statements to a neater indented form.&amp;lt;br&amp;gt;&lt;br /&gt;
Also note that writing the script like this won't work on the [[Chip|chip]], but doing this can still be useful when debugging scripts.&lt;br /&gt;
&lt;br /&gt;
This is the second nested example formatted:&lt;br /&gt;
&lt;br /&gt;
 '''if''' variable == 0 '''then'''&lt;br /&gt;
     '''if''' otherVariable == 1 '''then'''&lt;br /&gt;
         otherVariable = 2&lt;br /&gt;
     '''end'''&lt;br /&gt;
 '''else'''&lt;br /&gt;
     otherVariable = 1&lt;br /&gt;
 '''end'''&lt;br /&gt;
&lt;br /&gt;
=== Comments ===&lt;br /&gt;
&lt;br /&gt;
Comments are useful when writing code that is used by a lot of programmers.&amp;lt;br&amp;gt;&lt;br /&gt;
Note that comments also use up space from the pre-determined 70 character line limit and are not excluded from it.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Commenting is used with the following syntax:&lt;br /&gt;
*// '''text'''&lt;br /&gt;
** Text can be any single-line set of characters.&lt;br /&gt;
&lt;br /&gt;
 '''//''' This is a comment. It will explain how other lines of script work.&lt;br /&gt;
* An example of a possible comment syntax&lt;br /&gt;
&lt;br /&gt;
== Errors ==&lt;br /&gt;
&lt;br /&gt;
There are two types of errors that can happen with the programming language.&lt;br /&gt;
# Syntax errors&lt;br /&gt;
# Runtime errors&lt;br /&gt;
&lt;br /&gt;
* Syntax errors come from invalid and unparseable script and will result in the whole line not being executed.&lt;br /&gt;
* Runtime errors are only catchable while the script is being executed. They result in the execution of the line being interrupted, but any effects until the error will remain.&lt;br /&gt;
&lt;br /&gt;
[[Category:Networks|YOLOL]]&lt;/div&gt;</summary>
		<author><name>Spacebar</name></author>
	</entry>
	<entry>
		<id>https://wiki.starbasegame.com/index.php?title=YOLOL&amp;diff=4710</id>
		<title>YOLOL</title>
		<link rel="alternate" type="text/html" href="https://wiki.starbasegame.com/index.php?title=YOLOL&amp;diff=4710"/>
		<updated>2019-06-10T18:04:08Z</updated>

		<summary type="html">&lt;p&gt;Spacebar: /* Device fields / External variables */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
YOLOL is a programming language used to control and manage electrical [[Devices and machines|devices]].&amp;lt;br&amp;gt;&lt;br /&gt;
The code is written on lines in [[YOLOL Chip|YOLOL chips]] which are then inserted into [[Chip socket|chip sockets]], that read and relay their messages.&amp;lt;br&amp;gt;&lt;br /&gt;
The programming language enables the programming and controlling of almost any device within the known universe.&lt;br /&gt;
&lt;br /&gt;
== Basic information ==&lt;br /&gt;
&lt;br /&gt;
=== How it works? ===&lt;br /&gt;
The code is written to and executed from programmable chips, and can be used to both monitor and control electrical [[Devices and machines|devices]] connected to a [[Data networks|data network]].&amp;lt;br&amp;gt;&lt;br /&gt;
Lines of code are executed in sequence from top to bottom, repeating the cycle of the chip after the last line has been executed, unless the script includes programmed instructions for specific line changes or stopping the execution completely.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To put it simply:&lt;br /&gt;
&lt;br /&gt;
# Code execution starts from line 1&lt;br /&gt;
# After reading line 1, it proceeds to the next line based on the chip's time interval&lt;br /&gt;
# The process is then repeated for the line 2, 3, 4... etc.&lt;br /&gt;
# The chip will begin executing line 1 again after the last line has been executed (unless the script includes programmed instructions for specific line changes or stopping the execution completely)&lt;br /&gt;
&lt;br /&gt;
=== Related pages ===&lt;br /&gt;
&lt;br /&gt;
* [[Data networks]]&lt;br /&gt;
* [[Devices and machines]]&lt;br /&gt;
* [[Universal tool|Universal tool]]&lt;br /&gt;
* [[YOLOL Chip|Chip]]&lt;br /&gt;
&lt;br /&gt;
== Command references ==&lt;br /&gt;
&lt;br /&gt;
=== Case insensitive ===&lt;br /&gt;
&lt;br /&gt;
The programming language is fully case '''insensitive'''.&amp;lt;br&amp;gt;&lt;br /&gt;
This means that the following two example scripts function identically to each other:&lt;br /&gt;
&lt;br /&gt;
 if '''ButtonState''' == 1 then '''DoorState''' = 1 end&lt;br /&gt;
&lt;br /&gt;
 IF '''buttonstate''' == 1 THEN '''doorstate''' = 1 END&lt;br /&gt;
* Both scripts set the '''doorstate''' into 1, if '''buttonstate''' value is 1.&lt;br /&gt;
* The characters in the programming language can be written in either lowercase or uppercase letters.&lt;br /&gt;
** They are still parsed as case insensitive.&lt;br /&gt;
** This way it's possible to have the code look a bit more organized.&lt;br /&gt;
&lt;br /&gt;
=== Variables ===&lt;br /&gt;
&lt;br /&gt;
* The variables in the programming language are weakly typed (don't enforce type validity), and support two data types: '''Fixed-point decimals''' (up to 0.001 precision) and '''Strings'''.&lt;br /&gt;
** To put it simply, the variables can either be introduced as strings or numbers, ignoring the earlier variable type if the previous type is not identical, without causing an error.&lt;br /&gt;
* Each variable is always of a single type, though it will be implicitly converted when required.&lt;br /&gt;
* The default value of an uninitialized variable is 0, and null values are not supported.&lt;br /&gt;
* True/False are numerical values of non-0 and 0.&lt;br /&gt;
** True =! 0&lt;br /&gt;
** False == 0&lt;br /&gt;
&lt;br /&gt;
Assigning a value to a variable always converts the variable to the newly assigned value's type.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
&lt;br /&gt;
 ultimateAutopilot= 128.6432&lt;br /&gt;
* This results in the variable '''ultimateAutopilot''' containing a numeric value of 128.6432&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 ultimateAutopilot= &amp;quot;Error prone&amp;quot;&lt;br /&gt;
* This results in the variable '''ultimateAutopilot''' to be a string variable &amp;quot;''Error prone''&amp;quot;, and numeric value of 128.6432 is removed.&lt;br /&gt;
&lt;br /&gt;
==== Decimals ====&lt;br /&gt;
&lt;br /&gt;
Numeric values in the programming language are 64-bit integers.&amp;lt;br&amp;gt;&lt;br /&gt;
The variables hold decimal numbers up to four decimal accuracy.&lt;br /&gt;
&lt;br /&gt;
 pieVariable= 3.1415&lt;br /&gt;
* The above script assigns a numeric value of 3.1415 to the variable '''pieVariable'''.&lt;br /&gt;
** Supplying more precise values than the variables can store works, but doesn't affect the end result.&lt;br /&gt;
&lt;br /&gt;
 notPieVariable= 0.5772156649&lt;br /&gt;
* The above script attempts to assign a numeric value of 0.5772156649 to the variable '''notPieVariable'''.&lt;br /&gt;
* The end result however is notPieVariable == 0.5772&lt;br /&gt;
** Here, the more precise values are cut, leaving only four decimals behind.&lt;br /&gt;
&lt;br /&gt;
==== Strings ====&lt;br /&gt;
&lt;br /&gt;
To specify a string literal in the programming language, the desired string value must be surrounded with double quotation marks.&lt;br /&gt;
&lt;br /&gt;
 badRobots= &amp;quot;saltberia&amp;quot; &lt;br /&gt;
* This script assigns the string value of &amp;quot;''saltberia''&amp;quot; to the variable '''badRobots'''.&lt;br /&gt;
&lt;br /&gt;
==== Device fields / External variables ====&lt;br /&gt;
&lt;br /&gt;
External variables and device fields can be used in the programming language with the following syntax:&amp;lt;br&amp;gt;&lt;br /&gt;
* ''':variableName'''&lt;br /&gt;
**'''variableName''' being the configured device field id.&lt;br /&gt;
A colon prefix  ''':'''  is used to tell the script that an externable variable is being accessed, instead of using one that may or may not be declared or used in the script.&amp;lt;br&amp;gt;&lt;br /&gt;
A programmable [[YOLOL Chip|chip]] that is connected to a [[Devices and machines|device]] has access to all the devices in the same [[Data networks|network]].&amp;lt;br&amp;gt;&lt;br /&gt;
It can then modify and listen to any device fields it has access to.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 if ''':ButtonState''' == 1 then ''':DoorState''' = 1 end&lt;br /&gt;
* The script above will send the value of 1 to any devices listening to the device field '''DoorState''' if the value of '''ButtonState''' is 1 in the data network.&lt;br /&gt;
&lt;br /&gt;
== Operators and commands ==&lt;br /&gt;
&lt;br /&gt;
Note that the available operators may be limited by the type of the programmable [[Chip|chip]].&amp;lt;br&amp;gt;&lt;br /&gt;
Basic chips have a limited selection of functions while more advanced ones can perform more complex operations natively.&lt;br /&gt;
&lt;br /&gt;
=== Basic arithmetic and assignment operators ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Operation || Numeric operation || String operation&lt;br /&gt;
|-&lt;br /&gt;
| A + B || Addition || String A is appended by String B.&lt;br /&gt;
|-&lt;br /&gt;
| A - B || Subtraction || The last appearance of String B in String A is removed from String A.&lt;br /&gt;
|-&lt;br /&gt;
| A * B || Multiplication || Runtime error. The rest of the line is skipped.&lt;br /&gt;
|-&lt;br /&gt;
| A / B || Division || Runtime error. The rest of the line is skipped.&lt;br /&gt;
|-&lt;br /&gt;
| A ++ || PostIncrement (A=A+1) || Appends a space to String A. Evaluates to the original value.&lt;br /&gt;
|-&lt;br /&gt;
| A -- || PostDecrement (A=A-1) || Removes the last character of the string. Results in runtime error when trying to remove &amp;quot;&amp;quot;. Evaluates to the original value.&lt;br /&gt;
|-&lt;br /&gt;
| ++ A  || PreIncrement (A=A+1) || Appends a space to String A. Evaluates to the modified value.&lt;br /&gt;
|-&lt;br /&gt;
| -- A || PreDecrement (A=A-1) || Removes the last character of the string. Results in runtime error when trying to remove &amp;quot;&amp;quot;. Evaluates to the modified value.&lt;br /&gt;
|-&lt;br /&gt;
| A = B || Assignment (Variable A is set to the value of variable B) || Assignment&lt;br /&gt;
|-&lt;br /&gt;
| A += B || Addition-assignment (A=A+B) || A is assigned the value of string-operation A+B&lt;br /&gt;
|-&lt;br /&gt;
| A -= B || Subtraction-assignment (A=A-B) || A is assigned the value of string-operation A-B&lt;br /&gt;
|-&lt;br /&gt;
| A *= B || Multiplication-assignment (A=A*B) || Runtime error for string variables. The rest of the line is skipped.&lt;br /&gt;
|-&lt;br /&gt;
| A /= B || Division-assignment (A=A/B) || Runtime error for string variables. The rest of the line is skipped.&lt;br /&gt;
|-&lt;br /&gt;
| A %= B || Modulo-assignment (A=A%B) || Runtime error for string variables. The rest of the line is skipped.&lt;br /&gt;
|-&lt;br /&gt;
| A ^ B || Exponentiation || Runtime error for string variables. The rest of the line is skipped.&lt;br /&gt;
|-&lt;br /&gt;
| A % B || Modulo || Runtime error for string variables. The rest of the line is skipped.&lt;br /&gt;
|-&lt;br /&gt;
| ABS A || Modulus (absol value) (A=A if A&amp;gt;=0, else A=-A) || Runtime error for string variables. The rest of the line is skipped.&lt;br /&gt;
|-&lt;br /&gt;
| A! || Factorial || Runtime error for string variables. The rest of the line is skipped.&lt;br /&gt;
|-&lt;br /&gt;
| SQRT A || Square root of A || Runtime error for string variables. The rest of the line is skipped.&lt;br /&gt;
|-&lt;br /&gt;
| SIN A || Sine of A (degrees) || Runtime error for string variables. The rest of the line is skipped.&lt;br /&gt;
|-&lt;br /&gt;
| COS A || Cosine of A (degrees) || Runtime error for string variables. The rest of the line is skipped.&lt;br /&gt;
|-&lt;br /&gt;
| TAN A || Tangent of A (degrees) || Runtime error for string variables. The rest of the line is skipped.&lt;br /&gt;
|-&lt;br /&gt;
| ARCSIN A || Inverse sine of A (degrees) || Runtime error for string variables. The rest of the line is skipped.&lt;br /&gt;
|-&lt;br /&gt;
| ARCCOS A || Inverse cosine of A (degrees) || Runtime error for string variables. The rest of the line is skipped.&lt;br /&gt;
|-&lt;br /&gt;
| ARCTAN A || Inverse tangent of A (degrees) || Runtime error for string variables. The rest of the line is skipped.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Logical operators ===&lt;br /&gt;
&lt;br /&gt;
Logical operators are checks that identify if the statement is true or false.&amp;lt;br&amp;gt;&lt;br /&gt;
All logical operations return either '''&amp;quot;0 for False&amp;quot;''' or '''&amp;quot;1 for True&amp;quot;'''&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Operation || Numeric operation || String operation&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt; B || Less than || returns 1 if String A is first in alphabetical order, returns 0 if not.&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;gt; B || Greater than || returns 0 if String A is first in alphabetical order, returns 1 if not.&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;= B ||Less than or equal to || returns 1 if String A is first in alphabetical order or identical to String B, returns 0 if not.&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;gt;= B || Greater than or equal to || returns 0 if String A is first in alphabetical order or identical to String B, returns 1 if not.&lt;br /&gt;
|-&lt;br /&gt;
| A ~= B || Not equal to || returns 1 if String A is not equal to String B, 0 if it is.&lt;br /&gt;
|-&lt;br /&gt;
| A == B || Equal to || returns 1 if String A is equal to String B, 0 if not.&lt;br /&gt;
|}&lt;br /&gt;
It's also possible to use '''not''', '''and''' and '''or''' keywords to set up more complicated conditions than simple variable value checks.&lt;br /&gt;
&lt;br /&gt;
=== Mixing variable types in operations ===&lt;br /&gt;
&lt;br /&gt;
Mixing variable types in an operation handles the operation using all parameters as ''strings''.&lt;br /&gt;
&lt;br /&gt;
 previouslyNumber= &amp;quot;10&amp;quot; + 15&lt;br /&gt;
* The above script results in '''previouslyNumber''' containing the string value &amp;quot;1015&amp;quot;.&lt;br /&gt;
** Note that the involved parameters themselves don't change types, their values are just cast as strings for the purpose of the operation:&lt;br /&gt;
 &lt;br /&gt;
 purelyNumber = 15&lt;br /&gt;
 purelyString = &amp;quot;10&amp;quot; + purelyNumber&lt;br /&gt;
* When this script has executed, '''purelyString''' contains the string value of &amp;quot;1015&amp;quot;, while '''purelyNumber''' still contains the numeric value of 15.&lt;br /&gt;
&lt;br /&gt;
=== Goto ===&lt;br /&gt;
&lt;br /&gt;
Goto syntax is used when the normal script reading order from 1-&amp;gt;20 is not desired, or needs to be altered.&lt;br /&gt;
&lt;br /&gt;
Goto is used with the following syntax:&lt;br /&gt;
*'''goto lineNumber'''&lt;br /&gt;
** lineNumber is the line which the command will take the script execution.&amp;lt;br&amp;gt;&lt;br /&gt;
** Any remaining script that is on the same line after the goto-command will not be executed.&lt;br /&gt;
*** using if statements before goto ignores goto syntax, assuming the if-statement is false&lt;br /&gt;
** Multiple goto commands can be added on the same line using conditionals, as '''False''' goto commands are skipped.&lt;br /&gt;
&lt;br /&gt;
 if variable == 5 then '''goto 4''' end '''goto 6'''&lt;br /&gt;
&lt;br /&gt;
The script above will go to line number 4, if '''variable''' has a value of 5.&amp;lt;br&amp;gt;&lt;br /&gt;
Otherwise it will go to line number 6.&lt;br /&gt;
&lt;br /&gt;
=== If-else conditional ===&lt;br /&gt;
&lt;br /&gt;
If-else statements are used to branch out the script into different paths.&amp;lt;br&amp;gt;&lt;br /&gt;
They use the following syntax:&lt;br /&gt;
* '''if ''condition'' then ''statement'' else ''statement'' end'''&lt;br /&gt;
** Condition is a statement that results in a numeric value (where 0 is parsed as False, anything else as True), and statements are pieces of script that are run.&lt;br /&gt;
** All If-else conditional stations must have '''end''' syntax written after statement is complete.&lt;br /&gt;
&lt;br /&gt;
If can be used to branch script execution into two possible outcomes temporarily based on variable value(s).&amp;lt;br&amp;gt;&lt;br /&gt;
'''Example:'''&amp;lt;br&amp;gt;&lt;br /&gt;
 '''if''' variable ~= 2 '''then''' endResult = 3 '''else''' endResult = 4 '''end'''&lt;br /&gt;
&lt;br /&gt;
* This script sets the value of '''endResult''' to 3 if '''variable''' does not have the value of 2.&lt;br /&gt;
* If '''variable''''s value is 2, '''endResult''' is set to the value of 4.&lt;br /&gt;
&lt;br /&gt;
Note that the else statement -part can be left out if not needed.&amp;lt;br&amp;gt;&lt;br /&gt;
'''Example:'''&amp;lt;br&amp;gt;&lt;br /&gt;
 '''if''' variable ~= 2 '''then''' endResult = 3 '''end'''&lt;br /&gt;
*This script only sets the value of 3 to '''endResult''' if '''variable''' does not have a value of 2, and doesn't do anything else.&lt;br /&gt;
&lt;br /&gt;
==== Nesting if statements ====&lt;br /&gt;
&lt;br /&gt;
It is possible to place if-conditionals inside the true/false statement blocks to achieve further branching of execution.&amp;lt;br&amp;gt;&lt;br /&gt;
Example:&amp;lt;br&amp;gt;&lt;br /&gt;
 '''if''' variable == 0 '''then''' endResult = 1 '''else''' '''if''' variable == 1 '''then''' endResult = 2 '''end end''' &lt;br /&gt;
* This script sets '''endResult''' to 1 if '''variable''' equals 0.&lt;br /&gt;
* If '''variable''' doesn't equal 0, but it equals 1, '''endResult''' is set to 2.&lt;br /&gt;
&lt;br /&gt;
Example:&amp;lt;br&amp;gt;&lt;br /&gt;
 '''if''' variable == 0 '''then''' '''if''' endResult == 1 '''then''' endResult = 2 '''end''' '''else''' endResult = 1 '''end'''&lt;br /&gt;
* This script sets '''endResult''' to 2 if '''variable''' has a value of 0, and '''endResult''' equals to 1.&lt;br /&gt;
* Otherwise it sets '''endResult''' to 1.&lt;br /&gt;
&lt;br /&gt;
Note that it may be easier to plan and debug the script flow by formatting the script containing nested if-statements to a neater indented form.&amp;lt;br&amp;gt;&lt;br /&gt;
Also note that writing the script like this won't work on the [[Chip|chip]], but doing this can still be useful when debugging scripts.&lt;br /&gt;
&lt;br /&gt;
This is the second nested example formatted:&lt;br /&gt;
&lt;br /&gt;
 '''if''' variable == 0 '''then'''&lt;br /&gt;
     '''if''' otherVariable == 1 '''then'''&lt;br /&gt;
         otherVariable = 2&lt;br /&gt;
     '''end'''&lt;br /&gt;
 '''else'''&lt;br /&gt;
     otherVariable = 1&lt;br /&gt;
 '''end'''&lt;br /&gt;
&lt;br /&gt;
=== Comments ===&lt;br /&gt;
&lt;br /&gt;
Comments are useful when writing code that is used by a lot of programmers.&amp;lt;br&amp;gt;&lt;br /&gt;
Note that comments also use up space from the pre-determined 70 character line limit and are not excluded from it.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Commenting is used with the following syntax:&lt;br /&gt;
*// '''text'''&lt;br /&gt;
** Text can be any single-line set of characters.&lt;br /&gt;
&lt;br /&gt;
 '''//''' This is a comment. It will explain how other lines of script work.&lt;br /&gt;
* An example of a possible comment syntax&lt;br /&gt;
&lt;br /&gt;
== Errors ==&lt;br /&gt;
&lt;br /&gt;
There are two types of errors that can happen with the programming language.&lt;br /&gt;
# Syntax errors&lt;br /&gt;
# Runtime errors&lt;br /&gt;
&lt;br /&gt;
* Syntax errors come from invalid and unparseable script and will result in the whole line not being executed.&lt;br /&gt;
* Runtime errors are only catchable while the script is being executed. They result in the execution of the line being interrupted, but any effects until the error will remain.&lt;br /&gt;
&lt;br /&gt;
[[Category:Networks|YOLOL]]&lt;/div&gt;</summary>
		<author><name>Spacebar</name></author>
	</entry>
	<entry>
		<id>https://wiki.starbasegame.com/index.php?title=YOLOL&amp;diff=4709</id>
		<title>YOLOL</title>
		<link rel="alternate" type="text/html" href="https://wiki.starbasegame.com/index.php?title=YOLOL&amp;diff=4709"/>
		<updated>2019-06-10T18:03:28Z</updated>

		<summary type="html">&lt;p&gt;Spacebar: /* Related pages */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
YOLOL is a programming language used to control and manage electrical [[Devices and machines|devices]].&amp;lt;br&amp;gt;&lt;br /&gt;
The code is written on lines in [[YOLOL Chip|YOLOL chips]] which are then inserted into [[Chip socket|chip sockets]], that read and relay their messages.&amp;lt;br&amp;gt;&lt;br /&gt;
The programming language enables the programming and controlling of almost any device within the known universe.&lt;br /&gt;
&lt;br /&gt;
== Basic information ==&lt;br /&gt;
&lt;br /&gt;
=== How it works? ===&lt;br /&gt;
The code is written to and executed from programmable chips, and can be used to both monitor and control electrical [[Devices and machines|devices]] connected to a [[Data networks|data network]].&amp;lt;br&amp;gt;&lt;br /&gt;
Lines of code are executed in sequence from top to bottom, repeating the cycle of the chip after the last line has been executed, unless the script includes programmed instructions for specific line changes or stopping the execution completely.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To put it simply:&lt;br /&gt;
&lt;br /&gt;
# Code execution starts from line 1&lt;br /&gt;
# After reading line 1, it proceeds to the next line based on the chip's time interval&lt;br /&gt;
# The process is then repeated for the line 2, 3, 4... etc.&lt;br /&gt;
# The chip will begin executing line 1 again after the last line has been executed (unless the script includes programmed instructions for specific line changes or stopping the execution completely)&lt;br /&gt;
&lt;br /&gt;
=== Related pages ===&lt;br /&gt;
&lt;br /&gt;
* [[Data networks]]&lt;br /&gt;
* [[Devices and machines]]&lt;br /&gt;
* [[Universal tool|Universal tool]]&lt;br /&gt;
* [[YOLOL Chip|Chip]]&lt;br /&gt;
&lt;br /&gt;
== Command references ==&lt;br /&gt;
&lt;br /&gt;
=== Case insensitive ===&lt;br /&gt;
&lt;br /&gt;
The programming language is fully case '''insensitive'''.&amp;lt;br&amp;gt;&lt;br /&gt;
This means that the following two example scripts function identically to each other:&lt;br /&gt;
&lt;br /&gt;
 if '''ButtonState''' == 1 then '''DoorState''' = 1 end&lt;br /&gt;
&lt;br /&gt;
 IF '''buttonstate''' == 1 THEN '''doorstate''' = 1 END&lt;br /&gt;
* Both scripts set the '''doorstate''' into 1, if '''buttonstate''' value is 1.&lt;br /&gt;
* The characters in the programming language can be written in either lowercase or uppercase letters.&lt;br /&gt;
** They are still parsed as case insensitive.&lt;br /&gt;
** This way it's possible to have the code look a bit more organized.&lt;br /&gt;
&lt;br /&gt;
=== Variables ===&lt;br /&gt;
&lt;br /&gt;
* The variables in the programming language are weakly typed (don't enforce type validity), and support two data types: '''Fixed-point decimals''' (up to 0.001 precision) and '''Strings'''.&lt;br /&gt;
** To put it simply, the variables can either be introduced as strings or numbers, ignoring the earlier variable type if the previous type is not identical, without causing an error.&lt;br /&gt;
* Each variable is always of a single type, though it will be implicitly converted when required.&lt;br /&gt;
* The default value of an uninitialized variable is 0, and null values are not supported.&lt;br /&gt;
* True/False are numerical values of non-0 and 0.&lt;br /&gt;
** True =! 0&lt;br /&gt;
** False == 0&lt;br /&gt;
&lt;br /&gt;
Assigning a value to a variable always converts the variable to the newly assigned value's type.&lt;br /&gt;
&lt;br /&gt;
'''Example:'''&lt;br /&gt;
&lt;br /&gt;
 ultimateAutopilot= 128.6432&lt;br /&gt;
* This results in the variable '''ultimateAutopilot''' containing a numeric value of 128.6432&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 ultimateAutopilot= &amp;quot;Error prone&amp;quot;&lt;br /&gt;
* This results in the variable '''ultimateAutopilot''' to be a string variable &amp;quot;''Error prone''&amp;quot;, and numeric value of 128.6432 is removed.&lt;br /&gt;
&lt;br /&gt;
==== Decimals ====&lt;br /&gt;
&lt;br /&gt;
Numeric values in the programming language are 64-bit integers.&amp;lt;br&amp;gt;&lt;br /&gt;
The variables hold decimal numbers up to four decimal accuracy.&lt;br /&gt;
&lt;br /&gt;
 pieVariable= 3.1415&lt;br /&gt;
* The above script assigns a numeric value of 3.1415 to the variable '''pieVariable'''.&lt;br /&gt;
** Supplying more precise values than the variables can store works, but doesn't affect the end result.&lt;br /&gt;
&lt;br /&gt;
 notPieVariable= 0.5772156649&lt;br /&gt;
* The above script attempts to assign a numeric value of 0.5772156649 to the variable '''notPieVariable'''.&lt;br /&gt;
* The end result however is notPieVariable == 0.5772&lt;br /&gt;
** Here, the more precise values are cut, leaving only four decimals behind.&lt;br /&gt;
&lt;br /&gt;
==== Strings ====&lt;br /&gt;
&lt;br /&gt;
To specify a string literal in the programming language, the desired string value must be surrounded with double quotation marks.&lt;br /&gt;
&lt;br /&gt;
 badRobots= &amp;quot;saltberia&amp;quot; &lt;br /&gt;
* This script assigns the string value of &amp;quot;''saltberia''&amp;quot; to the variable '''badRobots'''.&lt;br /&gt;
&lt;br /&gt;
==== Device fields / External variables ====&lt;br /&gt;
&lt;br /&gt;
External variables and device fields can be used in the programming language with the following syntax:&amp;lt;br&amp;gt;&lt;br /&gt;
* ''':variableName'''&lt;br /&gt;
**'''variableName''' being the configured device field id.&lt;br /&gt;
A colon prefix  ''':'''  is used to tell the script that an externable variable is being accessed, instead of using one that may or may not be declared or used in the script.&amp;lt;br&amp;gt;&lt;br /&gt;
A programmable [[Chip|chip]] that is connected to a [[Devices and machines|device]] has access to all the devices in the same [[Data networks|network]].&amp;lt;br&amp;gt;&lt;br /&gt;
It can then modify and listen to any device fields it has access to.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 if ''':ButtonState''' == 1 then ''':DoorState''' = 1 end&lt;br /&gt;
* The script above will send the value of 1 to any devices listening to the device field '''DoorState''' if the value of '''ButtonState''' is 1 in the data network.&lt;br /&gt;
&lt;br /&gt;
== Operators and commands ==&lt;br /&gt;
&lt;br /&gt;
Note that the available operators may be limited by the type of the programmable [[Chip|chip]].&amp;lt;br&amp;gt;&lt;br /&gt;
Basic chips have a limited selection of functions while more advanced ones can perform more complex operations natively.&lt;br /&gt;
&lt;br /&gt;
=== Basic arithmetic and assignment operators ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Operation || Numeric operation || String operation&lt;br /&gt;
|-&lt;br /&gt;
| A + B || Addition || String A is appended by String B.&lt;br /&gt;
|-&lt;br /&gt;
| A - B || Subtraction || The last appearance of String B in String A is removed from String A.&lt;br /&gt;
|-&lt;br /&gt;
| A * B || Multiplication || Runtime error. The rest of the line is skipped.&lt;br /&gt;
|-&lt;br /&gt;
| A / B || Division || Runtime error. The rest of the line is skipped.&lt;br /&gt;
|-&lt;br /&gt;
| A ++ || PostIncrement (A=A+1) || Appends a space to String A. Evaluates to the original value.&lt;br /&gt;
|-&lt;br /&gt;
| A -- || PostDecrement (A=A-1) || Removes the last character of the string. Results in runtime error when trying to remove &amp;quot;&amp;quot;. Evaluates to the original value.&lt;br /&gt;
|-&lt;br /&gt;
| ++ A  || PreIncrement (A=A+1) || Appends a space to String A. Evaluates to the modified value.&lt;br /&gt;
|-&lt;br /&gt;
| -- A || PreDecrement (A=A-1) || Removes the last character of the string. Results in runtime error when trying to remove &amp;quot;&amp;quot;. Evaluates to the modified value.&lt;br /&gt;
|-&lt;br /&gt;
| A = B || Assignment (Variable A is set to the value of variable B) || Assignment&lt;br /&gt;
|-&lt;br /&gt;
| A += B || Addition-assignment (A=A+B) || A is assigned the value of string-operation A+B&lt;br /&gt;
|-&lt;br /&gt;
| A -= B || Subtraction-assignment (A=A-B) || A is assigned the value of string-operation A-B&lt;br /&gt;
|-&lt;br /&gt;
| A *= B || Multiplication-assignment (A=A*B) || Runtime error for string variables. The rest of the line is skipped.&lt;br /&gt;
|-&lt;br /&gt;
| A /= B || Division-assignment (A=A/B) || Runtime error for string variables. The rest of the line is skipped.&lt;br /&gt;
|-&lt;br /&gt;
| A %= B || Modulo-assignment (A=A%B) || Runtime error for string variables. The rest of the line is skipped.&lt;br /&gt;
|-&lt;br /&gt;
| A ^ B || Exponentiation || Runtime error for string variables. The rest of the line is skipped.&lt;br /&gt;
|-&lt;br /&gt;
| A % B || Modulo || Runtime error for string variables. The rest of the line is skipped.&lt;br /&gt;
|-&lt;br /&gt;
| ABS A || Modulus (absol value) (A=A if A&amp;gt;=0, else A=-A) || Runtime error for string variables. The rest of the line is skipped.&lt;br /&gt;
|-&lt;br /&gt;
| A! || Factorial || Runtime error for string variables. The rest of the line is skipped.&lt;br /&gt;
|-&lt;br /&gt;
| SQRT A || Square root of A || Runtime error for string variables. The rest of the line is skipped.&lt;br /&gt;
|-&lt;br /&gt;
| SIN A || Sine of A (degrees) || Runtime error for string variables. The rest of the line is skipped.&lt;br /&gt;
|-&lt;br /&gt;
| COS A || Cosine of A (degrees) || Runtime error for string variables. The rest of the line is skipped.&lt;br /&gt;
|-&lt;br /&gt;
| TAN A || Tangent of A (degrees) || Runtime error for string variables. The rest of the line is skipped.&lt;br /&gt;
|-&lt;br /&gt;
| ARCSIN A || Inverse sine of A (degrees) || Runtime error for string variables. The rest of the line is skipped.&lt;br /&gt;
|-&lt;br /&gt;
| ARCCOS A || Inverse cosine of A (degrees) || Runtime error for string variables. The rest of the line is skipped.&lt;br /&gt;
|-&lt;br /&gt;
| ARCTAN A || Inverse tangent of A (degrees) || Runtime error for string variables. The rest of the line is skipped.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Logical operators ===&lt;br /&gt;
&lt;br /&gt;
Logical operators are checks that identify if the statement is true or false.&amp;lt;br&amp;gt;&lt;br /&gt;
All logical operations return either '''&amp;quot;0 for False&amp;quot;''' or '''&amp;quot;1 for True&amp;quot;'''&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Operation || Numeric operation || String operation&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt; B || Less than || returns 1 if String A is first in alphabetical order, returns 0 if not.&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;gt; B || Greater than || returns 0 if String A is first in alphabetical order, returns 1 if not.&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;lt;= B ||Less than or equal to || returns 1 if String A is first in alphabetical order or identical to String B, returns 0 if not.&lt;br /&gt;
|-&lt;br /&gt;
| A &amp;gt;= B || Greater than or equal to || returns 0 if String A is first in alphabetical order or identical to String B, returns 1 if not.&lt;br /&gt;
|-&lt;br /&gt;
| A ~= B || Not equal to || returns 1 if String A is not equal to String B, 0 if it is.&lt;br /&gt;
|-&lt;br /&gt;
| A == B || Equal to || returns 1 if String A is equal to String B, 0 if not.&lt;br /&gt;
|}&lt;br /&gt;
It's also possible to use '''not''', '''and''' and '''or''' keywords to set up more complicated conditions than simple variable value checks.&lt;br /&gt;
&lt;br /&gt;
=== Mixing variable types in operations ===&lt;br /&gt;
&lt;br /&gt;
Mixing variable types in an operation handles the operation using all parameters as ''strings''.&lt;br /&gt;
&lt;br /&gt;
 previouslyNumber= &amp;quot;10&amp;quot; + 15&lt;br /&gt;
* The above script results in '''previouslyNumber''' containing the string value &amp;quot;1015&amp;quot;.&lt;br /&gt;
** Note that the involved parameters themselves don't change types, their values are just cast as strings for the purpose of the operation:&lt;br /&gt;
 &lt;br /&gt;
 purelyNumber = 15&lt;br /&gt;
 purelyString = &amp;quot;10&amp;quot; + purelyNumber&lt;br /&gt;
* When this script has executed, '''purelyString''' contains the string value of &amp;quot;1015&amp;quot;, while '''purelyNumber''' still contains the numeric value of 15.&lt;br /&gt;
&lt;br /&gt;
=== Goto ===&lt;br /&gt;
&lt;br /&gt;
Goto syntax is used when the normal script reading order from 1-&amp;gt;20 is not desired, or needs to be altered.&lt;br /&gt;
&lt;br /&gt;
Goto is used with the following syntax:&lt;br /&gt;
*'''goto lineNumber'''&lt;br /&gt;
** lineNumber is the line which the command will take the script execution.&amp;lt;br&amp;gt;&lt;br /&gt;
** Any remaining script that is on the same line after the goto-command will not be executed.&lt;br /&gt;
*** using if statements before goto ignores goto syntax, assuming the if-statement is false&lt;br /&gt;
** Multiple goto commands can be added on the same line using conditionals, as '''False''' goto commands are skipped.&lt;br /&gt;
&lt;br /&gt;
 if variable == 5 then '''goto 4''' end '''goto 6'''&lt;br /&gt;
&lt;br /&gt;
The script above will go to line number 4, if '''variable''' has a value of 5.&amp;lt;br&amp;gt;&lt;br /&gt;
Otherwise it will go to line number 6.&lt;br /&gt;
&lt;br /&gt;
=== If-else conditional ===&lt;br /&gt;
&lt;br /&gt;
If-else statements are used to branch out the script into different paths.&amp;lt;br&amp;gt;&lt;br /&gt;
They use the following syntax:&lt;br /&gt;
* '''if ''condition'' then ''statement'' else ''statement'' end'''&lt;br /&gt;
** Condition is a statement that results in a numeric value (where 0 is parsed as False, anything else as True), and statements are pieces of script that are run.&lt;br /&gt;
** All If-else conditional stations must have '''end''' syntax written after statement is complete.&lt;br /&gt;
&lt;br /&gt;
If can be used to branch script execution into two possible outcomes temporarily based on variable value(s).&amp;lt;br&amp;gt;&lt;br /&gt;
'''Example:'''&amp;lt;br&amp;gt;&lt;br /&gt;
 '''if''' variable ~= 2 '''then''' endResult = 3 '''else''' endResult = 4 '''end'''&lt;br /&gt;
&lt;br /&gt;
* This script sets the value of '''endResult''' to 3 if '''variable''' does not have the value of 2.&lt;br /&gt;
* If '''variable''''s value is 2, '''endResult''' is set to the value of 4.&lt;br /&gt;
&lt;br /&gt;
Note that the else statement -part can be left out if not needed.&amp;lt;br&amp;gt;&lt;br /&gt;
'''Example:'''&amp;lt;br&amp;gt;&lt;br /&gt;
 '''if''' variable ~= 2 '''then''' endResult = 3 '''end'''&lt;br /&gt;
*This script only sets the value of 3 to '''endResult''' if '''variable''' does not have a value of 2, and doesn't do anything else.&lt;br /&gt;
&lt;br /&gt;
==== Nesting if statements ====&lt;br /&gt;
&lt;br /&gt;
It is possible to place if-conditionals inside the true/false statement blocks to achieve further branching of execution.&amp;lt;br&amp;gt;&lt;br /&gt;
Example:&amp;lt;br&amp;gt;&lt;br /&gt;
 '''if''' variable == 0 '''then''' endResult = 1 '''else''' '''if''' variable == 1 '''then''' endResult = 2 '''end end''' &lt;br /&gt;
* This script sets '''endResult''' to 1 if '''variable''' equals 0.&lt;br /&gt;
* If '''variable''' doesn't equal 0, but it equals 1, '''endResult''' is set to 2.&lt;br /&gt;
&lt;br /&gt;
Example:&amp;lt;br&amp;gt;&lt;br /&gt;
 '''if''' variable == 0 '''then''' '''if''' endResult == 1 '''then''' endResult = 2 '''end''' '''else''' endResult = 1 '''end'''&lt;br /&gt;
* This script sets '''endResult''' to 2 if '''variable''' has a value of 0, and '''endResult''' equals to 1.&lt;br /&gt;
* Otherwise it sets '''endResult''' to 1.&lt;br /&gt;
&lt;br /&gt;
Note that it may be easier to plan and debug the script flow by formatting the script containing nested if-statements to a neater indented form.&amp;lt;br&amp;gt;&lt;br /&gt;
Also note that writing the script like this won't work on the [[Chip|chip]], but doing this can still be useful when debugging scripts.&lt;br /&gt;
&lt;br /&gt;
This is the second nested example formatted:&lt;br /&gt;
&lt;br /&gt;
 '''if''' variable == 0 '''then'''&lt;br /&gt;
     '''if''' otherVariable == 1 '''then'''&lt;br /&gt;
         otherVariable = 2&lt;br /&gt;
     '''end'''&lt;br /&gt;
 '''else'''&lt;br /&gt;
     otherVariable = 1&lt;br /&gt;
 '''end'''&lt;br /&gt;
&lt;br /&gt;
=== Comments ===&lt;br /&gt;
&lt;br /&gt;
Comments are useful when writing code that is used by a lot of programmers.&amp;lt;br&amp;gt;&lt;br /&gt;
Note that comments also use up space from the pre-determined 70 character line limit and are not excluded from it.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Commenting is used with the following syntax:&lt;br /&gt;
*// '''text'''&lt;br /&gt;
** Text can be any single-line set of characters.&lt;br /&gt;
&lt;br /&gt;
 '''//''' This is a comment. It will explain how other lines of script work.&lt;br /&gt;
* An example of a possible comment syntax&lt;br /&gt;
&lt;br /&gt;
== Errors ==&lt;br /&gt;
&lt;br /&gt;
There are two types of errors that can happen with the programming language.&lt;br /&gt;
# Syntax errors&lt;br /&gt;
# Runtime errors&lt;br /&gt;
&lt;br /&gt;
* Syntax errors come from invalid and unparseable script and will result in the whole line not being executed.&lt;br /&gt;
* Runtime errors are only catchable while the script is being executed. They result in the execution of the line being interrupted, but any effects until the error will remain.&lt;br /&gt;
&lt;br /&gt;
[[Category:Networks|YOLOL]]&lt;/div&gt;</summary>
		<author><name>Spacebar</name></author>
	</entry>
	<entry>
		<id>https://wiki.starbasegame.com/index.php?title=Vasama&amp;diff=4708</id>
		<title>Vasama</title>
		<link rel="alternate" type="text/html" href="https://wiki.starbasegame.com/index.php?title=Vasama&amp;diff=4708"/>
		<updated>2019-06-10T17:52:15Z</updated>

		<summary type="html">&lt;p&gt;Spacebar: /* Ship description */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{|{{Infobox ship begin}}&lt;br /&gt;
{{Infobox ship career&lt;br /&gt;
|Hide header=&lt;br /&gt;
|Ship class=Civilian ship, moped&lt;br /&gt;
|Ship name=Vasama&lt;br /&gt;
&lt;br /&gt;
}}&lt;br /&gt;
|-&lt;br /&gt;
| General use: &lt;br /&gt;
|Casual use&lt;br /&gt;
|-&lt;br /&gt;
{{Infobox ship characteristics&lt;br /&gt;
|Ship crew=1 pilot&lt;br /&gt;
|&lt;br /&gt;
}}&lt;br /&gt;
|-&lt;br /&gt;
| Thrust power: &lt;br /&gt;
| 10,000&lt;br /&gt;
|-&lt;br /&gt;
| Flight time: &lt;br /&gt;
|88.9 minutes&lt;br /&gt;
|-&lt;br /&gt;
| [[Thrusters]]: &lt;br /&gt;
|5 maneuver&lt;br /&gt;
|-&lt;br /&gt;
| [[Propellant]] containers: &lt;br /&gt;
|1 small&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Ship description ==&lt;br /&gt;
Vasama is a very small ship, powered by batteries. &amp;lt;br&amp;gt;&lt;br /&gt;
Everything in the ship is controlled by four [[YOLOL Chip|Yolol chips]], even flying.&amp;lt;br&amp;gt;&lt;br /&gt;
The ship is balanced with plates, which means removing plates from the ship will alter flying.&amp;lt;br&amp;gt;&lt;br /&gt;
The ship is generally used to get around the massive [[Capital Mega Station]], instead of walking.&amp;lt;br&amp;gt;&lt;br /&gt;
Vasama is a fully electric spaceship.&lt;br /&gt;
&lt;br /&gt;
== Ship location ==&lt;br /&gt;
[[Capital Mega Station|Capital Mega Stations]] sell and lease Vasama mopeds.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- scooter --&amp;gt;&lt;br /&gt;
&amp;lt;!-- segway --&amp;gt;&lt;br /&gt;
&amp;lt;!-- motorcycle --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Spaceships|Vasama]]&lt;br /&gt;
[[Category:Civilian spaceships|Vasama]]&lt;/div&gt;</summary>
		<author><name>Spacebar</name></author>
	</entry>
</feed>