Space Engineers – Commands for In-Game Script Manual for PLC-OS Guide

Space Engineers – Commands for In-Game Script Manual for PLC-OS Guide 1 - steamlists.com
Space Engineers – Commands for In-Game Script Manual for PLC-OS Guide 1 - steamlists.com

Table of Contents

InGame Script Manual for PLC-OS
 
 

Introduction

This is a manual for a Ingame Script:
 
https://steamcommunity.com/sharedfiles/filedetails/?id=2610010357 – [steamcommunity.com] 
 
 
This script allow you to control most of te terminal action on a lcd by mouse control and show the blocks information.
 
 
the Name PLC-OS Stands For “Programmable Logic Controller – Operating System”.
 
PLC are used in the electronic industry to automate and control operation.
 
automation can be done by Logic Gates.
 
 
In this Manual we try to explain how to add item(s) to the screen(s), and how you can control/automate them.
 
 
a line starts with:
 
 

  • link
  • object
  • output
  • input

 
Each line consists of one rule in the Customdata of the programmable block on which the script resides.
 
 
An extra Customdata of other blocks can be used as long the “ScreenTag”+[D] consists in block name
 
 

 in the balk like this must be placed in de CustomData or blocks name.

 
Thing that get added in line are Underlined
 
 
enjoy.
 
 
Twotwinbrothers
 
 
 

What do you need

  • 1 programmable block:
     
     
     
    This one will run this script
     
     
     
    add “log” to customname to see log in the terminal (K)
     
     
     
  • 1 Flight Seat or Remote block
     
     
     
    if no tag is set, it wil show a rondom seat
  • 1 LCD panel(can be a lcd of Flight Seat or programmable blocks)
     
     
     
    screentag+[screen name or number] must be set in the Name of the Block

 
 
 

Command list

Add “commands” in customdata and reopen it, this will show this same list of commands.
 
(note: commands can be change in the translation string in the script editor. They get change when “commands” are requested again.)
 
 

COMMAND LIST

 

  • “//” – line wil not be read by this script.
  • itemname,objectname = sets itemname, script only handle blocks whit itemname in it.
  • pittag,cockpit Name = name that the cockpit must contain.
  • remtag,remote Name = name that the remote must contain.
  • mouse,screen = sets cunsor to screen, cunsor can’t leave set screen. only use for setup.
  • mouse mode,true or false = if true cunsor is shown on screen.
  • handbrake switch,true or false = if true cunsor is shown on screen when handbrake is on.
  • setput,memory name = set memory, only for check.
  • sleep,number = sets sleepmode timer, if set to 0 ,sleepmode is off.
  • update,1 or 100 = sets script updatetype, usefull for reading log.

INTER GRID COMUNICATION ARGUMENTS.

 

  • sendfrom,channel name = set this PB IGC Channel Name.
  • sendto,channel name = set IGC Channel Name to send to, wen set you can’t change it in script.

BLOCK RENAME ARGUMENTS.

 

  • add all,”tag” = add tag to all blocks , even blocks connected with rotor en connectors.
  • remove all,”tag” = remove tag to all blocks , even blocks connected with rotor en connectors.
  • add group,”tag”,”Group name” = add tag to all blocks in group , even blocks connected with rotor en connectors.
  • remove group,”tag”,”Group name” = remove tag to all blocks in group , even blocks connected with rotor en connectors.

LCD SET ARGUMENTS.

 

  • lcdtag,tag = sets screen tag is the same for every screen.
  • lcdtag,screentag,surfacenumber,screenname,X,Y,-X,-Y = make an surface to write on and enable to set the resolution.
     
     
     
    if X,Y,-X,-Y = 0, it calculate and set the resolution and/or offset automatically.
     
     
     
    X,Y, (resolution) -X,-Y (offset)
  • res,screenname = tels you the set or calculated resolution.

LCD OBJECT COMMANDS

 

  • link,screenname,memory,X,Y,Shape,H,B,°,screen to, new mouse X, new mouse Y, , , , ,
  • output,screenname,memory,X,Y,Shape,H,B,°, text, Size, Name, typeQ, actionQ, typeE, actionE,
  • input,screenname,memory,X,Y,Shape,H,B,°, text, Size, Name, type, , , ,
  • object,screenname,memory,X,Y,Shape,H,B,°, text, Şize, R, G, B, status, ,

 

  • “type help” in type= add list of types (after reopening Customdata).
  • “help” in type= add line with subtags (after reopening Customdata) to place in text or type.

LOGIC GATES

 
logic will be place in the memory start with LOGIC NAME and than the memory items divided with vertical Bar “|”.
 
[space]OR,NOR,XOR,XNOR,AND,NAND are suported.
 
 
 

Basic Setup

 
 
 

ITEMNAME

Every block that you used whit this script need the itemname in is Name.
 
 

to add the itemname.

 
 

itemname,[item]

 
 
“[item]” is now the itemname
 
 
The scrip wil look for this word in the name of the blocks. Make shore that the word isn’t a word that is use often. For example the word “door” is a bad itemname, But door between backets [door] is better,
 
 

to add the itemname (or another word) to all the blocks

 
(note: disconnect connectors first)
 
 

add all,[item]

 
 
it will now add “[item]” to every blocks name.
 
 

