

What does this have to do with automating production on your space ship? Well, the programming block is just giving you access to the computer, so if you want to create complex piston control routines, you're gonna need to know what datatypes are used. We don't think in streams of 1s and 0s, but computers do. What you really need to know about encodings (also called datatypes, or types), is that they translate 1s and 0s into something a human being can recognize. So to express the number 52 using just 1s and 0s, we could type in 110100. Because computers don't understand what a 2 is, we just add another digit into our number. So, we can count by saying, 0, 1, 10, 11-which would represent counting the numbers 0, 1, 2, and 3. If we only have 1s and 0s to work with, we can change our counting system from a base 10 to base 2. How do you describe the number 52 using only 1s and 0s? Well, 52 is two numbers, 5 and 2, where 5 represents 5 tens, and 2 represents two. Here's a confusing, but educational, long-explanation of encodings, feel free to skip this paragraph. 1s and 0s don't mean a whole lot to human beings, so we organize those 1s and 0s into groups called encodings. Data can be represented a lot of different way to a computer-it's all just 1s and 0s on the chip itself. The return type represents data in the computer. The part in the parenthesis (int x) are called arguments, or parameters, or input values. The second bit, addOne, is what I named my function. The first thing written, the "int" is called the return type (more on this later).
What you'll want to change is theThe fourth line starting with GridTerminalSystem is where you'll do some of your own customization. The first three lines are pretty much mandatory-they setup the programming block to be used and put all the blocks on your station/ship into the script. Var inventory = inventoryOwner.GetInventory(0) Īntenna.SetCustomName("Cargo: " firstCargo.DisplayNameText + " contains " +)

Var inventoryOwner = (IMyInventoryOwner)firstCargo

GridTerminalSystem.GetBlocksOfType(blocks) Īntenna.SetCustomName("Whatever you want") Īntenna.SetCustomName("Location :" antenna.GetPosition().ToString())
Var blocks = new List