diff --git a/grepolis.user.js b/grepolis.user.js index c063f65..ddb8c2c 100644 --- a/grepolis.user.js +++ b/grepolis.user.js @@ -10,11 +10,38 @@ // // @match http://*.grepolis.com/game/* // -// @version 1.0.17 +// @version 1.0.18 // @updateURL http://git.javil.eu/jan/userscripts/raw/master/grepolis.user.js // ==/UserScript== (function() { + console.logCopy = console.log.bind(console); + console.log = function() + { + // Timestamp to prepend + var timestamp = new Date().toJSON(); + + if (arguments.length) { + // True array copy so we can call .splice() + var args = Array.prototype.slice.call(arguments, 0); + + // If there is a format string then... it must be a string + if (typeof arguments[0] === "string") { + // Prepend timestamp to the (possibly format) string + args[0] = "%o: " + arguments[0]; + + // Insert the timestamp where it has to be + args.splice(1, 0, timestamp); + + // Log the whole array + this.logCopy.apply(this, args); + } else { + // "Normal" log + this.logCopy(timestamp, args); + } + } + }; + console.log("Initializing..."); farm_ids = [1225, 1226, 1229, 1230, 1231]; console.log("Setting timer to 5s");