Skip to content

Instantly share code, notes, and snippets.

@semperrabbit
semperrabbit / Screeps-birthdays.js
Last active July 5, 2019 23:06
Screeps client inject object birthdays
/* watcher function to ensure injection is applied */
window.showBirthDate = function(event){
var formatDate = function formatDate(d){;
return ("0" + d.getUTCHours()).slice(-2) + ":" +
("0" + d.getUTCMinutes()).slice(-2) + ":" +
("0" + d.getUTCSeconds()).slice(-2) + " " +
("0" + (d.getUTCMonth()+1)).slice(-2) + "/" +
("0" + d.getUTCDate()).slice(-2) + "/" +
d.getUTCFullYear() + " UTC";
};
// The function below was developed late last year by the Screeps player "stybbe" published in
// chat.screeps.com's #share-thy-code channel. No license was applied; all rights remain with
// the author.
global.voiceConsole = function voiceConsole(text){
console.log(`<span style="color:green; font-style: italic;">${text}</span>
<script>
if (!window.speakText){
window.speakText = function(gameTime, text) {
var id = gameTime + "-" + text;
if(!window.voiceHash){
@semperrabbit
semperrabbit / Traveler.js
Last active May 25, 2017 07:06 — forked from bonzaiferroni/Traveler.js
Traveler.js
/**
* To start using Traveler, require it in main.js:
*
* There are 6 options available to pass to the module. Options are passed in the form
* of an object with one or more of the following:
*
* exportTraveler: boolean Whether the require() should return the Traveler class. Defaults to true.
* installTraveler: boolean Whether the Traveler class should be stored in `global.Traveler`. Defaults to false.
* installPrototype: boolean Whether Creep.prototype.travelTo() should be created. Defaults to true.
* hostileLocation: string Where in Memory a list of hostile rooms can be found. If it can be found in