to remove the itemname(or another word) from all the blocks

 
 

remove all,[item]

 
 
it will now remove “[item]” form every blocks name.
 
 

to add the itemname(or another word) to every blocks name in a group

 
 

add group,[item], group name 

 
 
it will now add “[item]” to every blocks name in group whit ” group name “.
 
 

to remove the itemname(or another word) to every blocks name in a group

 
 

remove group,[item], group name 

 
 
it will now remove “[item]” from every blocks name in group whit ” group name “.
 
 
 

Add Cockpit and Remote

This script wil look at who is in control. This is needed for when the cockpit and remote is occupide at te same time. in that case the remote will control the cunsor else the cockpit.
 
 

To set the Cockpit Tag

 
 

 pittag, [control]

 
 
The Controller whit ” [control]” in its Name will be seen as the cockpit.
 
 

To set the Remote Tag

 
 

 remtag, [remote]

 
 
The Controller whit ” [remote]” in its Name will be seen as the remote.
 
 
you can find the current controler in control in the log
 
 
 

Add Screens

LCD SET ARGUMENTS.
 

  • lcdtag,tag = sets screen tag is the same for every screen.
  • lcdtag,screentag,surfacenumber,screenname,X,Y,-X,-Y = Make an surface to write on and enable to set the resolution.
     
     
     
     
     
    if X,Y,-X,-Y = 0, it calculate and set the resolution and/or offset automatically.
     
     
     
    X,Y, (resolution)
     
     
     
    -X,-Y (offset)

Each lcd tag starts with the lcdtag followed by indetifier(screentag).
 
surface nr is most of the time “0” only is a block have more then one surface it can be a other nr.
 
later on i tel you how to get the surface nr.
 
screenname, is the indetifier we use in the lines we use to place item on screen.
 

  • to set a Lcdtag
  • Get surface nr
  • Remove the screen numbers
  • Create a surface

 

to set a Lcdtag

 
 

 lcdtag, [lcd]

 
 
” [lcd]”is now the lcd tag.
 
 

Get surface nr

 
if the block have only one screen the surface number is “0” .
 
 
But cockpits and programmeble block have more than one surface
 
This script profide you whit a way to show surface number on the screens.
 
 
add lcdtag+[asterisk] in de Name of the block.
 
asterisk = *
 
 

text panel 1 [lcd][asterisk]

 
 
the surface numbers are now displayed on every screen of that block.
 
 

Remove the screen numbers

 
 

text panel 1 [lcd][-] 

 
 
now that we have the surface number we can create a surface to place objects on
 
 

Create a surface

 
 
lcdtag,screentag,surfacenumber,screenname,X,Y,-X,-Y
 
 
for this example we give it names:
 
 

lcdtag[lcd]is the same for every surface
sreentag[0]is the second part of the lcdtag and must be differend for every surface
surface nr0must be the surface nr, only if block have more than 1 screen, else it = 0
screen nameScreen 0this name we use in the rest off the lines to indentify the srceen
X0X resolution (width), If 0 it calculate it by it self
Y0Y resolution (height), If 0 it calculate it by it self
-X0X offset, If 0 it calculate it by it self
-Y0y offset, If 0 it calculate it by it self

 
place this line in the customdata
 
 

[lcd],[0],0,Screen 0,0,0,0,0

 
 
place this line in the block name. you dont need to remove the name just add it
 
 

[lcd][0]

 
 
now we created a surface we want to show somthing on te screen
 
add “res” to screen name.
 
 

[lcd],[0],0,Screen 0res,0,0,0,0

 
 
now the screen name, resolution and offset wil be shown on screen.
 
 
wen done remove “res”
 
 
 

Mouse Check

to check if the mouse is working, place these line in the customdata
 
 
this wil place the cunsor on “Screen 0”
 
 

mouse,Screen 0

 
 
this wil set mouse mode to true
 
 

mouse mode,true

 
 
use this as a check only. the cunsor can’t move to another screen.
 
you can shut them down by “//” in the line
 
 

//mouse,Screen 0
//mouse mode,true

 
 
the cunsor can now leave the surface if a link is placed.
 
 
 

(de)activate cursor (mouse).

By programableblock run argument.

 
Place in the G menu the programmable block (with this script ) on action “Run” with the argument “mouse”.
 
Press it to activate or deactivate the mouse cursor.
 
 

Park

 
By default when “Park” is on the cursor is shown as well.
 
when “Park” is off the cursor get removed.
 
 
to turn off this behavore
 
 

 park switch,false 

 
 
to turn back on
 
 

 park switch,true 

 
 
(Note:This script disables the gyros for the cockpit or Remote block that your using at that moment.)
 
 
 

Get Surface Resolution and offset

  • on screen
  • in the customdata

 

show resolution and offset on screen

 
 
lcdtag,screentag,surfacenumber,screenname,X,Y,-X,-Y
 
 

[item],[0],0,Screen 0 res,0,0,0,0

 
add “res” to screenname.
 
 
if you dont want to see resolution and offset any more, remove “res”.
 
 

show resulution and offset in customdata

 
res,sreenname
 
 

[item],[0],0,Screen 0,0,0,0,0

 
in this example
 
screenname = Screen 0
 
 

 
[item],[0],0,Screen 0,0,0,0,0
res,Screen 0

 
 
