This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* eslint no-console:0, max-len:0 */ | |
// see https://gitlab.com/help/web_hooks/web_hooks for full json posted by GitLab | |
const MENTION_ALL_ALLOWED = false; // <- check that bot permission allow has mention-all before passing this to true. | |
const NOTIF_COLOR = '#6498CC'; | |
const refParser = (ref) => ref.replace(/^refs\/(?:tags|heads)\/(.+)$/, '$1'); | |
const displayName = (name) => (name && name.toLowerCase().replace(/\s+/g, '.')); | |
const atName = (user) => (user && user.name ? '@' + displayName(user.name) : ''); | |
const makeAttachment = (author, text) => { | |
if (author) { | |
text = displayName(author.name) + " " + text; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* eslint no-console:0, max-len:0 */ | |
// see https://gitlab.com/help/web_hooks/web_hooks for full json posted by GitLab | |
const MENTION_ALL_ALLOWED = false; // <- check that bot permission allow has mention-all before passing this to true. | |
const NOTIF_COLOR = '#6498CC'; | |
const refParser = (ref) => ref.replace(/^refs\/(?:tags|heads)\/(.+)$/, '$1'); | |
const displayName = (name) => (name && name.toLowerCase().replace(/\s+/g, '.')); | |
const atName = (user) => (user && user.name ? '@' + displayName(user.name) : ''); | |
const makeAttachment = (author, text) => { | |
return { | |
author_name: author ? displayName(author.name) : '', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports.loop = function() { | |
if (Game.cpu.tickLimit < 500) { | |
console.log("Execution of loop is not possible, because tick limit is " + Game.cpu.tickLimit + "<500"); | |
return; | |
} | |
var time = Game.cpu.getUsed(); | |
console.log("--> LOAD TIME " + time); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
console.log('only once!'); | |
var mod = require('mod'); | |
Memory.ticks = 0; | |
var test = Game.time; | |
module.exports.loop = function() { | |
console.log('tick ' + (Memory.ticks ++) + '! (var test = ' + test + ')'); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
getPx('https://s3.amazonaws.com/static.screeps.com/map2/'+ roomName+ '.png', function(err, pixels) { | |
if (err) { | |
throw err; | |
} | |
let kyskip = 50 * 3 * 3 * 4; | |
let kxskip = 3 * 4; | |
for (let yy = 0; yy < 50; ++yy) { | |
for (let xx = 0; xx < 50; ++xx) { | |
let px = pixels.data[xx * kxskip + yy * kyskip] * 0x10000 + pixels.data[xx * kxskip + yy * kyskip + 1] * 0x100 + pixels.data[xx * kxskip + yy * kyskip + 2]; | |
switch (px) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var global = self; | |
var Reflect = { | |
global: global | |
}; | |
!function a(b, c, d) { | |
function e(g, h) { | |
if (!c[g]) { | |
if (!b[g]) { |