Skip to content

Instantly share code, notes, and snippets.

/* Piston Controller script for Space Engineers - by TerrorBite */
const float TOLERANCE = 0.08F;
string status = "";
Dictionary<string, string> Properties;
void LoadProperties() {
Properties = new Dictionary<string, string>();
if(string.IsNullOrEmpty(Storage)) return;
string[] records = Storage.Split('\x1E');
/*
Piston Elevator Controller
A Space Engineers script by TerrorBite
(Not just for elevators! Can be used any time that you want a piston to move to a
certain preset length and then turn off.)
WARNING: You may experience some lag while the piston is moving (especially after running
the game for a long time). This is unavoidable and is a result of the Program Block being
run repeatedly and rapidly by a Timer Block in order to monitor the piston. I have taken
@TerrorBite
TerrorBite / aloop.c
Created June 6, 2015 10:43
Seamless audio player
#include <unistd.h>
#include <stdio.h>
#include <ao/ao.h>
#include <fcntl.h>
#include <signal.h>
#include <math.h>
#include <mad.h>
#include <string.h>
#include <sys/types.h>
@TerrorBite
TerrorBite / calc256.py
Last active September 14, 2015 12:10
#!/usr/bin/env python
from sys import argv, stdin, stdout, stderr
from traceback import print_exc
from os import path, isatty
from textwrap import dedent
from collections import Counter
from math import sqrt
import inspect
# Luminance threshold values
@TerrorBite
TerrorBite / X-Clacks-Overhead.conf
Last active December 24, 2023 02:48
GNU Terry Pratchett
# The Hour of the Dead was when men died. And when a man died, they sent him
# home by clacks.
#
# Moist's mouth dropped open. 'Huh?'
#
# 'That's what they call it,' said Harry. 'Not lit'rally, o' course. But they
# send his name from one end of the Trunk to the other, ending up at the tower
# nearest his home.'
#
@TerrorBite
TerrorBite / ircbotframe.py
Last active February 20, 2023 05:21
Python IRC chat bridge for Vanilla Minecraft
import socket
import threading
import re
import time
class ircOutputBuffer:
# Delays consecutive messages by at least 1 second.
# This prevents the bot spamming the IRC server.
def __init__(self, irc):
self.waiting = False
#include <iostream>
#include <fstream>
#include <cstring>
using namespace std;
class rom {
public:
rom ( ifstream & stream );
~rom();
@TerrorBite
TerrorBite / homes.md
Last active January 2, 2016 16:19
How homes will work in Vanilla (completely doable in CH)

##The /home Command

This command won't actually do any teleporting. Instead, it will alias to /help home which will give them information on how to teleport.

##Teleporting home

To teleport home (actually, to the last bed they slept in - no /sethome), the player must possess an Ender Pearl and then throw it directly up into the sky. The player will be teleported home assuming they fulfil the following conditions:

  • The pearl must come down and strike within a few blocks of the player. This means they have to do it out in the open.
  • The player must not have moved since they threw the pearl.
@TerrorBite
TerrorBite / gist:8311290
Last active January 2, 2016 13:39
Stuff for secret stuff
enum rarities {
VERY_COMMON,
COMMON,
LESS_COMMON,
RARE,
VERY_RARE,
EXTRA_RARE
}
// 50, 25, 15, 7, 2, 1
<?php
/*
* Installation:
* require_once("extensions/MantisIntegration/MantisIntegration.php"); in LocalSettings.php
* update $mantisDBSERVER, $mantisDBUSER, $mantisDBUSERPW, $mantisDBNAME, $mantis_home
* Usage:
* <mantis>#bugid</mantis>
*
* @version 0.2 schke 2008-10-31
* -change data input from php implode of bugsite to direct database access