hwm_easy_rools

Скрипт упрощающий слив денег в рулетку.

目前為 2015-07-22 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name            hwm_easy_rools
// @author          -Партизанэн-
// @description     Скрипт упрощающий слив денег в рулетку.
// @version         1.0
// @include         http://www.heroeswm.ru/roulette.php
// @include         http://www.heroeswm.ru/roulette.php
// @include         http://qrator.heroeswm.ru/roulette.php
// @include         http://178.248.235.15/roulette.php
// @include         http://www.lordswm.com/roulette.php
// @encoding 	    utf-8
// @namespace https://greasyfork.org/users/12821
// ==/UserScript==

// (c) -Партизанэн- http://www.heroeswm.ru/pl_info.php?id=1108465

document.getElementsByTagName('table')[34].onclick = function(event) {
	if (document.getElementById('cForm') !== null) {
		document.getElementById("cForm").remove();
	}
	var field = event.target;

	while (field != document.getElementsByTagName('table')[34]) {
		if (field.tagName == 'IMG') {
			cFormCreate(field, event);
			break;
		}
		field = field.parentNode;
	}
}

function cFormCreate(field, event) {
	var rs_name_img = new RegExp('.*\\/(.*)\\.gif','i');
	var name_img = rs_name_img.exec(field.src)[1];
	document.getElementsByName('bettype')[0].value = "";
	document.getElementsByName('bet')[0].value = "";

	var c_form = document.createElement('div');
	c_form.id = "cForm";
	c_form.style.position = "absolute";
	c_form.style.width = "200px";
	c_form.style.height = "200px";
	c_form.style.margin = "0px";
	c_form.style.padding = "0px";
	c_form.style.background = "#DDD9CD";

	c_form.style.WebkitBoxShadow = "0px 0px 15px #000";
	c_form.style.MozBoxShadow = "0px 0px 15px #000";
	c_form.style.BoxShadow = "0px 0px 15px #000";
	c_form.style.top = event.clientY;
	c_form.style.left = event.clientX;


	var c_form_head = document.createElement('div');
	c_form_head.id = "c_form_head";
	c_form_head.style.height = "25px";
	c_form_head.style.width = "100%";
	c_form_head.style.background = "#41A152";
	c_form_head.style.color = "#000";


	var c_form_head_num = document.createElement('div');
	c_form_head_num.id = "c_form_head_num";
	c_form_head_num.style.height = "100%";
	c_form_head_num.style.float = "left";
	c_form_head_num.style.background = "#41A152";
	c_form_head_num.style.fontSize = "18px";
	c_form_head_num.innerHTML = 'Ставка на ' + name_img;
	c_form_head_num.style.color = "#000";


	var c_form_head_close = document.createElement('div');
	c_form_head_close.id = "close_form";
	c_form_head_close.innerHTML = "X";
	c_form_head_close.style.width = "21px";
	c_form_head_close.style.height = "25px";
	c_form_head_close.style.float = "right";
	c_form_head_close.style.margin = "0px";
	c_form_head_close.style.padding = "0px 0px 0px 6px";
	c_form_head_close.style.fontSize = "20px";
	c_form_head_close.style.background = "#ff0000";
	c_form_head_close.style.cursor = "pointer";

	c_form_head_close.onclick = function() {
		var elem = document.getElementById("cForm");
		elem.remove();
	}

	var t = document.createElement('table');
	var tbody = document.createElement('tbody');
	for(var i = 0;i<6;i++) {

		var tr = document.createElement('tr');
		for (var j = 0;j<5;j++){
			var td = document.createElement('td');
			td.style.width = "34px";
			td.style.height = "20px";
			td.style.padding = "0px 3px";
			td.style.color = "#000";
			td.style.background = "#2B903D";
			td.style.cursor = "pointer";

			td.onmouseover = function(){
				this.style.background = "#005C11";
			}
			td.onmouseout = function(){
				this.style.background = "#2B903D";
			}

			if ((i*5)+(j+1) <= 10) {
				td.innerHTML = ((i*5)+(j+1))*100;
				var rate = ((i*5)+(j+1))*100;
			} else {
				td.innerHTML = (((i*5)+(j+1))-9) + "к";
				var rate = ((((i*5)+(j+1))-9)*1000);
			}
			td.style.title = rate;
			
			td.onclick = function () {
				document.getElementsByName('bettype')[0].value = field.title;
				document.getElementsByName('bet')[0].value = this.style.title;
				document.getElementsByName('rform')[0].submit();
			}
			tr.appendChild(td);
		}
		tbody.appendChild(tr);
	}
	t.appendChild(tbody);


	c_form_head.appendChild(c_form_head_num);
	c_form_head.appendChild(c_form_head_close);
	c_form.appendChild(c_form_head);
	c_form.appendChild(t);
	document.body.appendChild(c_form);
}