IceCube018 / Ikariam kalóz fosztó

// ==UserScript==
// @name         Ikariam kalóz fosztó
// @namespace    http://tampermonkey.net/
// @version      0.8.1
// @description  Kifosztja a kalózcuccot kb. 2.5 percenként.
// @author       IceCube018
// @include      http://*.ikariam.*
// @include      https://*.ikariam.*
// @grant        none
// @run-at       document-ready
// @license      GPL-3.0-or-later
// @updateURL https://openuserjs.org/meta/IceCube018/Ikariam_kalóz_fosztó.meta.js
// ==/UserScript==
var randomOffset1;
var randomOffset2;
var bal;
var fent;
var negyszog;

var temp;

var randomTime;
var count = 0;
var captcha = false;

var snd = new Audio("data:audio/mp3;base64,SUQzAgAAAAAQS1RUMgAAFwBXaWRnZXRfbm9pc2VfdXBkYXRlZDIAQ09NAAAQAGVuZ2lUdW5QR0FQADAAAFRFTgAAEgBpVHVuZXMgMTIuNS4zLjE3AENPTQAAaABlbmdpVHVuTk9STQAgMDAwMDA1RkQgMDAwMDA2MkYgMDAwMDFBNDkgMDAwMDFCMjYgMDAwMDAwQTggMDAwMDAwQTggMDAwMDczM0YgMDAwMDc1MTkgMDAwMDAwOTAgMDAwMDAwOTAAQ09NAACCAGVuZ2lUdW5TTVBCACAwMDAwMDAwMCAwMDAwMDIxMCAwMDAwMEFGMiAwMDAwMDAwMDAwMDAzMUZFIDAwMDAwMDAwIDAwMDAwQjQwIDAwMDAwMDAwIDAwMDAwMDAwIDAwMDAwMDAwIDAwMDAwMDAwIDAwMDAwMDAwIDAwMDAwMDAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA");

function klikkUj(){
    if (!document.getElementById("pirateCaptureBox")){
        console.log("5mp");
        setTimeout(
            function()
            {
                klikkUj();
            }, 5000);
    }
    else{
        try{
            temp = document.getElementById("pirateCaptureBox");
            temp = temp.getElementsByClassName("content");
            temp = temp[0].getElementsByClassName("table01");
            temp = temp[0].getElementsByClassName("alt");
            temp = temp[0].getElementsByClassName("action");
            temp = temp[0].getElementsByTagName("a");
            negyszog = temp[0].getBoundingClientRect();
            randomOffset1 = Math.floor(Math.random()*20)-10;
            randomOffset2 = Math.floor(Math.random()*20)-10;
            bal = negyszog.left + (Math.abs(negyszog.left-negyszog.right) / 2);
            fent = negyszog.top + (Math.abs(negyszog.top-negyszog.bottom) / 2);
            document.elementFromPoint(bal + randomOffset1, fent + randomOffset2).click();
            randomTime = (Math.floor(Math.random()*1000*10)+1000*(60*2.5+2));
            count++;
            localStorage.setItem("ikariamCounter", count);
            console.log("klikk ".concat(count).concat(" ").concat((randomTime/1000-150+5).toFixed(2)));
            setTimeout(
                function()
                {
                    checkCaptcha();
                }, 1000*3);
        } catch(err){
            console.log("Valami gebasz van. 5mp");
            snd.play();
            setTimeout(
                function()
                {
                    klikkUj();
                }, 1000*5);
        }
    }
}

function checkCaptcha(){
    try{
        temp = document.getElementById("pirateCaptureBox");
        temp = temp.getElementsByClassName("content");
        temp = temp[0].getElementsByClassName("captchaImage");
        if(temp.length == 1){
            captcha = true;
            console.log("captcha");
            snd.play();
            setTimeout(
                function()
                {
                    checkCaptcha();
                }, 1000*5);
        } else {
            if(captcha == true){
                console.log("captcha OK");
                captcha = false;
            }
            setTimeout(
                function()
                {
                    klikkUj();
                }, randomTime);
        }
    } catch(err){
        var currentDate = new Date().toLocaleDateString();
        var currentTime = new Date().toLocaleTimeString();
        console.log("Hiba: ".concat(currentDate).concat(" - ").concat(currentTime).concat(" Nyisd meg a kalóz erődöt!"));
        snd.play();
        setTimeout(
            function()
            {
                checkCaptcha();
            }, 1000*5);
    }
}

console.log("start");
if(localStorage.getItem("ikariamCounter")==null){
    count = 0;
} else {
    count = localStorage.getItem("ikariamCounter");
}
console.log("Eddigi klikkek: ".concat(count));
klikkUj();