Gamdom Rain Notifier 1.0.1

WORKABLE SCRIPT, NO BAN RISK, NO MINER INSIDE. READ DESCRIPTION ON GREASYFORK.ORG

当前为 2018-03-09 提交的版本,查看 最新版本

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name        Gamdom Rain Notifier 1.0.1
// @description WORKABLE SCRIPT, NO BAN RISK, NO MINER INSIDE. READ DESCRIPTION ON GREASYFORK.ORG
// @namespace   https://greasyfork.org/users/173937
// @version     1.1.0
// @author      Boris Britva
// @include     /^https:\/\/greasyfork\.org\/([a-z]{2}(\-[A-Z]{2})?\/)?scripts/39315(\-[^\/]+)$/
// @include     /^https?:\/\/gamdom\.com\/*$/
// @require     https://greasyfork.org/scripts/39350-gamdom-rain-notifier-library/code/Gamdom%20Rain%20Notifier%20Library.js?version=257595
// @grant       GM_xmlhttpRequest
// @grant       GM_notification
// @grant       GM_info
// @connect     gamdomrain.com
// ==/UserScript==

window.GM_notification = window.GM_notification || function(){console.log.apply(null, arguments);};
(function(){
	console.log("start playing the game");
	if( location.hostname == 'gamdom.com' )
		return;
	main();
	//playback(1);// test sound
	GM_notification({
		title: info() + " starts..",
		text: "Just leave this page open, and you'll get all notifications",
		highlight: true,
		timeout: 1e4,
	});
})();
function notify(r)
{
	return console.log("grn..", (Date.now() - time)/1e3, "sec", r == 4 ? "it's raining!" : ""),
	(r && r == 4) ? (GM_notification({
		title: "[" + info() + "]: IT IS RAINING!",
		text: "GO TO GAMDOM.COM AND CHASE IT",
		highlight: true,
		timeout: 5e3,
	}), !0) : !1;
}
function info(){return GM_info.script.name + " v" + GM_info.script.version;}
function dmail(details)
{
	return new Promise(function(resolve, reject){
		details.method = details.method || "GET";
		details.onload = function(r){
			if( r.status != 200 )
				reject(r.statusText);
			else
				resolve(r.response);
		};
		var h = details.headers = {};
		h.referer = details.url.replace(/(https?\:)\/\/([^\/\?\#]+)([^\?\#]+)/, '$1//$2/detector');
		GM_xmlhttpRequest(details);
	});
}
function get(){url().then(dmial).then(len).then(notify).then(playback);}
function dmial(u){return dmail({url: u});}
function len(a){return a.length;}
function main(){time = Date.now(); setInterval(get, 8e3); console.log("just for lulz =)");}