Adds various improvements to the game Lioden.
当前为
// Generated by CoffeeScript 1.9.3
/* UserScript options {{{1
See http://wiki.greasespot.net/Metadata_Block for more info.
// ==UserScript==
// @name Lioden Improvements
// @description Adds various improvements to the game Lioden.
// @namespace ahto
// @version 0.0
// @include http://*.lioden.com/*
// @include http://lioden.com/*
// @require https://greasyfork.org/scripts/10922-ahto-library/code/Ahto%20Library.js?version=75750
// @grant GM_addStyle
// ==/UserScript==
*/
/* Features and changes {{{1
General:
- Made the second-to-top bar a little slimmer.
Hunting:
- Automatically reloads flashes the tab when your hunt is finished.
*/
var HUNT_BLINK_TIMEOUT, blinker, getResults, minutesLeft, wait;
HUNT_BLINK_TIMEOUT = 500;
GM_addStyle("/* Make the top bar slimmer. */\n.main { margin-top: 10px; }\n\n/*\n * Remove the Lioden logo since I can't figure out how to shrink it,\n * and it's taking up too much space on the page. It overlaps the veeery\n * top bar, with the link to the wiki and forums and stuff.\n *\n * TODO: Figure out how to just shrink it instead of flat-out removing it.\n */\n.navbar-brand > img { display: none; }");
if (urlMatches(new RegExp('/hunting\\.php', 'i'))) {
minutesLeft = findMatches('div.center > p', 0, 1).text();
getResults = findMatches('input[name=get_results', 0, 1);
if (minutesLeft.length) {
minutesLeft = (/([0-9]+) minutes/.exec(minutesLeft))[1];
minutesLeft = safeParseInt(minutesLeft);
console.log(minutesLeft, 'minutes remaining.');
wait = (minutesLeft + 1) * 60 * 1000;
console.log("Reloading in " + wait + " ms...");
setTimeout_(wait, function() {
return location.reload();
});
} else if (getResults.length) {
blinker = setInterval((function() {
if (document.title === 'Ready!') {
return document.title = '!!!!!!!!!!!!!!!!';
} else {
return document.title = 'Ready!';
}
}), HUNT_BLINK_TIMEOUT);
window.onfocus = function() {
clearInterval(blinker);
return document.title = 'Ready!';
};
}
}