Skip to content

Instantly share code, notes, and snippets.

View tedivm's full-sized avatar

Robert Hafner tedivm

View GitHub Profile
@tedivm
tedivm / Caching Differences.md
Last active December 18, 2015 00:29
Caching Proposal Differences
@resir014
resir014 / loan-screeps-alliances.md
Last active September 28, 2016 12:17
Screeps alliances list.

League of Automated Nations - Screeps Alliances

This list is no longer updated. Please go here for an up-to-date list.


This gist documents player alliances known to exist on Screeps as of 2016-09-25 11:00 UTC.

We're in the process of developing a diplomatic dashboard to track alliances and treaties. For more information, check out the #loan channel on the Screeps Slack.

@AlinaNova21
AlinaNova21 / main.js
Created September 14, 2016 04:53
Screeps Source Keeper Source
PathFinder.use(true);
for (var i in Game.creeps) {
var creep = Game.creeps[i], source = undefined;
if (!creep.room) {
continue;
}
if (creep.memory.sourceId) {
source = Game.getObjectById(creep.memory.sourceId);
}
if(!source) {
@AlinaNova21
AlinaNova21 / findAttack.js
Created September 14, 2016 04:45
Screeps Invader Source Code
var flee = require('flee');
function checkPath(pos1, pos2) {
var path = pos1.findPathTo(pos2);
if (!path.length) {
return false;
}
return path[path.length - 1].x == pos2.x && path[path.length - 1].y == pos2.y;
}
function costCallbackIgnoreRamparts(roomName, cm) {
var ramparts = Game.rooms[roomName].find(FIND_STRUCTURES, {filter: i => i.structureType == STRUCTURE_RAMPART || i.structureType == STRUCTURE_WALL});
@AlinaNova21
AlinaNova21 / RoomVisual.js
Last active June 16, 2017 15:43
RoomVisual structure rendering
/*********************************************/
/********** Moved to Screepers repo **********/
/** https://github.com/screepers/RoomVisual **/
/*********************************************/
const colors = {
gray: '#555555',
light: '#AAAAAA',
road: '#666', // >:D
energy: '#FFE87B',
@jedda
jedda / gist:4103604
Created November 18, 2012 04:44
Configuring basic RADIUS on OS X 10.8 Server
# Configuring basic RADIUS on OS X 10.8 Server
# Jedda Wignall
# http://jedda.me
# Full writeup at: http://jedda.me/2012/11/configuring-basic-radius-os-108-server/
# create the SACL for access to RADIUS
dseditgroup -q -o create -u <admin user> -n . com.apple.access_radius
# configure radiusd to log both successful and failed authentications
@tedivm
tedivm / README.md
Last active January 28, 2019 23:26
Screeps Private Server Setup (Ubuntu, Mongo, Redis)
  1. Download setup.sh and replace STEAM_KEY with your key and update any versions you want.
  2. Run setup.sh.
  3. Replace mods.json with one provided here.
  4. Create service file by copying file here to /etc/systemd/system/screeps-world.service.
  5. Enable and run service (systemctl enable screeps-world && systemctl start screeps-world).
  6. Log into the cli (su screeps && cd ~/world && ./node_modules/screeps/bin/screeps.js cli).
  7. Reset memory (system.resetAllData()) and restart (systemctl restart screeps-world.
@dzhu
dzhu / screeps.py
Last active November 14, 2020 10:18
description of the HTTP endpoints available from Screeps, and a Python wrapper to access them (requires requests library)
import json
from base64 import b64decode
from collections import OrderedDict
from cStringIO import StringIO
from gzip import GzipFile
import requests
## Python before 2.7.10 or so has somewhat broken SSL support that throws a warning; suppress it
#!/bin/bash
# Check if a value exists in an array
# @param $1 mixed Needle
# @param $2 array Haystack
# @return Success (0) if value exists, Failure (1) otherwise
# Usage: in_array "$needle" "${haystack[@]}"
# See: http://fvue.nl/wiki/Bash:_Check_if_array_element_exists
in_array() {
local hay needle=$1