Skip to content

Instantly share code, notes, and snippets.

View lashtear's full-sized avatar

Emily Backes lashtear

View GitHub Profile
@lashtear
lashtear / reactor.lua
Created March 14, 2017 09:08
Darklight's reactor pid stuff
local component = require("component")
local computer = require("computer")
function getPIDObject(kp, ki, kd, minclamp, maxclamp, inputMethod, outputMethod)
local retObj = {}
retObj.kp = kp
retObj.ki = ki
retObj.kd = kd
retObj.minclamp = minclamp
retObj.maxclamp = maxclamp
{-# OPTIONS -Wall #-}
module Creepsay where
-- ^ This file has some random scribblings for Screeps Diplomacy
-- protocol discussion. Most of the things in here are not directly
-- of use, but might help for assembling reference examples, once we
-- figure out how the various layers should work.
--
-- The 62k suffix entries are "base62k" encoding, i.e. using all of
-- the UCS2 space except for the 0xd800-0xdfff region historically
#! /usr/bin/perl
use warnings;
use strict;
sub slurp {
my $filename = shift;
local $/;
open my $fh, '<', $filename
or die "open: $filename: $!\n";