Installer Steam
log på
|
sprog
简体中文 (forenklet kinesisk)
繁體中文 (traditionelt kinesisk)
日本語 (japansk)
한국어 (koreansk)
ไทย (thai)
Български (bulgarsk)
Čeština (tjekkisk)
Deutsch (tysk)
English (engelsk)
Español – España (spansk – Spanien)
Español – Latinoamérica (spansk – Latinamerika)
Ελληνικά (græsk)
Français (fransk)
Italiano (italiensk)
Bahasa indonesia (indonesisk)
Magyar (ungarsk)
Nederlands (hollandsk)
Norsk
Polski (polsk)
Português (portugisisk – Portugal)
Português – Brasil (portugisisk – Brasilien)
Română (rumænsk)
Русский (russisk)
Suomi (finsk)
Svenska (svensk)
Türkçe (tyrkisk)
Tiếng Việt (Vietnamesisk)
Українська (ukrainsk)
Rapporter et oversættelsesproblem
/************************************************************************************
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 bool 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