Skip to content

Instantly share code, notes, and snippets.

@LambdaSix
LambdaSix / AnimatedHydroponics.cs
Created February 12, 2020 14:38
Animated Subpart + Emissives
using System;
using System.Collections.Generic;
using Sandbox.Common.ObjectBuilders;
using Sandbox.Game;
using Sandbox.Game.Lights;
using Sandbox.ModAPI;
using VRage.Game;
using VRage.Game.Components;
using VRage.Game.Entity;
using VRage.Game.ModAPI;
@LambdaSix
LambdaSix / Extractor.cs
Last active January 30, 2020 13:05
Space engineers recipe extraction.
void Main()
{
var modBasePath = @"C:\source\repos\Personal\SpaceEngineers\";
var filePaths = Directory.EnumerateFiles($"{modBasePath}\\Data\\", "Blueprints_Components_*.sbc");
var overMap = new List<Dictionary<string,BlueprintInfo>>();
foreach (var filePath in filePaths) {
var document = XDocument.Load(filePath);
var map = new Dictionary<string,BlueprintInfo>();
[
{
"Detector": [
{
"Amount": 3,
"TypeId": "Component/Sensor"
},
{
"Amount": 9,
"TypeId": "Component/Diode"
@LambdaSix
LambdaSix / Ratios.md
Created December 12, 2019 10:29
Organics for Athena

Scaled ratios for Athena's configuration

Input Input Amount Output 1 Output 1 Amount Output 2 Output 2 Amount Output 3 Output 3 Amount
Ore/SoiledOrganic 1 Ore/Stone 0.33 Ore/Organic 0.26
Ore/Organic 1 Ore/Stone 0.33 Ore/Organic 0.26
// sort the list of ores based on their relative quotes for ingot demand
ores.Sort((ore1, ore2) =>
{
// Get the list of products for the given ores
Ore[] i1 = OreProducts[ore1];
Ore[] i2 = OreProducts[ore2];
// Summate the quotas of the ingots they provide
var i1Quota = i1.Sum(x => (int)_typeSubData["INGOT"][x.Name].quota);
var i2Quota = i2.Sum(x => (int) _typeSubData["INGOT"][x.Name].quota);
@LambdaSix
LambdaSix / AutoLevel.cs
Created December 4, 2019 13:23
Space Engineers - Flight scripts
// Set name for remote control to orient on.
// Null to use first found remote control.
string REMOTE_CONTROL_NAME = null;
// Set lower if overshooting, set higher to respond quicker
double CTRL_COEFF = 0.8d;
// Set to the max number of gyros to use
// Using less gyros than you have allows you to still steer while leveler is operating.)
int LIMIT_GYROS = 999;
@LambdaSix
LambdaSix / Tests.cs
Created November 13, 2019 11:18
LTN Export tests
[Test]
public void Regex_DeliveryCreation()
{
var testLine =
" 599.421 Script @__LogisticTrainNetwork__/control.lua:1405: Creating Delivery: 320 stacks, Chralex >> Frankenfrank\n" +
" 599.421 Script @__LogisticTrainNetwork__/control.lua:1418: item,plastic-bar, 32000 in 320 stacks \n";
Assert.That(LogRegex.DeliveryCreation.IsMatch(testLine), Is.True);
var deliveryGroups = LogRegex.DeliveryCreation.Match(testLine);
using System;
using System.Collections.Generic;
using System.Net.Configuration;
using OctoGhast.Framework.Mobile;
namespace OctoGhast.Framework.Activities {
/// <summary>
/// Base class for handling an activity.
/// </summary>
@LambdaSix
LambdaSix / ExtraMods
Last active May 8, 2019 14:38
Bluedog_DB Fuel Cells
https://forum.kerbalspaceprogram.com/index.php?/topic/122020-16x-bluedog-design-bureau-stockalike-saturn-apollo-and-more-v152-%D0%B1%D1%80%D1%83%D0%BD%D0%BE-8feb2019/&page=453&tab=comments#comment-3471108
https://forum.kerbalspaceprogram.com/index.php?/topic/181186-131-simple-procedural-engines/