Instal Steam
login
|
bahasa
简体中文 (Tionghoa Sederhana)
繁體中文 (Tionghoa Tradisional)
日本語 (Bahasa Jepang)
한국어 (Bahasa Korea)
ไทย (Bahasa Thai)
Български (Bahasa Bulgaria)
Čeština (Bahasa Ceko)
Dansk (Bahasa Denmark)
Deutsch (Bahasa Jerman)
English (Bahasa Inggris)
Español - España (Bahasa Spanyol - Spanyol)
Español - Latinoamérica (Bahasa Spanyol - Amerika Latin)
Ελληνικά (Bahasa Yunani)
Français (Bahasa Prancis)
Italiano (Bahasa Italia)
Magyar (Bahasa Hungaria)
Nederlands (Bahasa Belanda)
Norsk (Bahasa Norwegia)
Polski (Bahasa Polandia)
Português (Portugis - Portugal)
Português-Brasil (Bahasa Portugis-Brasil)
Română (Bahasa Rumania)
Русский (Bahasa Rusia)
Suomi (Bahasa Finlandia)
Svenska (Bahasa Swedia)
Türkçe (Bahasa Turki)
Tiếng Việt (Bahasa Vietnam)
Українська (Bahasa Ukraina)
Laporkan kesalahan penerjemahan
/************************************************************************************
EasyAPI - Documentation: https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=381043
*************************************************************************************/
// This script was made for the LKS_Hydros but can be applied to similar ships
// That means just one group for outer doors, one for inner doors, and one for all the doors
// Feel free to rename the groups accordingly.
//
public static string AIRLOCK_DOORS = "HY 1- Doors"; // your doors group
public static string AIRLOCK_OUTER_DOORS = "HY 1- Doors (Outer)"; // your outer doors group
public static string AIRLOCK_INNER_DOORS = "HY 1- Doors (Inner)"; // your inner doors group
public static ♥♥♥♥ AIRLOCK_AUTOCLOSE = true; // set it to true if you want the door closing automaticaly after a delay
public static long AIRLOCK_AUTOCLOSEDELAY = 3 * EasyAPI.Seconds; // autoclose delay set to 3 seconds, change it if you want
public class Example : EasyAPI
{
public Example(IMyGridTerminalSystem grid, IMyProgrammableBlock me, Action<string> echo, TimeSpan elapsedTime) : base(grid, me, echo, elapsedTime)
{
// if an outer door is open we close all the other (outer/inner) doors
Blocks.InGroupsNamed(AIRLOCK_OUTER_DOORS).AddEvent(
delegate(EasyBlock thisdoor)
{
return thisdoor.Open();
},
delegate(EasyBlock thisdoor)
{
Blocks.InGroupsNamed(AIRLOCK_DOORS).Minus(thisdoor).ApplyAction("Open_Off");
if(AIRLOCK_AUTOCLOSE) // autoclose the outer door that was open, if any
{
In(AIRLOCK_AUTOCLOSEDELAY, delegate()
{
thisdoor.ApplyAction("Open_Off");
});
}
return true;
},
true
);
// if an inner door is open we close all the other (outer/inner) doors
Blocks.InGroupsNamed(AIRLOCK_INNER_DOORS).AddEvent(
delegate(EasyBlock thisdoor)
{
return thisdoor.Open();
},
delegate(EasyBlock thisdoor)
{
Blocks.InGroupsNamed(AIRLOCK_DOORS).Minus(thisdoor).ApplyAction("Open_Off");
if(AIRLOCK_AUTOCLOSE) // autoclose the inner door that was open, if any
{
In(AIRLOCK_AUTOCLOSEDELAY, delegate()
{
thisdoor.ApplyAction("Open_Off");
});
}
return true;
},
true
);
}
}
/*********************************************/
/*** Advanced users only beyond this point ***/
/*********************************************/
...
Enjoy,
LKS
LKS
By default it will auto close any door after 2-3sec.
If you name two or more doors with exactly same name this script will make sure only one door of the same name can be open at one time by turning off the other(s).
This is your code, not mine ;)
LKS