Skip to content

Instantly share code, notes, and snippets.

View xyzzy529's full-sized avatar

Bryan xyzzy529

  • Denver CO, USA
View GitHub Profile
@xyzzy529
xyzzy529 / planner2.js
Last active June 24, 2020 16:35 — forked from lethern/planner2.js
screeps room planner
function planner_loop (roomName, opts = {}) {
let _this = {};
_this.visual = new RoomVisual(roomName);
_this.anchor = getAnchor(roomName);
_this.terrain = new Room.Terrain(roomName);
if (!_this.anchor) return;
let s = 1;
/**
* Retrieves all the rows in the active spreadsheet that contain data and logs the
* values for each row.
* For more information on using the Spreadsheet API, see
* https://developers.google.com/apps-script/service_spreadsheet
*/
function readRows() {
var sheet = SpreadsheetApp.getActiveSheet();
var rows = sheet.getDataRange();
var numRows = rows.getNumRows();
@xyzzy529
xyzzy529 / RoomVisual.js
Created July 5, 2017 19:24 — forked from tedivm/RoomVisual.js
RoomVisual structure rendering
const colors = {
gray: '#555555',
light: '#AAAAAA',
road: '#666', // >:D
energy: '#FFE87B',
power: '#F53547',
dark: '#181818',
outline: '#8FBB93',
speechText: '#000000',
speechBackground: '#2ccf3b'
if(!Memory.__segindex) {
Memory.__segindex = {
'index': {},
'savelog': {},
'buffer': {},
'ttls': {},
'clear': [],
'critical': [],
'last': 100
@xyzzy529
xyzzy529 / 0_reuse_code.js
Created June 7, 2017 17:08
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@xyzzy529
xyzzy529 / sos_lib_crypto.js
Created May 31, 2017 20:53 — forked from tedivm/sos_lib_crypto.js
ScreepsOS Crytpo Library
/*
Copyright (c) 2017 Robert Hafner <[email protected]>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
// screep astar
// based off of javascript-astar 0.4.1
// http://github.com/bgrins/javascript-astar
// Freely distributable under the MIT License.
// Implements the astar search algorithm in javascript using a Binary Heap.
// Includes Binary Heap (with modifications) from Marijn Haverbeke.
// http://eloquentjavascript.net/appendix2.html
// Modified for Screeps by Robert Hafner
@xyzzy529
xyzzy529 / gist:97a79e8f5942dcc4215beb4389e979dc
Created March 31, 2017 16:27
javascript :: custom Alert overriding default native alert in javascript
<!DOCTYPE html>
<html>
<head>
<title></title>
<link rel=stylesheet href="style.css" />
<script src="jquery.js" type="text/javascript" charset="utf-8"></script>
<script>
(function(){