Reopen customdata and “res,Screen 0” get replaced
 
 

 
[item],[0],0,Screen 0,0,0,0,0
//Calculated or set resolutie of screen 0 =X 256, Y 256,-X 0,-Y 0

 
 
X and Y are resolutie
 
-X and -Y is offset
 
 
Space Engineers - Commands for In-Game Script Manual for PLC-OS Guide - get Surface Resolution and offset - 1601760
 
 
 

Log

Log of this script can be shown two ways.
 

  • In details in te terminal (bottum right).
  • On a lcd panel.

in details

 
 
Add “log” to the name of the programmeble block where this script is running on.
 
 

on a lcd panel

 
 
Add te the line below to the customdata.
 
 

 PLC,[log],0,log,0,0,0,0 

 
 

lcdtag[lcd]
sreentag[log]
surface nr0
screen nameThis must be “log”
X0
Y0
-X0
-Y0

 
Add lcdtag+screentag to the lcd panel name.
 
 

Log contents

 
 

  • COMBINED DATA
  • TAGS
  • MOUSE + SLEEPMODE
  • MEMORY
  • LOGIC
  • CONTROLERS
  • ERRORS

 

COMBINED DATA

 
 
The Combined data exist out of parts from the customdata
 
 
1 Part 0 of the programmable block. (this will be updated each run)
 
2 Part that contains mouse lcd. (the screen the cursor is on will be updated )
 
3 Diverend part aech run. (the part that is updated is shown in log)
 
 
(note: if “yield” is not in the customdate. the customdata = Combined data)
 
 
To reduse the amount of instruction the programmable block have to exicute each run, We can divide de customdata in parts by useing the word “yield”
 
 
Wen do we yield
 
 

  • before a new screen or screens are made.

 

TAGS

 
 
List off the tags that will be shown.
 
 

  • itemname
  • lcdtag
  • pittag
  • remtag

 

MOUSE + SLEEPMODE

 
 
Shows current state of cursor and sleepmode.
 
 

  • mouse lcd = current lcd the cursor is shown on .
  • mouse mode true or false = when true mouse is shown.
  • park switch true or false = when true mouse is only shown when park is activated.
  • sleepmode timer = shows countdown timer.

 
Sleepmode turn the script off, run the prorammeble block turn the script back on.
 
As long the cockpit or remote is occupide the timer wil not count down.
 
 

MEMORY

 
 
every memory item + its value wil be shown in here.
 
 

LOGIC

 
 
the outcome of the logic will be shown here.
 
 

CONTROLERS

 
 
The current controlers will be shown here by name.
 
 

ERRORS

 
 
Shows the combined data line the error is found in.
 
 
 

Examples codes guide


– [steamcommunity.com]” rel=”nofollow noopener”>


– [steamcommunity.com] 

Small examples to place in the customdate after the surfacetag of the surface you want these objects on. Something to begin whit. To help you on your way.
 
 
Note: makes sure to “screenname” are the same..
 
 
PLC-OS Example Codes – [steamcommunity.com] 
 
 
 

Advanced

 
 
 

LINK – move cunsor to other screen(s)

to move the cunsor between screens we use te line start whit ”link”
 
for this example we need 2 surfaces, see chapter: Add Screens.
 
screen 1 is below screen 0.
 
 

Place hover link

 
 
link,screenname,memory,X,Y,Shape,H,W,°,screen to,new mouse X,new mouse Y, , , , ,
 
 

