Skip to content

Instantly share code, notes, and snippets.

@seronis
seronis / SasInDoorProgram.cs
Last active May 13, 2019 23:18
Space Engineers Scripting Tutorial Scenario - Updated Code for 3rd Tut
// This program is there to try to open the inside door to do so
// it will check if the oxygen level in the sas is at the same
// level as in the room in which case it will open the door
// otherwise it will trigger the timer to pressurize the sas and
// start the timer to check again until it can open the door.
public bool TryOpenInDoor()
{
var outDoor = GridTerminalSystem.GetBlockWithName("SasOutDoor") as IMyDoor;
var inDoor = GridTerminalSystem.GetBlockWithName("SasInDoor") as IMyDoor;
@seronis
seronis / HelloWorldProgram.cs
Created May 13, 2019 23:00
Space Engineers Scripting Tutorial Scenario - Updated Code for 1st Tut
// the '@' allows to assign a multiple line text between quotes to a string variable,
// you wont need it for a simple hello world! but it might be worth noting.
string myNewInstructions = @"
Part 1: (continuation)
--------------------
Well done!
As you can see the existing script changed the text of this panel.
The door behind you is closed, to open it the console panel's text
has to contain exactly the following words in that order: Hello World!
@seronis
seronis / OxygenSecurityLockProgram.cs
Created May 13, 2019 22:54
Space Engineers Scripting Tutorial Scenario - Updated Code for 2nd Tut
// In space oxygen is a very valuable ressource
// keeping a large place supplied with oxygen
// when ressources are getting low can be a waste
// therefore it can be relevant if the case happen to
// reduce the oxygenated area and bring back
// oxygen where needed.
// This script ensure that when the oxygen generator
// ice ressources become low oxygen gets sucked
// out and then reserved for the medical room.
package seronis.reddit.prompts.dice111;
import seronis.reddit.Main;
import seronis.reddit.util.DieNumeric;
import java.util.ArrayList;
/**
* Created by seronis on 11/26/14.
*/
package seronis.reddit.prompts;
import seronis.reddit.Main;
import seronis.reddit.util.DieNumeric;
/**
* Created by seronis on 11/26/14.
*/
public class Dice111 extends Main {
boolean finished;
@seronis
seronis / main.c
Last active August 29, 2015 14:10
#include <stdio.h>
#include <errno.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
#include "myInnerClass.h"
myInnerClass::myInnerClass( int _val1, int _val2 )
{
val1 = _val1;
val2 = _val2;
}
myInnerClass::~myInnerClass()
{
@seronis
seronis / Die.java
Created November 11, 2014 19:26
Dice class for reddit
package com.seronis.reddit.dicebag;
import java.util.Random;
public abstract class Die {
protected int value;
protected int sides;
protected boolean froze;
protected Random rand = new Random();
@seronis
seronis / Makefile
Created November 23, 2013 02:35
ultimate mud makefile
CC = g++
EXE = game
C_FLAGS = -Wall -std=c++11
L_FLAGS = -lcrypt -lz
# Source Files
SRC_FILES := $(wildcard *.cpp)
# Directories
OBJ_DIR_D = ../obj/Debug
package seronis.testing;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;
import java.io.IOException;