Skip to content

Instantly share code, notes, and snippets.

View utiuti's full-sized avatar

Zimt utiuti

  • Kassel
View GitHub Profile
@utiuti
utiuti / voice.js
Last active December 18, 2018 07:19
// The function below was developed late last year by @stybbe, published in
// Screeps Slack's #share-thy-code channel. No license was applied; all
// rights remain with the author. Minor fixes were made by @SemperRabbit
// to get it working again.
// NOTE: that this code works in chrome and firefox (albiet quietly
// in firefox) but not the steam client.
global.defaultVoice = "Deutsch Female"; // can be changed
// see https://responsivevoice.org/text-to-speech-languages/
@utiuti
utiuti / prototype.js
Created July 5, 2015 17:26
Question about prototypes in separate files
module.exports = function () {
Room.prototype.findCreeps = function (role) {
var creeps = room.find(FIND_MY_CREEPS);
if (role && role != "") {
creeps = _.filter(creeps, function (c) {
return (c.memory.role == role);
});
}