screennameScreen 0 ( if we are on screen 0)
memoryspace (we dont do anyting whit that at the moment
X2|1 (this will divide 2 and place 1= center of surface)
Y10|9 (this will divide 10 and place 9= bottum of surface)
ShapeSquareSimple (so we can see the link as a Square on surface)
H10|1 (this will divide 10 x1 = 1/10 height )
W1|1 (this will divide 10 x1 = 1/1 width)
°0 (rotationof object in degrees)
screen toScreen |1( we want to move Screen 1,”|” get remove but must be in name)
new mouse X256 (if Resolution 512 this wil place cunsor in center)
new mouse Y256 (if Resolution 512 this wil place cunsor in center)

 
Example, Note: See that the link is place below the surface where you link from.
 
 

[item],[0],0,Screen 0,0,0,0,0 
link,Screen 0, ,2|1,10|9,SquareSimple,10|1,1|1,0,Screen |1,256,256, , , , , 
[item],[1],1,Screen 1,0,0,0,0

 
 
Now your cunsor should be able to move between screen 0 to screen 1 but not back.
 

screennameScreen 1 ( we are on screen 1)
memoryspace (we dont do anyting whit that at the moment
X2|1 (this will divide 2 and place 1= center of surface)
Y10|1 (this will divide 10 and place 1= top of surface)
ShapeSquareSimple (so we can see the link as a Square on surface)
H10|1 (this will divide 10 x1 = 1/10 height )
W1|1 (this will divide 10 x1 = 1/1 width)
°0 (rotationof object in degrees)
screen toScreen |0( we want to move Screen 0,”|” get remove but must be in name)
new mouse X256 (if Resolution 512 this wil place cunsor in center)
new mouse Y256 (if Resolution 512 this wil place cunsor in center)

 
Example Note: See that the link is place below the surface where you link from.
 
 

[item],[0],0,Screen 0,0,0,0,0
link,Screen 0, ,2|1,10|9,SquareSimple,10|1,1|1,0,Screen |1,256,256, , , , , 

[item],[1],1,Screen 1,0,0,0,0
link,Screen 1, ,2|1,10|1,SquareSimple,10|1,1|1,0,Screen |0,256,256, , , , , 

 
 
Disable the mouse force to screen code by putting // in front of it, if it not already done
 
 

//mouse,Screen 0

 
 
Now your cunsor should be able to move between screens
 
 
 

OBJECT (place ojbect on a screen)

to place an object to the screen we use:
 
 
object,screenname,memory,X,Y,Shape,H,W,°, text, Şize, R, G, B, status, ,
 
 

screennameGet only placed on surface whit that screenname
memorywhat in here must be in the memory
XX Vertical position on surface (center of object)
YY Horizontal position on surface (center of object)
ShapeSprite Name
HHeight of Sprite
WWidth Of Sprite
°Rotation in Decrees
texttext the object must show
Şizetext size (color of text can be added as “|255|255|0)
R G Bcolor of object 3 numbers serperated by comma between 0-255
Statusnumber Between 1 and 100

 
 

PLC,[0],0,Screen 0,0,0,0,0
link,Screen 0, ,2|1,10|9,SquareSimple,10|1,1|1,0,Screen |1,256,256, , , , , 
object,Screen 0, ,2|1,2|1,bar,2|1,2|1,0, test bar,1, 255, 0, 0,20, ,

PLC,[1],1,Screen 1,0,0,0,0
link,Screen 1, ,2|1,10|1,SquareSimple,10|1,1|1,0,Screen |0,256,256, , , , , 

 
 
 

OUTPUT (button, set something)

to place an output to the screen we use:
 
output,screenname,memory,X,Y,Shape,H,B,°, text, Size, Name, typeQ, actionQ, typeE, actionE,
 
 
if Press “Q” ActionQ executed.
 
typeQ must be specified for ActionQ
 
if Press “E” ActionE executed.
 
typeE must be specified for ActionE
 
 
if typeQ and typeE are te same ActionQ will be executed when the cunsor moves over it.
 
note: simple add (space) exsta in typeQ prevent this.
 
 
If typeQ contains PQ ActionQ will be executed if surface is shown and the memory contains what is in memory part of the line.
 
 

screennameGet only placed on surface whit name
memorywhat in here must be in the memory
XX position on surface
YY position on surface
ShapeSprite Name
HHieght of Sprite
Wwidth Of Sprite
°Rotation
texttext the object must show
Şizetext size (color of text can be added as “|255|255|0)
NameBlock Contains Name
typeQType when press Key “Q” ( See Type list – output – [steamcommunity.com] )
actionQAction when press Key “Q”
typeEType when press Key “E” ( See Type list – output – [steamcommunity.com] )
actionEAction when press Key “E”

 
 

PLC,[0],0,Screen 0,0,0,0,0
link,Screen 0, ,2|1,10|9,SquareSimple,10|1,1|1,0,Screen |1,256,256, , , , , 
output,Screen 0, ,2|1,2|1,bar,2|1,2|1,0, test bar,1, Block, term, OnOff_0n,term, OnOff_0ff

PLC,[1],1,Screen 1,0,0,0,0
link,Screen 1, ,2|1,10|1,SquareSimple,10|1,1|1,0,Screen |0,256,256, , , , , 

 
 
 

INPUT (get info )

to place an input to the screen we use:
 
input,screenname,memory,X,Y,Shape,H,B,°, text, Size, Name, type, , , ,
 
 

screennameGet only placed on surface whit this name
memorywhat in here must be in the memory
XX position on surface
YY position on surface
ShapeSprite Name
HHieght of Sprite
Wwidth Of Sprite
°Rotation
texttext the object must show + info to be show in text ( See Type list – input – [steamcommunity.com] )
Şizetext size (color of text can be added as “|255|255|0)
NameBlock Contains Name
typeType of info to place in the status( See Type list – input – [steamcommunity.com] )

 
 

PLC,[0],0,Screen 0,0,0,0,0
link,Screen 0, ,2|1,10|9,SquareSimple,10|1,1|1,0,Screen |1,256,256, , , , , 
input,Screen 0, ,2|1,2|1,bar,2|1,2|1,0, <#>,1, Block, term, , , ,

PLC,[1],1,Screen 1,0,0,0,0
link,Screen 1, ,2|1,10|1,SquareSimple,10|1,1|1,0,Screen |0,256,256, , , , , 

 
This wil show onoff status of blocks that contains “block” in threre name.
 
 
 

ACTIONS and PROPERTIES

In this Chapter i show you how to show a list Action And Properties of a block.
 
 

input,Screen 0, ,4|1,2|1,SquareFilled,1|1,2|1,0,action ##,0.4,block,action, , ,
input,Screen 0, ,4|3,2|1,SquareFilled,1|1,2|1,0,properties ##,0.4,block,prop, , ,

 
 

first line:Shows a list of action of Block contains “block” in its name on first half of screen
secondLine:Shows a list of Propertiestof Block contains “block” in its name on first half of screen

 

Use of Action

 
 

output,Screen 0, ,8|7,2|1,SquareFilled,4|1,4|1,0, ,1,block,term ,OnOff_On, , , , 

 
 
In this example, we’ll turn on every block that contains “block” in its name.
 
Note: if you want te use an action out of the action list “type” must be “term”.
 
 

Use of Propety

 
 

show on screentype
Booleanbool
Singlefloat
Colorcolor
Int32not suported by this script
Longnot suported by this script

 
for the property that are not suported See Type list – input – [steamcommunity.com] 
 
most of the time there is a type that does
 
 

  • Show whit Boolean Propery

     
     
     
     
     

    input,Screen 0, ,4|1,2|1,SquareFilled,1|1,2|1,0, ,0.4,block,bool|OnOFF, , ,
    

     
     
     
     
     
    In this example we’ll show onoff status of every block that contains “block” in its name.
     
     
     
    Note: if you want te use an Boolean out of the property list “type” must be “bool”+”|”+”Boolean name”.

  • Show Single Propery

     
     
     
     
     

    input,Screen 0, ,4|1,2|1,SquareFilled,1|1,2|1,0, ,0.4,block,float|Radius, , ,
    

     
     
     
     
     
    In this example we’ll show “Radius” of every block that contains “block” in its name.
     
     
     
    Note: if you want te use an Single out of the property list “type” must be:
     
     
     
    “float” + “|” + “Single name”.

  • Set Single Propery

     
     
     
     
     

    output,Screen 0, ,8|7,2|1,SquareFilled,4|1,4|1,0, ,1,block,float ,Radius|+|1, , , , 
    

     
     
     
     
     
    In this example we’ll set the “Radius” + 1 of every block that contains “block” in its name.
     
     
     
    Note: if you want te use an action out of the action list “type” must be:
     
     
     
    “float” + “|” + “+”,or “-“or (Space) + “|” + “Single name”.

  • Show Color Propery

     
     
     
     
     

    input,Screen 0, ,4|1,2|1,SquareFilled,1|1,2|1,0, ,0.4,block,color|Color, , ,
    

     
     
     
     
     
    In this example we’ll show “Color” property of every block that contains “block” in its name.
     
     
     
    Note: if you want te use an action out of the action list “type” must be:
     
     
     
    “color” + “|” + “Color name”.

  • Set Color Propery

     
     
     
     
     

    output,Screen 0, ,8|7,2|1,SquareFilled,4|1,4|1,0, ,1,block,color ,color|0|0|0, , , , 
    

     
     
     
     
     
    In this example we’ll set the “Radius” + 1 of every block that contains “block” in its name.
     
     
     
    Note: if you want te use an action out of the action list “type” must be: “color”
     
     
     
    action: Color name + “|” + R + “|” + G + “|” + B. RGB must Between: 0-255

 
 
 

Type list / Sprite list – [steamcommunity.com] 

 
 
 

MEMORY

This script allow you to add small part of text to memory string and check them.
 
 
one menory item exist most of the time out of one line out of two part
 
part 1 is the name
 
space
 
Part 2 is the value or status
 
 

Add memory item whit Button panel by “Run” Programmable Block whit argument.

 
 

Setput,(What you want to put in the Memory)

 
 
When run again, it will remove it
 
(note: Only for checking this can be placed in the Customdata,)
 
 

Add memory item whit output.

 
 

output,Screen 0, 2|1,2|1,SquareFilled,2|1,2|1,0, ,1, ,mem ,S0|P1, , , , 

 
 
if “|” is added it wil split. “S0” is the name “P1″ value or status
 
first push, it add S0 and P1
 
second push, it removes P1
 
third push, it add P1 again.
 
 
if”|” is there, it replace the value or Status of the memory item
 
if not it make another memory item if the value is different.
 
 
if “|” is not added it wil only Add “S0 P1”
 
 

Remove memory item whit output.

 
 

output,Screen 0, ,2|1,2|1,SquareFilled,2|1,2|1,0, ,1, ,mem- ,S0 P1, , , , 

 
 
note: mem contains a minus after it
 
 

Store memory item whit Input.

 
You have to give memory item a name. Add this in the argument Called “name” divided “|”.
 
 
The name we give the Memory item in this Example = BL
 
In type we have to set what to store. In this Example = term<#> = on/off Status
 
 

input,Screen 0, ,2|1,2|1,SquareFilled,2|1,2|1,0, <#>,1, BL |Block, term<#>, , , ,

 
 

W S A D C F

 
 
W S A D C SPACEBAR are the default movement keys on the keyboard. These are accessible by the programmable block.
 
 
SPACEBAR return as F in this scirpt. This can be change in the tranlation string in the script editor in the game
 
 
If one of these keys will be pressed that key get stored (like: space + key + space) in the memory but will not be removed.
 
to remove it we add a line for every key we want to remove. In this Example it is: ” W ”
 
 

output,Screen 0, W ,2|1,2|1, ,2|1,2|1,0, ,1, ,mem- PQ, W , , , , 

 
 
(Note: We place this line ones after the lines that does somthing whit ” W “)
 
 
 

Logic Gates

Logic Gates are place in the memory part of a line.
 
 
In this chapter i wil show how to use them.
 
 
It will always begin whit the type of Logic Gates followed by “|”.
 
After “|” you will place what it have to look for in the memory.
 
This can be repeated.
 
You can’t use two different gates in one line.
 
 
Every memory item wil return “1” or ”0”.
 
If memory item is there it wil “1”.
 
If memory item is not there it wil “0”.
 
 
the outcom of the logic is visable in the log shown in Terminal(K).
 
you have to place “log” in the programmeble block Name.
 
 
Depending on what Gate is used, the line will be displayed or is usable.
 
 
Note: make sure there is a space before the Gate name.
 
 

ORContains “1”
NORContains “0”
XORContains “1”and ”0” dont work when it only has “0”s or only has”1″s
XNORwork when it has only “0”s or only has “1”s
ANDContains only “1”
NANDContains only “0”

 
 
 

OR gate example

input,Screen 0, ,8|2,8|3,SquareFilled,4|1,4|1,0,S0 P1,0.4, ,mem|S0 P1, , ,
input,Screen 0, ,8|2,8|5,SquareFilled,4|1,4|1,0,S1 P1,0.4, ,mem|S1 P1, , ,

output,Screen 0,S3 P1,8|7,2|1,SquareFilled,4|1,4|1,0, ,1, ,mem- PQ ,S2 P1, , , , 
output,Screen 0, ,8|4,2|1,SquareFilled,4|1,4|1,0, ,1, ,mem ,S0|P1, mem,S1|P1, , 
output,Screen 0, OR|S0 P1|S1 P1,8|6,2|1,SquareFilled,4|1,4|1,0,S2 P1,1, ,mem PQ ,S2 P1, , , , 

 
 

first line:Shows green if “S0 P1” is in the memory
secondLine:Shows green if “S1 P1” is in the memory
ThirdLine:if “S1 P1″is in the memory its remove it
FourthLine:Button press”Q” to “S0 P1” and press “E” to “S1 P1”
FifthLine:as long “S1 P1” or “S2 P1” is in the memory wil “S3 P1” wil be placed in the menory

 
 
 

NOR Gate Example

input,Screen 0, ,8|2,8|3,SquareFilled,4|1,4|1,0,S0 P1,0.4, ,mem|S0 P1, , ,
input,Screen 0, ,8|2,8|5,SquareFilled,4|1,4|1,0,S1 P1,0.4, ,mem|S1 P1, , ,

output,Screen 0,S3 P1,8|7,2|1,SquareFilled,4|1,4|1,0, ,1, ,mem- PQ ,S2 P1, , , , 
output,Screen 0, ,8|4,2|1,SquareFilled,4|1,4|1,0, ,1, ,mem ,S0|P1, mem,S1|P1, , 
output,Screen 0, NOR|S0 P1|S1 P1,8|6,2|1,SquareFilled,4|1,4|1,0,S2 P1,1, ,mem PQ ,S2 P1, , , , 

 
 

first line:Shows green if “S0 P1” is in the memory
secondLine:Shows green if “S1 P1” is in the memory
ThirdLine:if “S1 P1″is in the memory its remove it
FourthLine:Button press”Q” to “S0 P1” and press “E” to “S1 P1”
FifthLine:as long “SO P1” or “S1 P1” is not in the memory, “S2 P1” wil be placed in the menory

 
 
 

XOR Gate Example

input,Screen 0, ,8|2,8|3,SquareFilled,4|1,4|1,0,S0 P1,0.4, ,mem|S0 P1, , ,
input,Screen 0, ,8|2,8|5,SquareFilled,4|1,4|1,0,S1 P1,0.4, ,mem|S1 P1, , ,

output,Screen 0,S3 P1,8|7,2|1,SquareFilled,4|1,4|1,0, ,1, ,mem- PQ ,S2 P1, , , , 
output,Screen 0, ,8|4,2|1,SquareFilled,4|1,4|1,0, ,1, ,mem ,S0|P1, mem,S1|P1, , 
output,Screen 0, XOR|S0 P1|S1 P1,8|6,2|1,SquareFilled,4|1,4|1,0,S2 P1,1, ,mem PQ ,S2 P1, , , , 

 
 

first line:Shows green if “S0 P1” is in the memory
secondLine:Shows green if “S1 P1” is in the memory
ThirdLine:if “S1 P1″is in the memory its remove it
FourthLine:Button press”Q” to “S0 P1” and press “E” to “S1 P1”
FifthLine:as long “SO P1” or “S1 P1” is in the memory, “S2 P1” wil be placed in the menory. But if both will be there, it’s not.

 
 
 

XNOR Gate Example

input,Screen 0, ,8|2,8|3,SquareFilled,4|1,4|1,0,S0 P1,0.4, ,mem|S0 P1, , ,
input,Screen 0, ,8|2,8|5,SquareFilled,4|1,4|1,0,S1 P1,0.4, ,mem|S1 P1, , ,

output,Screen 0,S3 P1,8|7,2|1,SquareFilled,4|1,4|1,0, ,1, ,mem- PQ ,S2 P1, , , , 
output,Screen 0, ,8|4,2|1,SquareFilled,4|1,4|1,0, ,1, ,mem ,S0|P1, mem,S1|P1, , 
output,Screen 0, XNOR|S0 P1|S1 P1,8|6,2|1,SquareFilled,4|1,4|1,0,S2 P1,1, ,mem PQ ,S2 P1, , , , 

 
 

first line:Shows green if “S0 P1” is in the memory
secondLine:Shows green if “S1 P1” is in the memory
ThirdLine:if “S1 P1″is in the memory its remove it
FourthLine:Button press”Q” to “S0 P1” and press “E” to “S1 P1”
FifthLine:as long “SO P1” or “S1 P1” is in the memory, “S2 P1” wil not be placed in the menory. But if both will be there or not, it’s will.

 
 
 

AND Gate Example

input,Screen 0, ,8|2,8|3,SquareFilled,4|1,4|1,0,S0 P1,0.4, ,mem|S0 P1, , ,
input,Screen 0, ,8|2,8|5,SquareFilled,4|1,4|1,0,S1 P1,0.4, ,mem|S1 P1, , ,

output,Screen 0,S3 P1,8|7,2|1,SquareFilled,4|1,4|1,0, ,1, ,mem- PQ ,S2 P1, , , , 
output,Screen 0, ,8|4,2|1,SquareFilled,4|1,4|1,0, ,1, ,mem ,S0|P1, mem,S1|P1, , 
output,Screen 0, AND|S0 P1|S1 P1,8|6,2|1,SquareFilled,4|1,4|1,0,S2 P1,1, ,mem PQ ,S2 P1, , , , 

 
 

first line:Shows green if “S0 P1” is in the memory
secondLine:Shows green if “S1 P1” is in the memory
ThirdLine:if “S1 P1″is in the memory its remove it
FourthLine:Button press”Q” to “S0 P1” and press “E” to “S1 P1”
FifthLine:as long “SO P1” and “S1 P1” is in the memory, “S2 P1” wil be placed in the menory.

 
 
 

NAND Gate Example

input,Screen 0, ,8|2,8|3,SquareFilled,4|1,4|1,0,S0 P1,0.4, ,mem|S0 P1, , ,
input,Screen 0, ,8|2,8|5,SquareFilled,4|1,4|1,0,S1 P1,0.4, ,mem|S1 P1, , ,

output,Screen 0,S3 P1,8|7,2|1,SquareFilled,4|1,4|1,0, ,1, ,mem- PQ ,S2 P1, , , , 
output,Screen 0, ,8|4,2|1,SquareFilled,4|1,4|1,0, ,1, ,mem ,S0|P1, mem,S1|P1, , 
output,Screen 0, XNOR|S0 P1|S1 P1,8|6,2|1,SquareFilled,4|1,4|1,0,S2 P1,1, ,mem PQ ,S2 P1, , , , 

 
 

first line:Shows green if “S0 P1” is in the memory
secondLine:Shows green if “S1 P1” is in the memory
ThirdLine:if “S1 P1″is in the memory its remove it
FourthLine:Button press”Q” to “S0 P1” and press “E” to “S1 P1”
FifthLine:as long “SO P1” and “S1 P1” is in the memory, “S2 P1” wil not be placed in the menory.

 
 
 

INTER GRID COMUNICATION (IGC)

This script allow to get info(some kind of webpage)form another programeble block (PB) whit this same script on it.
 
 

  • you need at lease 2 PB.
     
     
     
    (Note: they don’t need to be on te same grid. But need to be connected by antenne or mechanical connection)
  • ownership must be in the same faction.
  • now you need to set a Channel Name for every PB.
     
     
     
    (Note:these may not contain the name of te other.)
     
     
     
     
     
    sendfrom,channel name
     
     
     
     
     
    for this example we name te chanels like:
     
     
     
    PB 1= Main Station
     
     
     
    PB 2= Small ship
     
     
     
     
     
    PB 1
     
     
     
     
     

     sleep,0
    sendfrom,Main Station

     
     
     
    PB 2
     
     
     
     
     

     sleep,0
    sendfrom,Small ship

     
     
     
     
     
    (Note: script in “sleepmode” can not receive anything. we turn of sleepmode by adding “sleep,0”)
     
     
     
     
     
    the channel to sent to can be set a well.
     
     
     
    (Note: wen set you can’t change it in script)
     
     
     
     
     
    sendfrom,channel name
     
     
     
    PB 2
     
     
     
     
     

     sleep,0
    sendfrom,Small ship
    sendto,Main Station 

     
     
     
     
     

    To See wat is been sent or Resieved

     
     
     
     
     
    We make a surface for each PB
     
     
     
     
     
    PB 1
     
     
     
     
     

    sleep,0
    sendfrom,Main Station
    itemname,[main]
    lcdtag,main

    main ,[0],0,Screen 0,0,0,0,0
    input,Screen 0, ,2|1,2|1,SquareFilled,5|3,1|1,0, ,0.3, ,com <to> <list>, ,

     
     
     
    (Note:dont forget to add the “itemname” and the “lcdtag+screentag” to the block name)
     
     
     
     
     
    PB 2
     
     
     
     
     

     sleep,0
    sendfrom,Small ship
    sendto,Main Station
    itemname,[ship]
    lcdtag,ship

    ship,[0],0,Screen 0,0,0,0,0
    input,Screen 0, ,2|1,2|1,SquareFilled,5|3,1|1,0, ,0.3, ,com <to> <list>, ,

     
     
     

    Simple test

     
     
     
    lets send the text “Hello” from PB 2 to PB 1 as test
     
     
     
     
     
    can be done 2 ways

  • via Pb “Run” whit argument “Hello”.
  • in the CustomData by placing an output.
     
     
     
    PB 2
     
     
     
     
     

     sleep,0
    sendfrom,Small ship
    sendto,Main Station
    itemname,[ship]
    lcdtag,ship 
    
    ship,[0],0,Screen 0,0,0,0,0
    input,Screen 0, ,2|1,2|1,SquareFilled,5|3,1|1,0, ,0.3, ,com <to> <list>, , 
    
    output,Screen 0, ,2|1,2|1,SquareFilled,10|1,10|1,0,send hello ,0.3, ,com,hello, , 
    

     
     
     
    push the button on de surface will sent the the text “hello”
     
     
     
     
     
    if done right the follow messege wil appaer:
     
     
     
    PB 1
     
     
     
     
     

    Resieved IGC Private message
    From: Small ship
    To: Main Station
    Data: Hello
    

     
     
     
    PB 2
     
     
     
     
     

     Sending message
    From: Small ship
    To: Main Station
    Data: Hello
    Main Staion ,Private message deliverd: Hello
    

     
     
     
     
     

    Send output

     
     
     
     
     
    to Send a output, type must Contain <send Q> for typeQ and <send E> for typeE
     
     
     
     
     
    PB 2
     
     
     
     
     

     sleep,0
    sendfrom,Small ship
    sendto,Main Station
    itemname,[ship]
    lcdtag,ship 
    
    ship,[0],0,Screen 0,0,0,0,0
    input,Screen 0, ,2|1,2|1,SquareFilled,5|3,1|1,0, ,0.3, ,com <to> <list>, , 
    
    output,Screen 0, ,2|1,2|1,SquareFilled,10|1,10|1,0,i,1, ,com <sendQ>,hello,com - []  <sendE>,bye 
    

     
     
     
    if press “E” or “Q” when cursor is on square called “i” it send the underlined line to PB 1, there it will be executed. In this case it send “hello”’or “Bye” back to me.
     
     
     
     
     
    (note: type dont have to be “com”,it tels what for type it send )
     
     
     
     
     
    if done right one of the follow two messege wil appaer:
     
     
     
    PB 2
     
     
     
     
     

    Resieved IGC Public message
    From: Small ship
    To: everyone
    Data: hello
    

     
     
     
     
     

    Resieved IGC Public message
    From: Small ship
    To: everyone
    Data: bye
    

     
     
     
     
     
    (note: the message is send to “everyone” in the faction, this is because we dont set a sentto adres in PB 1).

 
 
 

IGC browser

The lines below wil show some kind of browser
 
With which you can find and browse channels.
 
With the button “go” we ask to show information stored (web) on the channel of your choice
 
not every PB have info stored.
 
 

input,Screen 0, ,2|1,2|1,SquareFilled,5|3,1|1,0,<to>##<list>,0.3, ,com, , , 
output,Screen 0, ,20|11,10|1,SquareFilled,10|1,6|1,0,ping,0.3, ,com,ping, , 
output,Screen 0, ,20|1,10|1,TriangleFilled,10|1,10|1,-90, p,0.3, ,com,prev, , 
output,Screen 0, ,20|3,10|1,TriangleFilled,10|1,10|1,90,n ,0.3, ,com,next, , 
output,Screen 0, ,20|7,10|1,SquareFilled,10|1,6|1,0,list,0.3, ,com,list, , 
output,Screen 0, ,20|15,10|1,SquareFilled,10|1,6|1,0,go,0.3, ,com,[email protected] 0, , 
output,Screen 0, ,20|18.5,10|1,SquareFilled,10|1,10|1,0,x,0.3, ,com,cl, , 

 
 
(note: To be able to cycle through the channels “sendto” must be deactivated)
 
 

web (making website)

 
 
we can store info by adding “web” instead of “screenname”
 
 

// door 1
output,web, ,20|3,8|5, ,20|2,20|1,0, ,0.7,Door 1,term <send Q> ,Open,term <send E>,OnOff
input,conv, ,20|3,8|5,SquareFilled,20|2,20|1,0,Door 1#<#>,0.5,Door 1, door, , , 
//door 2
output,web, ,20|3,8|5, ,20|2,20|1,0, ,0.7,Door 2,term <send Q> ,Open,term <send E>,OnOff
input,conv, ,20|3,8|5,SquareFilled,20|2,20|1,0,Door 2#<#>,0.5,Door 2, door, , , 
// base vent
output,web, ,20|5,8|5, ,20|4,20|4,0, ,0.7,Vent base,term <send Q>,Depressurize, ,
input,conv, ,20|5,8|5,SquareFilled,20|4,20|4,0,<%>,0.7,Vent base, vent, , , 

 
 
in this above example we have small base whit 1 airvent and 2 doors
 
 
Note that the input has “conv” instaed of “web”. it converts the input to object whit the status of the input. if requested it wil send the output and object to the requesting PB.
 
 
(Note: dont forget to put “<send Q>” and “<send E>” so it can be send back.)
 
 

Written by Twotwinbrothers, twotwinbrothers

 
 
Hope you enjoy the Guide about Space Engineers – Commands for In-Game Script Manual for PLC-OS Guide, if you think we should add extra information or forget something, please let us know via comment below, and we will do our best to fix or update as soon as possible!