// ==UserScript==
// @name Crypt farm
// @namespace Violentmonkey Scripts
// @include *gatewa.rs/*
// @exclude *main.gatewa.rs/armory.php
// @exclude *.gatewa.rs/
// @exclude *.gatewa.rs/index.php
// @exclude *gatewa.rs/attacklog.php
// @exclude *gatewa.rs/intel.php
// @exclude *gatewa.rs/bank.php
// @grant none
// @version 1.0
// @author Devious Demolisher
// @description 14/02/2021, 14:38:47
// ==/UserScript==
// ==UserScript==
///////////////////////////////////////////////////////
//////////////////manually configurable settings///////
//////////////////////////////////////////////////////
var takenaq = 320000000000; // The minimum naq it will hit for in billion
var minraids = 100000000; // The amount a target needs minimal to raid hit at least once
var banking = 1000000000000; //Limited banker, bank above this amount
var unidefmax = 5000000000000; //max defense allowed to hit with unifarmer
//repairs Configs
var maxdelay = 700; //default max delay before repair page reload
var maxdelayrandom = 700; //the extra randomness to the delay
var maxattackdamage = 200000000000; // damage allowed on attack weapons in Naq worth
var maxdefensedamage = 10000000000; // 1 bill damage allowed on defense weapons in Naq worth
if(document.URL.indexOf("ascended") == -1){
//Divs whiper
var items = document.getElementsByTagName("div");
for (var i = 0; i < items.length; i++) {
//do stuff
items[i].innerHTML = "";
}
var inputs = document.getElementsByTagName("input");
var alllinks = document.getElementsByTagName("a");
}
function getCookie(c_name) {
return localStorage.getItem(c_name);
}
function setCookie(c_name, value, expiredays) {
return localStorage.setItem(c_name, value);
}
//////////////////////////////////////////////////////////////////
///////////////////////////Button functions//////////////////////
////////////////////////////////////////////////////////////////
function sabtoggle(){
if(sabactive == 0){
setCookie("sabactive", 1, 365);
document.getElementById("sabactive").value="sabber enabled";
sabactive = 1;
} else
if(sabactive == 1){
setCookie("sabactive", 0, 365);
document.getElementById("sabactive").value="sabber disabled";
sabactive = 0;
}
}
function attacktoggle(){
if(attackactive == 0){
setCookie("attackactive", 1, 365);
document.getElementById("attackactive").value="attacker enabled";
attackactive = 1;
} else
if(attackactive == 1){
setCookie("attackactive", 0, 365);
document.getElementById("attackactive").value="attacker disabled";
attackactive = 0;
}
}
function audiotoggle(){
if(audioactive == 0){
setCookie("audioactive", 1, 365);
document.getElementById("audioactive").value="audio enabled";
audioactive = 1;
var zat = new Audio("http://dl.dropboxusercontent.com/u/7134196/zat.ogg");
zat.play();
} else
if(audioactive == 1){
setCookie("audioactive", 0, 365);
document.getElementById("audioactive").value="audio disabled";
audioactive = 0;
}
}
function warlistfarmertoggle(){
if(warlistfarmeractive == 0){
setCookie("warlistfarmeractive", 1, 365);
document.getElementById("warlistfarmeractive").value="Farm mode";
warlistfarmeractive = 1;
} else
if(warlistfarmeractive == 1){
setCookie("warlistfarmeractive", 2, 365);
document.getElementById("warlistfarmeractive").value="Raid mode";
warlistfarmeractive = 2;
} else
if(warlistfarmeractive == 2){
setCookie("warlistfarmeractive", 3, 365);
setCookie("enemydefense", 0, 365);
setCookie("idchecker", 0, 365);
document.getElementById("warlistfarmeractive").value="Universe farmer";
warlistfarmeractive = 3;
} else
if(warlistfarmeractive == 3){
setCookie("warlistfarmeractive", 4, 365);
document.getElementById("warlistfarmeractive").value="Warlist extender";
warlistfarmeractive = 4;
} else
if(warlistfarmeractive == 4){
setCookie("warlistfarmeractive", 0, 365);
document.getElementById("warlistfarmeractive").value="farmer disabled";
warlistfarmeractive = 0;
}
}
function autobankertoggle(){
if(autobankeractive == 0){
setCookie("autobankeractive", 1, 365);
document.getElementById("autobankeractive").value="banker enabled";
autobankeractive = 1;
} else
if(autobankeractive == 1){
setCookie("autobankeractive", 2, 365);
document.getElementById("autobankeractive").value="Limited banker";
autobankeractive = 2;
} else
if(autobankeractive == 2){
setCookie("autobankeractive", 0, 365);
document.getElementById("autobankeractive").value="banker disabled";
autobankeractive = 0;
}
}
function repairtoggle(){
if(repairactive == 0){
setCookie("repairactive", 1, 365);
document.getElementById("repairactive").value="repairs enabled";
repairactive = 1;
} else
if(repairactive == 1){
setCookie("repairactive", 2, 365);
document.getElementById("repairactive").value="qrepair att first";
repairactive = 2;
} else
if(repairactive == 2){
setCookie("repairactive", 3, 365);
document.getElementById("repairactive").value="qrepair def first";
repairactive = 3;
} else
if(repairactive == 3){
setCookie("repairactive", 0, 365);
document.getElementById("repairactive").value="repairs disabled";
repairactive = 0;
}
}
function mstoggle(){
if(msactive == 0){
setCookie("msactive", 1, 365);
document.getElementById("msactive").value="MS builder";
msactive = 1;
} else
if(msactive == 1){
setCookie("msactive", 2, 365);
document.getElementById("msactive").value="MS builder no naq";
msactive = 2;
} else
if(msactive == 2){
setCookie("msactive", 0, 365);
document.getElementById("msactive").value="MS disabled";
msactive = 0;
}
}
function getCash(amount,idlink){
setCookie("getamountrepairs", amount, 365);
// document.body.innerHTML+='x';
// document.getElementById('gobank').click();
}
function getCashms(amount,idlink){
setCookie("getamountms", amount, 365);
// document.body.innerHTML+='x';
// document.getElementById('gobank').click();
}
function getCasht(amount,selected,howmuch){
setCookie("getamount", amount, 365);
setCookie("getwhat", selected, 365);
setCookie("gethowmuch", howmuch, 365);
// document.body.innerHTML+='x';
// document.getElementById('gobank').click();
}
function getCashw(amount,selected,howmuch){
setCookie("getamountw", amount, 365);
setCookie("getwhatw", selected, 365);
setCookie("gethowmuchw", howmuch, 365);
// document.body.innerHTML+='x';
// document.getElementById('gobank').click();
}
////////////////////////////////////////////////////////////////
////////////////////Cookie Settings init////////////////////////
////////////////////////////////////////////////////////////////
//Audio config
var audioactive;
if(getCookie("audioactive")){audioactive = getCookie("audioactive");} else { audioactive = 0; }
if(audioactive == 0) { var audiomessage = "audio disabled";} else { var audiomessage = "audio enabled";}
//Attacker config
var attackactive;
if(getCookie("attackactive")){attackactive = getCookie("attackactive");} else { attackactive = 0; }
if(attackactive == 0) { var attackmessage = "attacker disabled";} else { var attackmessage = "attacker enabled";}
//Sabber config
var sabactive;
if(getCookie("sabactive")){sabactive = getCookie("sabactive");} else { sabactive = 0; }
if(sabactive == 0) { var sabmessage = "sabber disabled";} else { var sabmessage = "sabber enabled";}
//War list farmer config
var warlistfarmeractive;
if(getCookie("warlistfarmeractive")){warlistfarmeractive = getCookie("warlistfarmeractive");} else { warlistfarmeractive = 0; }
if(warlistfarmeractive == 0) { var warlistfarmermessage = "farmer disabled";}
else if (warlistfarmeractive == 1){ var warlistfarmermessage = "Farm mode";}
else if(warlistfarmeractive == 2) { var warlistfarmermessage = "Raid mode";}
else if(warlistfarmeractive == 3) { var warlistfarmermessage = "universe farmer";}
else if(warlistfarmeractive == 4) { var warlistfarmermessage = "Warlist extender";}
//Autobanker config
var autobankkeractive;
if(getCookie("autobankeractive")){autobankeractive = getCookie("autobankeractive");} else { autobankeractive = 0; }
if(autobankeractive == 0) { var autobankermessage = "banker disabled";}
else if(autobankeractive == 1) { var autobankermessage = "banker enabled";}
else if(autobankeractive == 2) { var autobankermessage = "Limited banker";}
//Repair config
var repairactive;
if(getCookie("repairactive")){repairactive = getCookie("repairactive");} else { repairactive = 0; }
if(repairactive == 0) { var repairmessage = "repairs disabled";}
else if(repairactive == 1) { var repairmessage = "repairs enabled";}
else if(repairactive == 2) { var repairmessage = "qrepair att first"; }
else if(repairactive == 3) { var repairmessage = "qrepair def first";}
//MS config
var msactive;
if(getCookie("msactive")){msactive = getCookie("msactive");} else { msactive = 0; }
if(msactive == 0) { var msmessage = "MS disabled";}
else if(msactive == 1){ var msmessage = "MS builder";}
else if(msactive == 2){ var msmessage = "MS builder no naq";}
///////////////////////////////////////////////////////////
///////////////HEADER BAR BUTTONS//////////////////////////
///////////////////////////////////////////////////////////
var FT = 0;
var tables = document.getElementsByTagName("table");
var BuyWeaponsTable;
var TrainTableCells;
var TargetTableCells;
if(document.URL.indexOf("ascended") == -1){
tables = document.getElementsByTagName("table");
for (var i = 0; i < tables.length; i++) {
if(tables[i].style.display == "none"){
FT++;
}
if(tables[i].innerHTML.indexOf('Buy Weapons') > -1 && tables[i].innerHTML.indexOf('Attack Weapons') > -1 && tables[i].innerHTML.indexOf('Defense Weapons') > -1) { BuyWeaponsCells = tables[i].getElementsByTagName("td"); }
if(tables[i].innerHTML.indexOf('Rehabilitation Center') > -1 && tables[i].innerHTML.indexOf('Train Your Troops') > -1 && tables[i].innerHTML.indexOf('Training') > -1) { TrainTableCells = tables[i].getElementsByTagName("td"); }
if(tables[i].innerHTML.indexOf('battlefieldE.php') > -1 && tables[i].innerHTML.indexOf('ENEMIES') > -1) { TargetTableCells = tables[i].getElementsByTagName("td"); }
}
//alert(FT);
var inputs = document.getElementsByTagName("input");
var alllinks = document.getElementsByTagName("a");
var imgs = document.getElementsByTagName("img");
imgs[0].height='0px';
imgs[1].height='0px';
tables[0+FT].height = "25px";
tables[0+FT].style.height = "25px";
tables[0+FT].style = "height: 25px;";
tables[1+FT].height = "25px";
tables[1+FT].style.height = "25px";
tables[1+FT].style = "height: 25px;";
var rows = tables[FT].getElementsByTagName("tr");
rows[0].height= "25px";
rows[0].style= "height:25px;";
var tcells = rows[0].getElementsByTagName("td");
tcells[0].height='25px';
//tcells[0].innerHTML = "Hello";
tcells[1].width='10%';
tcells[1].height='25px';
tcells[6].width='50%';
tcells[6].height='25px';
tcells[7].width='40%';
tcells[7].height='25px';
//tcells[8].height='25px';
tcells[1].style="background-color: black; text-align: Left;";
tcells[7].style="background-color: black; text-align: Right;";
tcells[1].innerHTML = "GOD ModeFarm Toy";
tcells[2].innerHTML = "";
tcells[3].innerHTML = "";
tcells[4].innerHTML = "";
tcells[5].innerHTML = "";
tcells[7].innerHTML = "P 1 ";
tcells[7].innerHTML += "P 10 ";
tcells[7].innerHTML += "P 20 ";
tcells[7].innerHTML += "P 30";
tcells[7].innerHTML += "P 40 ";
tcells[7].innerHTML += "P 50 ";
tcells[7].innerHTML += "P 60 ";
tcells[7].innerHTML += "P 70";
tcells[7].innerHTML += "P 80 ";
tcells[7].innerHTML += "P 90 ";
tcells[7].innerHTML += "P 100 ";
tcells[7].innerHTML += "P 110";
tcells[6].style="background-color: red;";
tcells[6].innerHTML = "";
tcells[6].innerHTML = "";
tcells[6].innerHTML += "";
tcells[6].innerHTML += "";
tcells[6].innerHTML += "";
tcells[6].innerHTML += "";
tcells[6].innerHTML += "";
tcells[6].innerHTML += "";
/*
var rows = tables[FT+2].getElementsByTagName("map");
var tcells = rows[0].getElementsByTagName("area");
tcells[1].innerHTML = "";
tcells[1].innerHTML += "Command Center";
tcells[2].innerHTML = "AttackFarm List";
tcells[3].innerHTML = "ArmoryMotherShip";
tcells[4].innerHTML = "Training";
// tcells[5].innerHTML = "Technology";
tcells[6].innerHTML = "Attack Log";
tcells[7].innerHTML = "Intelligence";
tcells[8].innerHTML = "Bank";
// tcells[8].innerHTML = "MarketBank";
*/
}
//new set
var rows = tables[FT+2].getElementsByTagName("tr");
var tcells = rows[0].getElementsByTagName("td");
////////////////////////////////////////////////////////
/////////////////clock time information ////////////////
////////////////////////////////////////////////////////
if(document.URL.indexOf("ascended") == -1){
var timer = tcells[4].innerHTML.split(":");
timer = timer[2].split(".");
timer = timer[0];
if(timer > -1 && timer <4){ tcells[6].style="background-color: red;"; }
if(timer > 3 && timer < 5){ tcells[6].style="background-color: blue;"; }
if(timer > 4 && timer < 34){ tcells[6].style="background-color: red;"; }
if(timer > 33 && timer < 36){ tcells[6].style="background-color: blue;"; }
if(timer > 34 && timer < 61){ tcells[6].style="background-color: red;"; }
//Click events on buttons soldier menu
document.getElementById("sabactive").onclick=function(){ sabtoggle(); }
document.getElementById("attackactive").onclick=function(){ attacktoggle(); }
document.getElementById("audioactive").onclick=function(){ audiotoggle(); }
document.getElementById("warlistfarmeractive").onclick=function(){ warlistfarmertoggle(); }
document.getElementById("autobankeractive").onclick=function(){ autobankertoggle(); }
document.getElementById("repairactive").onclick=function(){ repairtoggle(); }
document.getElementById("msactive").onclick=function(){ mstoggle(); }
//Grab the naq on hand details
var naqonhand;
for (var i = 0; i < tcells.length; i++) {
if(tcells[i].innerHTML.indexOf("Naquadah:") > -1) {
var naqonhand = tcells[i].innerHTML.replace(/\D/g,'');
}
}
}
///////////////////////////////////////////////////////////////
////////////////////Attack log back////////////////////////////
//////////////////////////////////////////////////////////////
if(document.URL.indexOf("attack.php") > -1){
if(document.body.innerHTML.indexOf("That realm still has an army retreating from their borders") > -1){
history.go(-1);
}
}
if(document.URL.indexOf("battlelog") > -1){
if(warlistfarmeractive == 1){
if(document.body.innerHTML.indexOf("Naquadah was taken from") > -1){
history.go(-1);
}
if(document.body.innerHTML.indexOf("That realm still has an army retreating from their borders") > -1){
history.go(-1);
}
}
if(warlistfarmeractive == 2){
if(document.body.innerHTML.indexOf("Naquadah was taken from") > -1){
history.go(-1);
}
if(document.body.innerHTML.indexOf("Untrained ware taken") > -1){
}
if(document.body.innerHTML.indexOf("That realm still has an army retreating from their borders") > -1){
history.go(-1);
}
}
if(attackactive == 1){
if(document.body.innerHTML.indexOf("Unassigned Spider ware") > -1 || document.body.innerHTML.indexOf("Untrained ware taken from") > -1 || document.body.innerHTML.indexOf("Untrained Military Peons ware taken") > -1 || document.body.innerHTML.indexOf("Untrained Jaffa ware taken") > -1 || document.body.innerHTML.indexOf("Untouched ware taken") > -1 || document.body.innerHTML.indexOf("General Drone ware taken") > -1 ){
history.go(-1);
}
if(document.body.innerHTML.indexOf("Naquadah was taken from") > -1){
history.go(-1);
}
}
if(warlistfarmeractive == 2){
if(document.body.innerHTML.indexOf("Unassigned Spider ware") > -1 || document.body.innerHTML.indexOf("Untrained ware taken from") > -1 || document.body.innerHTML.indexOf("Untrained Military Peons ware taken") > -1 || document.body.innerHTML.indexOf("Untrained Jaffa ware taken") > -1 || document.body.innerHTML.indexOf("Untouched ware taken") > -1 || document.body.innerHTML.indexOf("General Drone ware taken") > -1 ){
var parts = document.body.innerHTML.split("they were comfortable in their victory,and");
parts = parts[1].split("from the realm of");
var minuus = parts[0];
minuus = minuus.replace(/\D/g,'');
var knowuus = getCookie("raids");
var newuus = knowuus - minuus;
setCookie("raids",newuus,365);
history.go(-1);
}
}
if(warlistfarmeractive == 3){
var checker = getCookie("idchecker");
var checker = checker.split(":");
var checker = checker[0]+":no";
setCookie("idchecker",checker,365);
// setCookie("raids",uus,365);
history.go(-1);
}
}
///////////////////////////////////////////////////////////////
///////////////////Sab and Spy Log/////////////////////////////
///////////////////////////////////////////////////////////////
//Spy report to grab enemy covert
if(document.body.innerHTML.indexOf("Covert Mission Report") > -1){
if(document.body.innerHTML.indexOf("aware of your actions") == -1){
if(document.body.innerHTML.indexOf("Under the cover of night") > -1){
var enemcovert;
var enemydefense;
// alert("Meh");
for (var i = 43; i < tcells.length; i++) {
if(tcells[i].innerHTML.indexOf("Covert Action:") > -1) {
enemycovert = tcells[i+1].innerHTML.replace(/\D/g,'');
setCookie("enemycovert",enemycovert, 365);
// alert(enemycovert);
break;
}
}
for (var i = 42; i < tcells.length; i++) {
if(tcells[i].innerHTML.indexOf("Defensive Action") > -1) {
enemydefense = tcells[i+1].innerHTML.replace(/\D/g,'');
setCookie("enemydefense",enemydefense, 365);
// alert(enemydefense);
}
}
var uufinder;
var uufind;
//UUS should be located, a row below the mercenaries row, 4th cell
//Skipping first couple of rows, in order to skip a stray mercenaries word
for (var i = 20; i < rows.length; i++) {
if(rows[i].innerHTML.indexOf("Mercenaries") > -1 || rows[i].innerHTML.indexOf("bot") > -1) {
uufinder = rows[i + 1].getElementsByTagName("td");
//alert(uufinder[3].innerHTML);
uufind = uufinder[3].innerHTML;
break;
}
}
if(warlistfarmeractive == 3){
var checker = getCookie("idchecker");
var checker = checker.split(":");
if(enemydefense < unidefmax && enemydefense != "") {
var checker = checker[0]+":yes";
} else if (enemydefense == ""){
var checker = checker[0]+":no";
} else {
var checker = checker[0]+":hellno";
}
setCookie("idchecker",checker,365);
// setCookie("raids",uus,365);
// alert(checker);
}
if(warlistfarmeractive == 2){
if(uufind.indexOf("img") > -1){
var nums = uufind.split("display=");
var nums = nums[1].split('">');
var first10 = nums[0].substring(0,13);
if( first10 == "4c0e09154b265"){
var uus = 12000000;
} else { var uus = 9000000;}
} else { var uus = uufind.replace(/\D/g,''); }
if(uus != ""){
var checker = getCookie("idchecker");
var checker = checker.split(":");
var checker = checker[0]+":yes";
setCookie("idchecker",checker,365);
setCookie("raids",uus,365);
}
}
if(warlistfarmeractive == 2 || warlistfarmeractive == 3){
history.go(-1);
}
}
if(sabactive == 1){
history.go(-1);
}
}
}
/////////////////////////////////////////////////////
////////////////////Banking/////////////////////////
/////////////////////////////////////////////////////
if(document.body.innerHTML.indexOf("Secret and Secure Wealth Storage Area") > -1){
window.name ="bank";
document.forms["into_bank"].acceptCharset="utf-8";
document.forms["outof_bank"].acceptCharset="utf-8";
//Configs
var maxdelay = 200; //default max delay in milli seconds while autobanker is running, else its ~2,5 seconds
var maxdelayrandom = 300; //the extra randomness to the delay
if(warlistfarmeractive == 0){ var naqbank = 1; }
if(warlistfarmeractive == 1){ var naqbank = 1; }
if(warlistfarmeractive == 2){ var naqbank = 0; }
if(warlistfarmeractive == 3){ var naqbank = 1; }
for (var i = 0; i < tcells.length; i++) {
//do stuff
if(tcells[i].innerHTML.indexOf("Take Naquadah out of the Empire Stronghold") == 0) {
tcells[i].innerHTML =' || || || || || ';
break;
}
}
var inputs = document.getElementsByTagName('input');
var forms = document.getElementsByTagName('form');
//Check purchases traning
var getamount = getCookie("getamount");
//Check MS purchases
var getamountms = getCookie("getamountms");
//Check purchases weapons
var getamountw = getCookie("getamountw");
//Check witdrawls repairs
var getamountrepairs = getCookie("getamountrepairs");
//alert(getamountrepairs);
//alert(getamount);
var totwidth = 0;
if(getamount > 0){
if(naqonhand >= getamount){
setCookie("getamount", 0, 365);
document.body.innerHTML+='x';
document.getElementById('gotrain').click();
} else {
totwidth = parseInt(totwidth) + parseInt(getamount);
}
}
if(getamountms > 0){
if(naqonhand >= getamountms){
setCookie("getamountms", 0, 365);
document.body.innerHTML+='x';
document.getElementById('gomothership').click();
} else {
totwidth = parseInt(totwidth) + parseInt(getamountms);
}
}
if(getamountw > 0){
if(naqonhand >= getamountw){
setCookie("getamountw", 0, 365);
document.body.innerHTML+='x';
document.getElementById('gorepair').click();
} else {
totwidth = parseInt(totwidth) + parseInt(getamountw);
}
}
if(getamountrepairs > 0){
if(naqonhand >= getamountrepairs){
setCookie("getamountrepairs", 0, 365);
setCookie("fetching", 0, 365);
document.body.innerHTML+='x';
document.getElementById('gorepair').click();
} else {
totwidth = parseInt(totwidth) + parseInt(getamountrepairs);
}
}
// alert(getamountrepairs);
// alert(totwidth);
if(autobankeractive==1 && totwidth ==0 || autobankeractive==2 && totwidth ==0 && naqonhand > banking){
if(naqonhand > naqbank){
setTimeout(function(){
document.forms["into_bank"].elements[1].value = 999999999999999;
document.forms["into_bank"].elements["Deposit"].click();
}, Math.floor((Math.random()*maxdelayrandom)+maxdelay));
} else {
setTimeout(function(){
history.go(0);
}, Math.floor((Math.random()*1000)+3000));
}
} else if(totwidth > 0 && naqonhand < totwidth) {
document.forms["outof_bank"].elements[1].value = totwidth;
document.forms["outof_bank"].elements["Withdraw"].click();
} else if(totwidth > 0 && naqonhand > totwidth){
setTimeout(function(){
document.forms["into_bank"].elements[1].value = 999999999999999;
document.forms["into_bank"].elements["Deposit"].click();
}, Math.floor((Math.random()*500)+1000));
}
setTimeout(function(){
history.go(0);
}, Math.floor((Math.random()*800)+2000));
//Bank buttons withdrawl
document.getElementById('50b').onclick = function() { document.forms["outof_bank"].elements[1].value='50000000000'; document.forms["outof_bank"].elements["Withdraw"].click() }
document.getElementById('100b').onclick = function() {document.forms["outof_bank"].elements[1].value='300000000000'; document.forms["outof_bank"].elements["Withdraw"].click() }
document.getElementById('500b').onclick = function() { document.forms["outof_bank"].elements[1].value='500000000000'; document.forms["outof_bank"].elements["Withdraw"].click() }
document.getElementById('1T').onclick = function() { document.forms["outof_bank"].elements[1].value='1000000000000';document.forms["outof_bank"].elements["Withdraw"].click() }
document.getElementById('6T').onclick = function() { document.forms["outof_bank"].elements[1].value='6000000000000'; document.forms["outof_bank"].elements["Withdraw"].click() }
document.getElementById('60T').onclick = function(){ document.forms["outof_bank"].elements[1].value='60000000000000'; document.forms["outof_bank"].elements["Withdraw"].click() }
//document.forms["outof_bank"].elements[1].value = 100;
}
/////////////////////////////////////////////////
//////////////////Armory////////////////////////
/////////////////////////////////////////////////
/*
if(document.body.innerHTML.indexOf("Current Weapon Inventory") > -1){
window.name ="repairs";
var tcells = BuyWeaponsCells;
for (var i = 0; i < tcells.length; i++) {
//do stuff
if(tcells[i].innerHTML.indexOf("555,800") > -1) {
tcells[i].innerHTML =' || || || ';
}
if(tcells[i].innerHTML.indexOf("599,200") > -1) {
tcells[i].innerHTML =' || || || ';
break;
}
}
//Check purchases
var getamountw = getCookie("getamountw");
var getwhatw = getCookie("getwhatw");
var gethowmuchw = getCookie("gethowmuchw");
//alert(getamount);
//alert(getwhat);
//alert(gethowmuch);
if(getamountw == 0){
if(gethowmuchw > 0){
//
setCookie("gethowmuchw", 0, 365);
setTimeout(function(){
document.getElementsByName(getwhatw)[0].value= gethowmuchw;
// alert(inputs[getwhat].value);
// inputs[52].click();
document.getElementsByName("buybut")[0].click();
// alert(inputs[52].value);
}, 10);
}
}
document.getElementById('1ma').onclick = function() { if(naqonhand < 555800000000) { getCashw(555800000000, "buy_w6",1000000); } else { document.getElementsByName("buy_w6")[0].value= 1000000; document.getElementsByName("buybut")[0].click(); } }
document.getElementById('10ma').onclick = function() { if(naqonhand < 5558000000000) { getCashw(5558000000000, "buy_w6",10000000); } else { document.getElementsByName("buy_w6")[0].value= 10000000; document.getElementsByName("buybut")[0].click(); } }
document.getElementById('50ma').onclick = function() { if(naqonhand < 27790000000000) { getCashw(27790000000000, "buy_w6",50000000); } else { document.getElementsByName("buy_w6")[0].value= 50000000; document.getElementsByName("buybut")[0].click(); } }
document.getElementById('100ma').onclick = function() { if(naqonhand < 55580000000000) { getCashw(55580000000000, "buy_w6",100000000); } else { document.getElementsByName("buy_w6")[0].value= 100000000; document.getElementsByName("buybut")[0].click(); } }
document.getElementById('1md').onclick = function() { if(naqonhand < 599200000000) { getCashw(599200000000, "buy_dw5",1000000); } else { document.getElementsByName("buy_dw5")[0].value= 1000000; document.getElementsByName("buybut")[0].click(); } }
document.getElementById('10md').onclick = function(){ if(naqonhand < 5992000000000) { getCashw(5992000000000, "buy_dw5",10000000); } else { document.getElementsByName("buy_dw5")[0].value= 10000000; document.getElementsByName("buybut")[0].click(); } }
document.getElementById('50md').onclick = function() { if(naqonhand < 29960000000000) { getCashw(29960000000000, "buy_dw5",50000000); } else { document.getElementsByName("buy_dw5")[0].value= 50000000; document.getElementsByName("buybut")[0].click(); } }
document.getElementById('100md').onclick = function() { if(naqonhand < 59920000000000) { getCashw(59920000000000, "buy_dw5",100000000); } else { document.getElementsByName("buy_dw5")[0].value= 100000000; document.getElementsByName("buybut")[0].click(); } }
var waiting = 0;
//Check witdrawls repairs
var getamountrepairs = getCookie("getamountrepairs");
var fullcosts = 0;
var totamount = 0;
var totamountd = 0;
var fetching = getCookie("fetching");
totamount = 0;
if(document.getElementsByName("doallattrepair6")[0]){ totamount = document.getElementsByName("doallattrepair6")[0].value.replace(/,/g,'');}
fullcosts = fullcosts + totamount;
totamountd = 0;
if(document.getElementsByName("doalldefrepair5")[0]) { totamountd = document.getElementsByName("doalldefrepair5")[0].value.replace(/,/g,''); }
fullcosts = fullcosts + totamountd;
if(totamountd > 0){
//check for enabled audio alerts
if(audioactive == 1){
var zat = new Audio("http://dl.dropboxusercontent.com/u/7134196/zat.ogg");
zat.play();
}
}
// alert(maxattackdamage);
if(repairactive == 1){
if(totamount > maxattackdamage){
if(naqonhand < totamount && fetching == 0){
getCash(totamount,"attweps");
setCookie("fetching", 1, 365);
fetching = 1;
} else {
// inputs[i].form.acceptCharset="utf-8";
if(naqonhand > 0){
setCookie("fetching", 0, 365);
fetching = 0;
document.getElementsByName("atrepair6")[0].value =Math.floor(parseInt(naqonhand)/parseInt(document.getElementsByName("doatrepair")[0].value.replace(/,/g,'')));
document.getElementsByName("doatrepair")[0].click();
// document.getElementsByName("doallattrepair6")[0].click();
} else {
// history.go(0);
}
}
}
if(totamountd > maxdefensedamage){
if( naqonhand < totamountd && fetching == 0 ){
getCash(totamountd,"defweps");
setCookie("fetching", 1, 365);
fetching = 1;
} else {
setCookie("fetching", 0, 365);
fetching = 0;
document.getElementsByName("defrepair5")[0].value = Math.floor(parseInt(naqonhand)/parseInt(document.getElementsByName("dodefrepair")[0].value.replace(/,/g,'')));
totamountd = document.getElementsByName("dodefrepair")[0].click();
}
}
}
if(repairactive == 2){
if(totamount > maxattackdamage){
document.getElementsByName("doallattrepair6")[0].click();
}
if(totamountd > maxdefensedamage){
document.getElementsByName("doalldefrepair5")[0].click();
}
}
if(repairactive == 3){
if(totamountd > maxdefensedamage){
document.getElementsByName("doalldefrepair5")[0].click();
}
if(totamount > maxattackdamage){
document.getElementsByName("doallattrepair6")[0].click();
}
}
// alert(totamountd);
if(fetching == 1){
setTimeout(function(){
if(naqonhand == 0){
setCookie("fetching", 0, 365);
}
}, Math.floor((Math.random()* 1000)+ 2000));
}
setTimeout(function(){
history.go(0);
}, Math.floor((Math.random()* 1000)+ 4000));
}
*/
//////////////////////////////////////////////////
/////////////////FARMER///////////////////////////
//////////////////////////////////////////////////
if(document.body.innerHTML.indexOf("ENEMIES") > -1 && warlistfarmeractive != 3 && warlistfarmeractive != 4 ){
//Configs
var maxdelay = 100; //default max delay in milli seconds while repairs running, else its ~2,5 seconds
var maxdelayrandom = 900; //the extra randomness to the delay
var targetlist = getCookie("targetlist");
allrows = TargetTableCells;
var firstt = 13;
//alert(allrows[13].innerHTML);
if(warlistfarmeractive > 0){
var lastt = allrows.length; //300; //47;
//alert(lastt);
var curr = firstt;
while(curr <= lastt){
if (allrows[curr] && allrows[curr].innerHTML.length > 0) {
var ele = allrows[curr].innerHTML;
//alert(ele);
if(ele.indexOf("input") > 0){
var numb = (ele.match(/input/g) || []).length;
if(numb > 10){
if(allrows[curr+9].innerHTML.indexOf("img") != -1){
var nums = allrows[curr+9].innerHTML.split("display=");
var numss = nums[1].split('"');
var naq = numss[0];
var tablex = allrows[curr].getElementsByTagName("table");
var buts = tablex[0].getElementsByTagName("input");
// alert(buts[4].name);
// alert(buts[8].name);
// alert(buts[12].name);
var first10 = naq.substring(0,12);
var last4 = naq.substring(naq.length -4);
if(
//Disable lines here to increase the amount to hit for
// first10 == "4c0e09151752" && last4 == "154b" || //390b
// first10 == "4c0e0915105b" && last4 == "154b" || //400b
first10 == "4c0e09151752" && last4 == "154b" || //390b
first10 == "4c0e0915105b" && last4 == "154b" || //400b
first10 == "4c0e0915105a" && last4 == "154b" || //410b
first10 == "4c0e09151059" && last4 == "154b" || //420b
first10 == "4c0e09151058" && last4 == "154b" || //430b
first10 == "4c0e0915105f" && last4 == "154b" || //440b
first10 == "4c0e0915105e" && last4 == "154b" || //450b
first10 == "4c0e0915105d" && last4 == "154b" || //460b
first10 == "4c0e0915105c" && last4 == "154b" || //470b
first10 == "4c0e09151053" && last4 == "154b" || //480b
first10 == "4c0e09151052" && last4 == "154b" || //490b
first10 == "4c0e0915115b" && last4 == "154b" || //500b
first10 == "4c0e0915115a" && last4 == "154b" || //510b
first10 == "4c0e09151159" && last4 == "154b" || //520b
first10 == "4c0e09151158" && last4 == "154b" || //530b
first10 == "4c0e0915115f" && last4 == "154b" || //540b
first10 == "4c0e0915115e" && last4 == "154b" || //550b
first10 == "4c0e0915115d" && last4 == "154b" || //560b
first10 == "4c0e0915115c" && last4 == "154b" || //570b
first10 == "4c0e09151153" && last4 == "154b" || //580b
first10 == "4c0e09151152" && last4 == "154b" || //590b
first10 == "4c0e0915125b" && last4 == "154b" || //600b
first10 == "4c0e0915125a" && last4 == "154b" || //610b
first10 == "4c0e09151259" && last4 == "154b" || //620b
first10 == "4c0e09151258" && last4 == "154b" || //630b
first10 == "4c0e0915125f" && last4 == "154b" || //640b
first10 == "4c0e0915125e" && last4 == "154b" || //650b
first10 == "4c0e0915125d" && last4 == "154b" || //660b
first10 == "4c0e0915125c" && last4 == "154b" || //670b
first10 == "4c0e09151253" && last4 == "154b" || //680b
first10 == "4c0e09151252" && last4 == "154b" || //690b
first10 == "4c0e0915135b" && last4 == "154b" || //700b
first10 == "4c0e0915135a" && last4 == "154b" || //710b
first10 == "4c0e09151359" && last4 == "154b" || //720b
first10 == "4c0e09151358" && last4 == "154b" || //730b
first10 == "4c0e0915135f" && last4 == "154b" || //740b
first10 == "4c0e0915135e" && last4 == "154b" || //750b
first10 == "4c0e0915135d" && last4 == "154b" || //760b
first10 == "4c0e0915135c" && last4 == "154b" || //770b
first10 == "4c0e09151353" && last4 == "154b" || //780b
first10 == "4c0e09151352" && last4 == "154b" || //790b
first10 == "4c0e09151c5b" && last4 == "154b" || //800b
first10 == "4c0e09151c5a" && last4 == "154b" || //810b
first10 == "4c0e09151c59" && last4 == "154b" || //820b
first10 == "4c0e09151c58" && last4 == "154b" || //830b
first10 == "4c0e09151c5f" && last4 == "154b" || //840b
first10 == "4c0e09151c5e" && last4 == "154b" || //850b
first10 == "4c0e09151c5d" && last4 == "154b" || //860b
first10 == "4c0e09151c5c" && last4 == "154b" || //870b
first10 == "4c0e09151c53" && last4 == "154b" || //880b
first10 == "4c0e09151c52" && last4 == "154b" || //890b
first10 == "4c0e09151d5b" && last4 == "154b" || //900b
first10 == "4c0e09151d5a" && last4 == "154b" || //910b
first10 == "4c0e09151d59" && last4 == "154b" || //920b
first10 == "4c0e09151d58" && last4 == "154b" || //930b
first10 == "4c0e09151d5f" && last4 == "154b" || //940b
first10 == "4c0e09151d5e" && last4 == "154b" || //950b
first10 == "4c0e09151d5d" && last4 == "154b" || //960b
first10 == "4c0e09151d5c" && last4 == "154b" || //970b
first10 == "4c0e09151d53" && last4 == "154b" || //980b
first10 == "4c0e09151d52" && last4 == "154b" || //990b
last4 == "1548"){
buts[8].click();
// alert('target found img');
// alert('10:'+first10);
// alert('4:'+last4);
break;//
//throw new Error("timeout required");
}
} else {
var nums = allrows[curr+9].innerHTML;
var naq = nums.replace(/\D/g,'');
// alert(naq - 1);
var naq = naq - 1;
// var buts =allrows[curr].getElementsByTagName("input");
var tablex = allrows[curr].getElementsByTagName("table");
var buts = tablex[0].getElementsByTagName("input");
if(naq > takenaq){
buts[8].form.acceptCharset="utf-8";
//alert('target found text');
buts[8].click();
//break; //
throw new Error("timeout required");
}
}
if(warlistfarmeractive ==2){
var tempname = buts[8].name;
if(targetlist.indexOf(tempname) == -1){
var idcheck = buts[8].name;
var tempidcheck = idcheck+":yes";
var idchecker = getCookie("idchecker");
//Id is checked
if(tempidcheck == idchecker){
var raids = getCookie("raids");
//alert(raids);
if(raids > minraids) {
buts[12].form.acceptCharset="utf-8";
buts[12].click();
break; // throw new Error("timeout required");
// alert(buts[12].src);
// alert("over 9000!!!");
}
targetlist += buts[8].name+",";
setCookie("targetlist", targetlist, 365);
} else {
//set value to button:no, recon should change to button:yes, and set value for raiding
setCookie("idchecker", idcheck+":no", 365);
buts[4].form.acceptCharset="utf-8";
buts[4].click();
break; // throw new Error("timeout required");
}
}
}
}
}
}
curr++;
//curr++;
}
setTimeout(function(){
var links = document.getElementsByTagName("a");
var items = document.getElementsByTagName("a");
for (var i = 0; i < items.length; i++) {
if(items[i].text == "Next >>"){
setCookie("targetlist", "", 365);
items[i].click();
}
}
}, 2000);
} else {
setTimeout(function(){ history.go(0); }, 5000);
}
}
//////////////////////////////////////////////////
/////////////////UNIFARMER////////////////////////
/////////////////////////////////////////////////
if(warlistfarmeractive == 3 && document.URL.indexOf("battlefield.php") > -1){
//Dont touch the rest of the code
//Configs
var maxdelay = 100; //default max delay in milli seconds while repairs running, else its ~2,5 seconds
var maxdelayrandom = 100; //the extra randomness to the delay
var uniattack = 0;
//Dont touch the rest of the code
var targetlist = getCookie("targetlist");
var alltables = document.getElementsByTagName("table");
for (var i = 3; i < alltables.length; i++) {
if(alltables[i].innerHTML.indexOf("battlefieldE.php") > -1) {
var allrows = alltables[i].getElementsByTagName("tr");
// alert(alltables[i +1].innerHTML);
}
}
// alert(allrows[6].innerHTML);
var firstt = 6;
// alert(allrows[1].innerHTML);
if(warlistfarmeractive > 0){
/*
aaiimmmssggggiikkggeeesseeevnnyyyy
*/
var splitter = "nnbppbbjjjp";
var n0 = "ss";
var n1 = "aa";
var n2 = "cc";
var n3 = "eee";
var n4 = "gg";
var n5 = "ii";
var n6 = "kk";
var n7 = "mmm";
var n8 = "oo";
var n9 = "q";
//alert(alltables[17].innerHTML);
var lastt = allrows.length;//300; //47;
var curr = firstt;
while(curr <= lastt){
if (allrows[curr]) {
var ele = allrows[curr].innerHTML;
// alert(ele);
if(ele.indexOf("input") > -1){
var allcells = allrows[curr].getElementsByTagName("td");
var numb = allcells.length;
//alert(numb);
// alert(allcells[9].innerHTML);
if(numb > 8){
if(allcells[9].innerHTML.indexOf("img") != -1){
// alert(allcells[9].innerHTML);
var nums = allcells[9].innerHTML.split("display=");
var nums = nums[1].split('">');
/*
var n0 = "ss";
var n1 = "aa";
var n2 = "cc";
var n3 = "eee";
var n4 = "gg";
var n5 = "ii";
var n6 = "kk";
var n7 = "mmm";
var n8 = "oo";
var n9 = "q";
*/
var numss = nums[0].replace(/ss/g,'0');
var numss = numss.replace(/aa/g,'1');
var numss = numss.replace(/cc/g,'2');
var numss = numss.replace(/eee/g,'3');
var numss = numss.replace(/gg/g,'4');
var numss = numss.replace(/ii/g,'5');
var numss = numss.replace(/kk/g,'6');
var numss = numss.replace(/mmm/g,'7');
var numss = numss.replace(/oo/g,'8');
var numss = numss.replace(/q/g,'9');
var numss = numss.replace(/\D/g,'');
var naq = numss;
var naq = naq - 1;
// alert(naq);
var buts =allrows[curr].getElementsByTagName("input");
if(naq > takenaq){
// alert(naq);
uniattack = 1;
// buts[8].click();
// break;// throw new Error("timeout required");
}
} else {
var nums = allcells[9].innerHTML;
var naq = nums.replace(/\D/g,'');
// alert(naq - 1);
var naq = naq - 1;
var buts =allrows[curr].getElementsByTagName("input");
if(naq > takenaq){
buts[8].form.acceptCharset="utf-8";
uniattack = 1;
// alert(naq);
// buts[8].click();
// break; // throw new Error("timeout required");
}
}
//alert(uniattack);
var checking = getCookie("idchecker");
// alert(checking + "meh1");
if(warlistfarmeractive ==3 && uniattack == 1){
// alert("meh");
var tempname = buts[8].name;
if(targetlist.indexOf(tempname) == -1){
var idcheck = buts[8].name;
var tempidcheck = idcheck+":yes";
var idchecker = getCookie("idchecker");
//Id is checked
// alert(idchecker + "meh2");
if(tempidcheck == idchecker ){
// if(getCookie("takeit")) { var takeit = getCookie("takeit"); } else { var takeit = 0;}
//alert(raids);
var enemydefense = getCookie("enemydefense");
if(enemydefense < unidefmax && enemydefense != "") {
buts[8].form.acceptCharset="utf-8";
//alert("hitting ?");
buts[8].click();
throw new Error("timeout required");
// alert(buts[12].src);
// alert("over 9000!!!");
}
targetlist += buts[8].name+",";
setCookie("targetlist", targetlist, 365);
} else if(idchecker.indexOf("hellno") == -1) {
// alert(idchecker + "meh3");
//set value to button:no, recon should change to button:yes, and set value for raiding
setCookie("idchecker", idcheck+":no", 365);
buts[4].form.acceptCharset="utf-8";
buts[4].click();
throw new Error("timeout required");
}
// alert("meh1");
}
}
// alert("meh2");
}
}
}
curr++;
curr++;
}
setTimeout(function(){
var links = document.getElementsByTagName("a");
var items = document.getElementsByTagName("a");
for (var i = 0; i < items.length; i++) {
//do stuff
// items[i].innerHTML = "";
if(items[i].text == "Next >>"){
//clear target list for raiding
setCookie("targetlist", "", 365);
items[i].click();
}
}
}, Math.floor((Math.random()*1200)+3400));
} else {
setTimeout(function(){ history.go(0); }, 1000);
}
setTimeout(function(){ history.go(0); }, Math.floor((Math.random()*800)+5000));
}
////////////////////////////////////////////////////////////////////
//////////////////////////Trainer///////////////////////////////////
////////////////////////////////////////////////////////////////////
if(document.body.innerHTML.indexOf("Personnel") > -1){
if(document.body.innerHTML.indexOf("Training") > -1){
window.name="trainer";
//Configs
var maxdelay = 100; //default max delay in milli seconds while repairs running, else its ~2,5 seconds
var maxdelayrandom = 100; //the extra randomness to the delay
//Turn change rank trainer
var turnchange;
if(getCookie("turnchange")){turnchange = getCookie("turnchange");} else { turnchange = "no"; }
var correction = -27;
//Dont touch the rest of the code
var tcells = TrainTableCells;
//alert(tcells.innerHTML);
tcells[65 + correction].innerHTML += ' || || ';
tcells[68 + correction].innerHTML += ' || || ';
tcells[71 + correction].innerHTML += ' || || ';
tcells[74 + correction].innerHTML += ' || || ';
tcells[77 + correction].innerHTML += ' || || ';
tcells[80 + correction].innerHTML += ' || || ';
tcells[83 + correction].innerHTML += ' || || ';
correction--;
tcells[87 + correction].innerHTML = ' || || ';
tcells[90 + correction].innerHTML = ' || || ';
tcells[93 + correction].innerHTML = ' || || ';
tcells[96 + correction].innerHTML = ' || || ';
tcells[99 + correction].innerHTML = ' || || ';
//var inputs = document.getElementsByTagName('input');
//inputs[21].value = '100';
//Check purchases
var getamount = getCookie("getamount");
var getwhat = getCookie("getwhat");
//getwhat = parseInt(getwhat) - 6;
var gethowmuch = getCookie("gethowmuch");
//alert(getamount);
//alert(getwhat);
//alert(gethowmuch);
if(getamount == 0){
if(gethowmuch > 0){
//
setCookie("gethowmuch", 0, 365);
setTimeout(function(){
document.getElementsByName(getwhat)[0].value= gethowmuch;
// alert(inputs[getwhat].value);
// inputs[52].form.acceptCharset="utf-8";
document.getElementsByName('train')[0].click();
// alert(inputs[52].value);
}, 10);
}
}
//alert(tcells[43 + correction].innerHTML.replace(/\D/g,''));
document.getElementById('1a1m').onclick = function(){ if(naqonhand < 1500000000){ getCasht(1500000000, 'miner',1000000); } else { document.getElementsByName('miner')[0].value=1000000; document.getElementsByName('train')[0].click();; } }
document.getElementById('1a10m').onclick = function(){ if(naqonhand < 15000000000){ getCasht(15000000000, 'miner',10000000); } else { document.getElementsByName('miner')[0].value=10000000; document.getElementsByName('train')[0].click(); } }
document.getElementById('1a100m').onclick = function(){ if(naqonhand < 150000000000){ getCasht(150000000000, 'miner',99999999); } else { document.getElementsByName('miner')[0].value=99999999; document.getElementsByName('train')[0].click(); } }
document.getElementById('2a1m').onclick = function(){ if(naqonhand < 2000000000){ getCasht(2000000000, 'atsold',1000000); } else { document.getElementsByName('atsold')[0].value=1000000; document.getElementsByName('train')[0].click(); } }
document.getElementById('2a10m').onclick = function(){ if(naqonhand < 20000000000){ getCasht(20000000000, 'atsold',10000000); } else { document.getElementsByName('atsold')[0].value=10000000; document.getElementsByName('train')[0].click(); } }
document.getElementById('2a100m').onclick = function(){ if(naqonhand < 200000000000){ getCasht(200000000000, 'atsold',99999999); } else { document.getElementsByName('atsold')[0].value=99999999; document.getElementsByName('train')[0].click(); } }
document.getElementById('3a1m').onclick = function(){ if(naqonhand < 89000000000){ getCasht(89000000000, 'satsold',1000000); } else { document.getElementsByName('satsold')[0].value=1000000; document.getElementsByName('train')[0].click(); } }
document.getElementById('3a10m').onclick = function(){ if(naqonhand < 890000000000){ getCasht(890000000000, 'satsold',10000000); } else { document.getElementsByName('satsold')[0].value=10000000; document.getElementsByName('train')[0].click(); } }
document.getElementById('3a100m').onclick = function(){ if(naqonhand < 8900000000000){ getCasht(8900000000000, 'satsold',99999999); } else { document.getElementsByName('satsold')[0].value=99999999; document.getElementsByName('train')[0].click();} }
document.getElementById('4a1m').onclick = function(){ if(naqonhand < 2000000000){ getCasht(2000000000, 'defsold',1000000); } else { document.getElementsByName('defsold')[0].value=1000000; document.getElementsByName('train')[0].click(); } }
document.getElementById('4a10m').onclick = function(){ if(naqonhand < 20000000000){ getCasht(20000000000, 'defsold',10000000); } else { document.getElementsByName('defsold')[0].value=10000000; document.getElementsByName('train')[0].click(); } }
document.getElementById('4a100m').onclick = function(){ if(naqonhand < 200000000000){ getCasht(200000000000, 'defsold',99999999); } else { document.getElementsByName('defsold')[0].value=99999999; document.getElementsByName('train')[0].click(); } }
document.getElementById('5a1m').onclick = function(){ if(naqonhand < 89000000000){ getCasht(89000000000, 'sdefsold',1000000); } else { document.getElementsByName('sdefsold')[0].value=1000000; document.getElementsByName('train')[0].click();} }
document.getElementById('5a10m').onclick = function(){ if(naqonhand < 890000000000){ getCasht(890000000000, 'sdefsold',10000000); } else { document.getElementsByName('sdefsold')[0].value=10000000; document.getElementsByName('train')[0].click(); } }
document.getElementById('5a100m').onclick = function(){ if(naqonhand < 8900000000000){ getCasht(8900000000000, 'sdefsold',99999999); } else { document.getElementsByName('sdefsold').value=99999999; document.getElementsByName('train')[0].click(); } }
document.getElementById('6a1m').onclick = function(){ if(naqonhand < 3500000000){ getCasht(3500000000, 'spy',1000000); } else { document.getElementsByName('spy')[0].value=1000000; document.getElementsByName('train')[0].click();} }
document.getElementById('6a10m').onclick = function(){ if(naqonhand < 35000000000){ getCasht(35000000000, 'spy',10000000); } else { document.getElementsByName('spy')[0].value=10000000; document.getElementsByName('train')[0].click(); } }
document.getElementById('6a100m').onclick = function(){ if(naqonhand < 350000000000){ getCasht(350000000000, 'spy',99999999); } else { document.getElementsByName('spy')[0].value=99999999; document.getElementsByName('train')[0].click(); } }
document.getElementById('7a1m').onclick = function(){ if(naqonhand < 5500000000){ getCasht(5500000000, 'spykiller',1000000); } else { document.getElementsByName('spykiller')[0].value=1000000; document.getElementsByName('train')[0].click(); } }
document.getElementById('7a10m').onclick = function(){ if(naqonhand < 55000000000){ getCasht(55000000000, 'spykiller',10000000); } else { document.getElementsByName('spykiller')[0].value=10000000; document.getElementsByName('train')[0].click(); } }
document.getElementById('7a100m').onclick = function(){ if(naqonhand < 550000000000){ getCasht(550000000000, 'spykiller',99999999); } else { document.getElementsByName('spykiller')[0].value=99999999; document.getElementsByName('train')[0].click(); } }
document.getElementById('1d1m').onclick = function(){ document.getElementsByName('reminer')[0].value='1000000'; document.getElementsByName('train')[1].click(); }
document.getElementById('1d10m').onclick = function(){ document.getElementsByName('reminer')[0].value='10000000'; document.getElementsByName('train')[1].click(); }
document.getElementById('1d100m').onclick = function(){ document.getElementsByName('reminer')[0].value='99999999';document.getElementsByName('train')[1].click(); }
document.getElementById('2d1m').onclick = function(){ document.getElementsByName('reat')[0].value='1000000'; document.getElementsByName('train')[1].click(); }
document.getElementById('2d10m').onclick = function(){ document.getElementsByName('reat')[0].value='10000000'; document.getElementsByName('train')[1].click(); }
document.getElementById('2d100m').onclick = function(){ document.getElementsByName('reat')[0].value='99999999'; document.getElementsByName('train')[1].click(); }
document.getElementById('3d1m').onclick = function(){ document.getElementsByName('redef')[0].value='1000000'; document.getElementsByName('train')[1].click(); }
document.getElementById('3d10m').onclick = function(){ document.getElementsByName('redef')[0].value='10000000'; document.getElementsByName('train')[1].click(); }
document.getElementById('3d100m').onclick = function(){ document.getElementsByName('redef')[0].value='99999999';document.getElementsByName('train')[1].click(); }
document.getElementById('4d1m').onclick = function(){ document.getElementsByName('respy')[0].value='1000000'; document.getElementsByName('train')[1].click(); }
document.getElementById('4d10m').onclick = function(){ document.getElementsByName('respy')[0].value='10000000'; document.getElementsByName('train')[1].click(); }
document.getElementById('4d100m').onclick = function(){ document.getElementsByName('respy')[0].value='99999999'; document.getElementsByName('train')[1].click(); }
document.getElementById('5d1m').onclick = function(){ document.getElementsByName('respykiller')[0].alue='1000000'; document.getElementsByName('train')[1].click(); }
document.getElementById('5d10m').onclick = function(){ document.getElementsByName('respykiller')[0].value='10000000'; document.getElementsByName('train')[1].click(); }
document.getElementById('5d100m').onclick = function(){ document.getElementsByName('respykiller')[0].value='99999999'; document.getElementsByName('train')[1].click(); }
var rank = tcells[13].innerHTML.replace(/\D/g,'');
//alert(rank);
// alert(turnchange);
// alert(inputs[71].value);
if(turnchange=="yes" && rank < 3000 ){
for (var i = 30; i < 50; i++) {
if(tcells[i].innerHTML.indexOf("Covert Ops") > -1) {
var untrainer = tcells[i + 1].innerHTML.replace(/\D/g,'');
}
}
//alert(untrainer);
if(untrainer > 0){
inputs[71].value=untrainer;
inputs[77].click();
}
setCookie("turnchange", "go", 365);
} else
if(turnchange=="go" ){
if(rank > 3000){
for (var i = 30; i < 50; i++) {
if(tcells[i].innerHTML.indexOf("Untrained") > -1 && tcells[i].innerHTML.indexOf("Mercenaries") == -1) {
var newtrainer = tcells[i + 1].innerHTML.replace(/\D/g,'');
}
}
if(newtrainer > 0){
getCash((3500*newtrainer), 40,newtrainer);
setCookie("turnchange", "no", 365);
} else { alert("no units");} setCookie("turnchange", "no", 365);
} else {
setTimeout(function(){ location.reload(); }, Math.floor((Math.random()*3000)+5000));
}
} else
if(warlistfarmeractive==2 && gethowmuch ==0 && turnchange =="no"){
var newuus = tcells[43 + correction].innerHTML.replace(/\D/g,'');
if(newuus > 1000000){
getCasht(1500000000, 20,1000000);
} else {
setTimeout(function(){ location.reload(); }, Math.floor((Math.random()*3000)+5000));
}
}
setTimeout(function(){ location.reload(); }, Math.floor((Math.random()*3000)+7000));
}
}
///////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////MotherShip/////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////
if(document.body.innerHTML.indexOf("MotherShip Maintenance") > -1){
window.name="mothership2.php";
var input = document.getElementsByTagName("input");
var tds = document.getElementsByTagName("td");
var havevol = parseInt(tds[29].innerHTML.replace(/,/g,""));
var maxvol = parseInt(tds[31].innerHTML.replace(/,/g,""));
var havesh = parseInt(tds[33].innerHTML.replace(/,/g,""));
var maxsh = parseInt(tds[35].innerHTML.replace(/,/g,""));
var volspace = maxvol - havevol;
var shspace = maxsh - havesh;
var volprice = volspace * 2100800;
var shprice = shspace * 2250000;
var totprice = volprice+shprice;
input[25].value=volspace;
input[26].value=shspace;
if(msactive==1){
var getamountms = getCookie("getamountms");
if(getamountms > 0){
if(naqonhand < totprice){
getCashms(totprice,0);
}
else if(naqonhand >= totprice){
setCookie("getamountms", 0, 365);
input[28].click();
}
setTimeout(function(){ history.go(0); }, Math.floor((Math.random()*1000)+1500));
} else {
if(naqonhand < totprice){
getCashms(totprice,0);
} else if(totprice >0) {
input[28].click();
}
setTimeout(function(){ history.go(0);}, Math.floor((Math.random()*800)+3000));
}
} else if(msactive==2){
setTimeout(function(){ input[28].click(); }, Math.floor((Math.random()*800)+1000));
} else {
setTimeout(function(){ history.go(0); }, Math.floor((Math.random()*800)+4000));
}
}
//////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////Auto Attacker////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////
if(document.URL.indexOf("attack.php?id=") > -1){
document.getElementsByName("attackbut")[0].onclick="document.attack.attackbut.value='Attacking..'; document.attack.attackbut.disabled=false; document.attack.submit();";
if(attackactive == 1){
document.getElementsByName("attacks")[0].value = 15;
document.attack.submit();
}
}
/*
////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////Ascended repairs/////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////
if(document.URL.indexOf("ascended.gatewars.com/armory.php") > -1){
setTimeout(function(){
if(document.getElementsByName("1doallattrepair6")[0] && parseInt(document.getElementsByName("1doallattrepair6")[0].value) > 0) { document.getElementsByName("1doallattrepair6")[0].click(); } else
if(document.getElementsByName("1doalldefrepair5")[0] && parseInt(document.getElementsByName("1doalldefrepair5")[0].value) > 0) { document.getElementsByName("1doalldefrepair5")[0].click(); } else
{ history.go(0); }
}, Math.floor((Math.random()*800)+4000));
// alert(parseInt(document.getElementsByName("1doallattrepair6")[0].value));
}
/////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////Ascended CS builder//////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////
*/