Coinbrawl

try to take over the world!

2016-03-02 या दिनांकाला. सर्वात नवीन आवृत्ती पाहा.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

// ==UserScript==
// @name         Coinbrawl
// @version      0.31
// @description  try to take over the world!
// @author       You
// @match        https://www.coinbrawl.com/*
// @grant        none
// @namespace https://greasyfork.org/users/25633
// ==/UserScript==

//menu
$('li:has(a[href$="/referrals"])').remove();

//ads
$('div.panel-game-content:first').hide();
$('div.col-sm-9 > center').hide();
$('div.col-sm-3').hide();

//enable all buttons
$('td > a').removeClass('disabled');

if ( $("li.active a[href='/").length == 1 ){ //On main page

    $('div.col-sm-6').hide();
    $('div.col-sm-4').hide();
    $('div.col-sm-8').hide();

    var BANKLIMIT = 680163;

    var startS = setInterval(function(){

        var attackPlayer = setTimeout(function(){

            var rawSta = $('#quick-stats > div > div > ul > li:nth-child(5) > span.value > span:nth-child(2)').text();
            var rawTok = $('#quick-stats > div > div > ul > li:nth-child(6) > span.value > span:nth-child(2)').text();
            var gold = $('#quick-stats > div > div > ul > li:nth-child(7) > span.value.text-success > span:nth-child(2)').text();
            var cuurentBank = $('#quick-stats > div > div > ul > li:nth-child(9) > span.value.text-success > span:nth-child(2)').text();

            var stamina = rawSta.split("/");
            var token = rawTok.split("/");

            //console.log('Stamina: ', parseInt(stamina[0]), "/", parseInt(stamina[1]));
            //console.log('Tokens: ', parseInt(token[0]), "/", parseInt(token[1]));
            //console.log('Gold: ', gold);

            if ( stamina[0] > 0 && gold < 50000 ) {
                console.log('Attacking NPC');
                $('#npc-battle-table > div > table > tbody > tr:nth-child(6) > td:nth-child(5) > a')[0].click();
            } else if (token[0] > 0 && gold < 50000 && stamina[0] == 0 ) {
                console.log('[danger] Attacking user');
                searchArena.click();
            } else if ( gold > 50000 && !(cuurentBank == BANKLIMIT) ) {
                top.location.href = "https://www.coinbrawl.com/bank/deposit_max";
            } else {
                console.log('[FULL] Bank has reached limit!');
                clearTimeout(attackPlayer);
                clearInterval(startS);
            }

        },3500);

    },2000);


    var searchArena = $('#battle-table > div > p > a')[0];
    searchArena.onclick=function(){
        setTimeout(function(){
            attackUser();
        },2000);
    };

    function attackUser(){
        $('tbody:first > tr').each(function(){
            if ( $(this).find('strong.text-success').html() > 7000 ){
                $(this).find('td > a')[0].click();
                return;
            }
        });
    }

} else if ( $("li.active a[href='/bank").length == 1 ){ 

    var gotoArena = setTimeout(function(){
        top.location.href = "https://www.coinbrawl.com/";
    },5000);

}