reCAPTCHA E FARM NO A

Script facilitador de saques para Tribal Wars.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name reCAPTCHA E FARM NO A
// @author superluyz
// @version 1.2 (SET/2019;)
// @grant Publico
// @description Script facilitador de saques para Tribal Wars.
// @include        http*://*.tribalwars.com.pt/*screen=am_farm*
// @namespace https://greasyfork.org/users/163899
// ==/UserScript==

var botProtect = $('body').data('bot-protect');
if (document.URL.indexOf('screen=am_farm') == -1)
	console.log('Você deve executar o script no assistente de farm!');
else if (botProtect !== undefined) {
	alert('Alerta Captcha!');
}
else {
	var x				= 1,				// NÃO ALTERAR!
		menu			= $('#am_widget_Farm a.farm_icon_a'),
		tempo			= "random",
		minhaVar		= "",				// NÃO ALTERAR!
		alteraraldeia   = true,
		altAldTempo		= true,				// Tempo em milesegundos para alternar as aldeias (Use 'true' para aleatório)
		atualizarPagina	= true,			// Atualizar a página automaticamente? ('true' = SIM, 'false' = NÃO)
        atlPagTempo     = "random",
		boxCaptcha		= $("#bot_check");	// NÃO ALTERAR!

	var aleatorio = function(superior, inferior) {
		var numPosibilidades	= superior - inferior,
			aleat				= Math.random() * numPosibilidades;

		return Math.round(parseInt(inferior) + aleat);
	};

	if (tempo === "random") {
		tempo = aleatorio(5000, 10000);
	}
    if (atlPagTempo === "random") {
		atlPagTempo = aleatorio(700000, 800000);
	}

	$('img').each(function() {
		var tempStr = $(this).attr('src');
		if (tempStr.indexOf('attack') != -1)
			$(this).addClass('tooltip');
	});

	if (atualizarPagina === true) {
		setInterval(function() {
			window.location.reload();
		}, atlPagTempo);
	}

	if (altAldTempo !== false) {
		if (altAldTempo === true)
            if($('#light').text() >= 5 && $('#spy').text() >= 1)
                altAldTempo = aleatorio(100000, 150000);
            else
                altAldTempo = aleatorio(3000, 5000);
		else
			altAldTempo = parseInt(altAldTempo) + parseInt(aleatorio(500, 1000));
		}
	}

		for (i = 0; i < 100; i++) {
				if(parseInt($('#plunder_list tr:not(:first, :last)').eq(i + 1).find('td').eq(6).text()) == 0 || isNaN($('#plunder_list tr:not(:first, :last)').eq(i + 1).find('td').eq(6).text()) == true){
                    $(menu).eq(i).each(function() {
						var tempoAgora = tempo * x;
						setTimeout(function(minhaVar) {
                            if($('#light').text() >= 5 && $('#spy').text() >= 1)
                                $(minhaVar).click();
						}, tempoAgora, this);
						++x;
			
				});
             }
        }


	if (alteraraldeia === true) {
		var altVillage = setInterval(function () {
			$('.arrowRight, .groupRight').click();

			clearInterval(altVillage);
		}, altAldTempo);
	}


	var checkCaptcha = setInterval(function() {
		if (boxCaptcha.length) {
			alert('Captcha bloqueado');
			clearInterval(checkCaptcha);
			clearInterval(altVillage);
		}
	}, 100);