NOTICE: By continued use of this site you understand and agree to the binding Terms of Service and Privacy Policy.
// ==UserScript== // @name ogamex-carto // @namespace http://tampermonkey.net/ // @version 0.8.7 // @description Carto ogamex.net // @author Jobijoba // @include *.ogamex.net/* // @grant GM_addStyle //@require http://code.jquery.com/jquery-3.4.1.min.js // @updateURL https://openuserjs.org/meta/jobijoba/ogamex-carto.meta.js // @downloadURL https://openuserjs.org/install/jobijoba/ogamex-carto.user.js // @copyright 2021, Jobijoba // @license MIT // ==/UserScript== (function() { 'use strict'; var v = '0.7'; var href = window.location.href; var uni = href.split('https://')[1].split('.ogamex.net')[0]; const date = new Date() var gmt = date.getTimezoneOffset(); //console.log(gmt); function intFormatc(str){ return parseInt(str.replace(/\./g,'')); } function strFormatc(number){ return number.toLocaleString(["ban", "id"]); } function unic(){ var href = window.location.href; var uni = href.split('https://')[1].split('.ogamex.net')[0]; return uni; } function playerClick(){ $(document).on('click','.col-player .text-area, .col-alliance .text-area',function(){ var type; var id; if($(this).parent().hasClass('col-player')){ type = 'player'; id = $(this).parent().html().split('statistics?rel=')[1].split("'>")[0]; $('#tooltip-sticky-container').css('display','none'); } if($(this).parent().hasClass('col-alliance')){ type = 'alliance'; id = $(this).parent().html().split('allianceId=')[1].split("'")[0]; $('#tooltip-sticky-container').css('display','none'); } carto(type,id); }); } function carto(type,id){ var href2 = href.split('ogamex.net/')[1]; var containerOgx = '.content-section'; if(href2.indexOf('home') != -1 || href2 == ''){ containerOgx = '#overview-container'; } if(href2.indexOf('galaxy') != -1){ containerOgx = '#galaxy-container'; } if(href2.indexOf('jumpgate') != -1){ $('<div id="buildings-container">').prependTo('#content-wrapper'); containerOgx = '#buildings-container'; } $(containerOgx).html('') var contents = ''; contents += '<div class="carto">'; contents += '<div class="titre">'; contents += '<div class="titre_2">Ogamex Carto</div>'; contents += '<div class="titresmall">v'+v+'</div>'; contents += '<div class="left">>'; contents += '<span class="" id="btn-tools"><i class="fas fa-tools"></i>Tools</span>'; contents += '<span class="" id="btn-liste"><i class="fas fa-list"></i>Lists</span>'; contents += '</div>'; contents += '<div class="right">'; contents += '<input id="search" type="text" size="16" placeholder="search player / alliance">'; contents += '</div>'; contents += '<div class="clear"></div>'; contents += '</div>'; contents += '<div id="contenu"></div>'; contents += '</div>'; $('<div id="coontainer-carto">').appendTo(containerOgx).html(contents); $('#contenu').html('<i style="font-size:100px; display:block; text-align: center; padding: 100px 20px; opacity: 0.7;" class="fas fa-spinner fa-spin"></i>'); if(type == 'alliance' || type == 'player'){ display(type,id); } if(type == 'tools'){ tools(); } $(document).on('click','td a.display',function(){ var id = $(this).attr('data-id'); var type = $(this).attr('data-type'); $('.player .left').html('<i style="font-size:100px; display:block; text-align: center; padding: 100px 20px; opacity: 0.7;" class="fas fa-spinner fa-spin"></i>'); display(type,id); }); $('#btn-scan').click(function(){ scan(); $('.titre span').removeClass('pageActive'); $(this).addClass('pageActive'); }); $('#btn-tools').click(function(){ tools(); }); $('#btn-liste').click(function(){ liste(); }); $(document).on('keyup','#search',function(){ var search = $(this).val(); liste(search); }); } function display(type,id){ var myPlayerId = $('head').html().split("window.currentPlayerId = '")[1].split("';")[0]; var post = 'type='+type+'&id='+ id+'&mypid='+myPlayerId+'&gmt='+gmt; //console.log(myPlayerId); $.post("https://www.fedbac.fr/ogx_search-v"+v+".php", post, function(json){ //console.log(json); if(json == 'no'){ var html = '<div style="line-height: 1.5em; font-size: 15px;">Accès restreint !<br />'; html += "Communique ton ID suivant à qui tu sais<br />"; html += myPlayerId; html += "</div>"; }else{ var data = JSON.parse(json); //console.log(data); var planetsData = data.planetsData; var playersData = data.playersData; var spyData = data.spyData; //console.log(spyData); if(spyData.length == 0){ console.log('vide') } var html = ''; html += '<div class="player">'; html += '<div class="left">'; html += '<div class="section">'; html += '<div class="titre_section">'; if(type == 'player'){ html += planetsData[0].name; } html += ' ['+ planetsData[0].alliance +'] | '+planetsData.length+' planets</div>'; html += '<table>'; html += planetList(planetsData); html += '</table>'; html += '</div>'; if(type == 'player'){ html += '<div class="section">'; html += '<div class="titre_section">'; html += 'Espionage action | '+spyData.spyNb; html += '</div>'; html += '<table>'; var width = 0; var max = 0; //console.log(spyData.spyList); for(var i = 0; i < 24; i++){ //console.log(spyData.spyList[i]) if(max < parseInt(spyData.spyList[i])){ max = parseInt(spyData.spyList[i]); } } //console.log(max) for(i = 0; i < 24; i++){ width = parseInt(parseInt(spyData.spyList[i]) / parseInt(max) * 80) html += '<tr>'; html += '<td style="width:5%">'+i+'h</td>'; html += '<td style="text-align: left; width:75%"><div style="border:1px solid #ccc; height: 15px; width:'+width+'%; background-color: #ccc;"></div> '+spyData.spyList[i]+'</td>'; html += '</tr>'; } html += '</table>'; html += '</div>'; } html += '</div>'; html += '<div class="right">'; html += '<div class="section">'; html += '<div class="titre_section">Alliance Members</div>'; html += '<table>'; var active = ''; if(type == 'alliance'){ active = 'active'; } html += '<tr><td class="'+active+' membersList">'; html += '<a style="display:block; cursor: pointer;" class="display alliance" href="#" data-id="'+planetsData[0].alliance_id+'" data-type="alliance" onclick="return false;">'+planetsData[0].alliance+' ('+playersData.length+')</a>'; html += '</td></tr>'; for(var i = 0; i < playersData.length; i++){ active = ''; var d = playersData[i]; if(planetsData[0].player_id == d.player_id && type == 'player'){ active = 'active'; } html += '<tr><td class="'+active+' membersList"><a style="display:block; cursor: pointer;" class="display player" href="#" data-id="'+d.player_id+'" data-type="player" onclick="return false;">'+d.name+'</a></td></tr>'; } html += '</table>'; html += '</div>'; html += '</div>'; html += '<div style="clear: both;"></div>'; html += '</div>'; } $('#contenu').html(html); }, "text"); } function planetList(data){ var d = ''; var coord = ''; var html =''; for(var i = 0; i < data.length; i++){ d = data[i]; coord = d.galaxy +':'+ d.system +':'+ d.position; d.planet_id = "'"+d.planet_id+"'"; html += '<tr>'; html += '<td><a href="/galaxy?x='+d.galaxy+'&y='+d.system+'">'+coord+'</a></td>'; if(d.moon > 0){ d.moon = '<a href="#" onClick="SendSpy('+d.galaxy+','+d.system+','+d.position+' ,2,false); return false;"><div class="moon"></div><div></a>' + d.moon.toLocaleString(["ban", "id"]) + ' km</div>'; }else{ d.moon = ''; } var ida = "'"+d.alliance_id+"'"; html += '<td>'+d.moon+'</td>'; html += '<td><a class="display player" href="#" data-id="'+d.player_id+'" data-type="player" onclick="return false;">'+d.name+'</a></td>'; html += '<td><a class="display alliance" href="#" data-id="'+d.alliance_id+'" data-type="alliance" onclick="return false;">'+d.alliance+'</a></td>'; html += '<td><a href="#" class="btnActionSavePlanet" onClick="SavePlanet('+d.planet_id+'); return false;"></a></td>'; html += '<td><a href="#" class="btnActionSpy" onClick="SendSpy('+d.galaxy+','+d.system+','+d.position+' ,1,false); return false;"></a></td>'; html += '</tr>'; } return html; } function tools(){ $('.titre span').removeClass('pageActive'); $('#btn-tools').addClass('pageActive'); $('#contenu').html('Page Tools'); } function liste(search = ''){ $('.titre span').removeClass('pageActive'); $('#btn-liste').addClass('pageActive'); var post = 'type=liste&universe='+uni+'&search='+search; $.post("https://www.fedbac.fr/ogx_search-v"+v+".php", post, function(json){ //console.log(JSON.parse(json)); var plist = JSON.parse(json).players_list; var alist = JSON.parse(json).alliances_list; //console.log(plist) var page = 1; var html = ""; html += '<div class="scan">'; html += '<div class="section players-list" id="players-list">'; html += lst(plist,page) html += '</div>'; html += '<div class="section alliances-list" id="alliances-list">'; html += lst(alist,page) html += '</div>'; html += '</div>'; $('#contenu').html(html); $(document).on('click','.fas',function(){ page = $(this).attr('data-page'); if($(this).parent().parent().hasClass('players-list')){ $(this).parent().parent().html(lst(plist,page)) } if($(this).parent().parent().hasClass('alliances-list')){ $(this).parent().parent().html(lst(alist,page)) } }); $(document).on('click','#players-list li a',function(){ var id = $(this).attr('data-id'); carto('player',id) }); $(document).on('click','#alliances-list li a',function(){ var id = $(this).attr('data-id'); carto('alliance',id) }); }); } function lst(list, page){ var nbPerPage = 36; var start = (page-1)*nbPerPage; var end = start + nbPerPage; var prev = parseInt(page) - 1; var next = parseInt(page) + 1; var html = ""; html += '<div class="pagination" style="text-align: center;">'; html += '<i data-page="'+prev+'" class="fas fa-angle-left"></i>'; html += '<span>'+page+'</span>'; html += '<i data-page="'+next+'" class="fas fa-angle-right"></i>'; html += '</div>'; html += '<ul>'; for(var i = start; i < end; i++){ if(i < list.length && list[i].name != ''){ html += '<li><a href="#" data-id="'+list[i].cle+'" onclick="return false;">'+list[i].name+'</a></li>'; } } html += '</ul>'; return html; } function cssStyle(){ GM_addStyle(` .carto .left{ float: left; } .carto .right{ float: right; } .carto .clear{ clear: both; } .carto tr:nth-of-type(odd){ background-color: #242b36; } .carto tr:nth-of-type(even){ background-color: #0D0E10; } .carto tr:hover, .section div.titre_section span:hover{ background-color: #424851; } .carto .titre{ position: relative; text-align: left; margin-bottom: 20px; font-size: 16px; color: #888; } .carto .titre .titre_2{ color:white; text-align:center; padding: 30px 0px; font-size: 24px; font-weight: bold; } .carto .titre span{ cursor: pointer; font-size: 20px; margin-right: 40px; } .carto .titre span i{ margin-right:3px; font-size: 30px; } .carto .titre span:hover{ color: white; } .carto .titre input[type=text]{ font-size: 14px; color: #ddd; padding: 6px; background-color: #333; border: 1px solid #888; } .carto .titre input[type=text]:focus{ background-color: #555; } .carto .titre input::placeholder{ color: #aaa; } .carto .titre .pageActive{ color: #ddd;; } .carto .titresmall{ position: absolute; right: 0px; top:0px; padding: 0px 0px 15px 0px; font-size: 10px; color: #aaa; } .carto .player .left{ width: 69%; } .carto .player .right{ width: 29%; } .carto{ background-color: #000; color: #ddd; font-size: 11px; border: 4px solid #2B3F5A; padding: 10px; margin: 20px; } .carto table{ width: 100%; } .carto tr{ //border-top: 1px solid #424851; //border-bottom: 1px solid #424851; } .carto td{ padding: 8px; vertical-align: middle; width: 110px; text-align: right; } .carto .classement td{ padding: 8px 4px; vertical-align: middle; text-align: center; } .carto .classement td:nth-of-type(1){ width: 15px; } .carto .classement td:nth-of-type(2){ width: 100px; } .carto .classement td:nth-of-type(3),.classement td:nth-of-type(4){ width: 20px; } .carto .stats td:first-of-type{ padding-right: 0px; width: 0px; text-align: left; color: #2f2; } .carto .section{ margin-bottom: 15px; border: 3px solid #424851; } .carto .section div.titre_section{ width: 100%; color: #ddd; font-size: 14px; padding: 12px 0px; position: relative; text-align: center; background-color: #131a25; border-bottom: 2px solid #666; } .carto .section div.titre_section span{ position: absolute; top: 0; padding: 15px 7px; height: 100%; z-index: 1000; cursor: pointer; } .carto .section div.titre_section span:nth-of-type(1){ left: 0px; border-right: 1px solid #424851; } .carto .section div.titre_section span:nth-of-type(2){ right: 0px; border-left: 1px solid #424851; } .carto .player td{ text-align: center; //border: 1px solid white; vertical-align: center; } .carto .player td:nth-of-type(1){ width: 17%; } .carto .player td:nth-of-type(2){ padding:0; width: 25%; } .carto .player td:nth-of-type(5){ text-align: right; width: 5%; } .carto .player td:nth-of-type(5) a{ background: url(../../assets/images/V2/galaxy-icon-kit.gif?v=5) -178px 0px no-repeat; width: 16px; height: 16px; display: inline-block; } .carto .player td:nth-of-type(6){ text-align: right; width: 5%; } .carto .player td:nth-of-type(6) a{ background: url(../../assets/images/V2/galaxy-icon-kit.gif?v=5) -83px 0px no-repeat; width: 16px; height: 16px; display: inline-block; } .carto .player td:nth-of-type(2) div.moon:nth-of-type(1){ background: url(../../assets/images/V2/planet/moon/1/1_small.jpg) no-repeat; width: 22px; height: 22px; background-size: contain; display: inline-block; border-radius: 11px; } .carto .player td:nth-of-type(2) div:nth-of-type(2){ padding: 0px 10opx; font-style: italic; color: #aaa; } .carto .player td:nth-of-type(2) div{ vertical-align: middle; display: inline-block; //border: 1px solid white; } .carto .player td a{ color: #ccc; font-weight: bold; text-decoration: none; } .carto .player td a:hover{ text-decoration: underline; } .player td a:hover{ color: #fff; } .carto .player td.active{ background-color: #777; } .carto .player td.active a{ color: #fff; } .carto .player td.membersList{ padding: 0; } .carto .player td.membersList a{ padding: 12px 8px; } .carto .btn{ border: none; color: #fff; padding: 10px 15px; font-size: 13px; transition-duration: 0.3s; font-weight: bold; //border-radius: 20px; cursor: pointer; } .carto .btn-green{ background-color: green; } .carto .btn-red{ background-color: red; } .carto .btn-red:hover{ background-color: #B22222; } .carto p{ padding: 5px 0px; } .carto .scan .section{ padding: 10px; } .carto li{ padding: 5px 0px; } .carto li a{ color: #ccc; text-decoration: none; } .carto li a:hover{ color: #fff; text-decoration: underline; } .carto ul{ column-count: 4; } .carto .pagination .fas{ padding: 10px; cursor: pointer; font-size: 18px; color: #888; } .carto .pagination .fas:hover{ color: #afffaa; } .carto .pagination span{ padding: 10px; font-size: 12px; } .carto p{ line-height: 1.7em; } .carto .alert{ background: red; color: yellow; font-weight: bold; border: 5px solid yellow; font-size: 13px; font-family: Arial; line-height: 1.4em; font-size: 20px; padding: 10px; text-align: center; margin-top: 20px; } .message-item div{ //display: none; } .ogx-spy{ margin-left: 6.99px; //border: 1px solid #fff; padding: 7px 0px; } .ogx-spy a, .ogx-spy i, .ogx-spy span{ padding: 10px; } .ogx-spy a.ogx-spy-plunder{ display: inline-block; font-weight: bold;; color: #222; text-decoration: none; background-color: orange; padding: 6px; border-radius: 5px; border: 1px solid orange; //margin-top: 15px; } .ogx-spy a.ogx-spy-plunder:hover{ color: #fff; background-color: #a60; cursor: pointer; } `); } function tps(start){ var ogx_d = new Object(); ogx_d.h = new Date(start).getHours(); if(ogx_d.h < 10){ ogx_d.h = '0'+ogx_d.h; } ogx_d.m = new Date(start).getMinutes(); if(ogx_d.m < 10){ ogx_d.m = '0'+ogx_d.m; } ogx_d.s = new Date(start).getSeconds(); if(ogx_d.s < 10){ ogx_d.s = '0'+ogx_d.s; } ogx_d.time = ogx_d.h+':'+ogx_d.m+':'+ogx_d.s; //console.log(ogx_d); return ogx_d.time; } function galaxyScan(){ var _wr = function(type) { var orig = history[type]; return function() { var rv = orig.apply(this, arguments); var e = new Event(type); e.arguments = arguments; window.dispatchEvent(e); return rv; } }; history.pushState = _wr('pushState'), history.replaceState = _wr('replaceState'); window.addEventListener('replaceState', function(e) { var href = window.location.href; var x= parseInt(href.split('x=')[1]); var y= parseInt(href.split('y=')[1]); $(document).on('click','#displayina',function(){ var options; if(localStorage.ogx_options){ options = localStorage.ogx_options; options = JSON.parse(options); if(options.ina){ if(options.ina == 'oui'){ options.ina = 'non'; }else{ options.ina = 'oui'; } }else{ options.ina = 'non'; } }else{ options = new Object(); options.ina = 'oui'; } localStorage.ogx_options = JSON.stringify(options); window.location.reload(false); }); galaxyParse($('.galaxy-content').html(),x,y); }); } function galaxyParse(data,x,y){ if(localStorage.ogx_options){ var options = localStorage.ogx_options var ina = JSON.parse(options).ina; }else{ var ina = 'non'; } var scan = false; var post = new Object(); post.universe = href.split('https://')[1].split('.ogamex.net')[0]; post.galaxy = x; post.system = y; var lines = ''; for(var i = 1; i < 16; i++){ post['p'+i] = new Object(); lines = $(data).find('.galaxy-item:eq('+i+')'); if(lines.hasClass('filterEmpty') === true){ post['p'+i].position = i; post['p'+i].planet = ''; post['p'+i].planet_id = '0'; post['p'+i].moon = '0'; post['p'+i].player = ''; post['p'+i].player_id = ''; post['p'+i].alliance = ''; post['p'+i].alliance_id = ''; }else{ post['p'+i].position = lines.find('.planet-index').html(); post['p'+i].planet = lines.find('.col-planet-name .text-area').html().trim(); if(post['p'+i].planet.indexOf('<a') != -1){ post['p'+i].planet = post['p'+i].planet.split('<a')[0].trim().replace(/\"/g,''); } post['p'+i].planet_id = lines.find('.col-action').html(); if(post['p'+i].planet_id.trim() != ''){ post['p'+i].planet_id = post['p'+i].planet_id.split("SavePlanet('")[1].split("')")[0] }else{ post['p'+i].planet_id = '0'; } post['p'+i].player = lines.html().split("top:6px;float:left;'>")[1].split('</span>')[0]; post['p'+i].player_id = lines.html().split('statistics?rel=')[1].split("'>")[0]; post['p'+i].classement = lines.html().split("href='/statistics?rel=")[1].split("'>")[1].split("</a>")[0]; post['p'+i].alliance = lines.find('.col-alliance .text-area').html(); //console.log(post['p'+i].classement) $('<span style="font-weight: bold; font-size: 9px; color: yellow; font-style: italic">').appendTo($('.galaxy-item:eq('+i+') .col-player')).html(' '+post['p'+i].classement) if(localStorage.ogx_options){ if(ina == 'oui'){ displayIna(i) } } if(post['p'+i].alliance != undefined){ post['p'+i].alliance_id = lines.html().split('allianceId=')[1].split("'")[0]; }else{ post['p'+i].alliance_id = ''; post['p'+i].alliance = ''; } if(lines.find('.col-moon').html().trim() != ''){ post['p'+i].moon = lines.find('.col-moon').html().split("float:left;width:100%;margin-top:6px;'>")[1].split(' km<')[0].replace('.',''); }else{ post['p'+i].moon = '0'; } } } /* if($(data).find('.galaxy-item:eq(17)').html() != undefined){ console.log(post.galaxy+':'+post.system+' - '+$(data).find('.galaxy-item:eq(17)').text().split('(')[1].split(')')[0].trim()) } */ //console.log(post.universe+' | '+post.galaxy+':'+post.system+' -> '+tps(Date.now())) //console.log(post); $.post("https://www.fedbac.fr/ogx_scan-v"+v+".php", post, function(json){ if(json != ''){ //console.log(json); } }, "text"); $('#galaxy-container .isInactive7').attr('style', 'color: #888 !important'); $('#galaxy-container .isInactive28').attr('style', 'color: #777 !important'); } function addMenuButton(){ $('<div class="menu-item">').appendTo('#left-menu-1'); $('div.menu-item:last-of-type').html('<a id="btn-carto" href="#" class="text-item">Carto</a>'); $('#btn-carto').click(function(e){ e.preventDefault(); false; $('div.menu-item').removeClass('active'); $(this).parent().addClass('active'); carto('tools',''); }); } function refreshPhal(){ $(document).on('click','.fa-satellite-dish',function(){ var h = $(this).parent().html().split('<a')[1]; h = '<a'+h; $('.phal').html('') $('.heure').html('') //console.log(h); $('<div style="font-size: 13px; position: absolute; top: 17px; left: 125px; color: white;" class="heure">').prependTo('.modal__header').html($('#system-clock').html()); var phal = setTimeout(function(){ $('<div style="position: absolute; top: 10px; left: 250px;" class="phal">').prependTo('.modal__header').html(h) $('.phal .fas').css('font-size','16px'); $('.phal .fas').css('width','25px'); $('.phal .fas').css('height','25px'); $('.phal .fas').css('border','1px solid #fff'); clearTimeout(phal) },1000); }); } $('.messages-button').click(function(){ var spy = setTimeout(function(){ console.log('spy') var msgspy = $('.message-item').html(); console.log(msgspy); },500) }); function pagec(){ var href = window.location.href; var page = href.split('.ogamex.net/')[1]; return page; } function clickSpy(){ $('#subnav-espionage').click(function(){ getSpy(); }); } function clickSpyPage(currentPage){ $('.fa-angle-right,.fa-angle-left,.fa-angle-double-right,.fa-angle-double-left').click(function(){ var targetPage = parseInt($(this).attr('data-target-page')); if(currentPage != targetPage){ getSpy(); } }); } function getSpy(){ var cool = false; var espio = new Object(); if(!localStorage.ogx_msgRe){ localStorage.ogx_msgRe = ''; } var idre = localStorage.ogx_msgRe; if(idre.length > 432000){ localStorage.ogx_msgRe = idre.substr(idre.length-216000,idre.length); } var playerId = $('head').html().split("window.currentPlayerId = '")[1].split("';")[0]; var name = $('head').html().split("window.currentPlayerName = '")[1].split("';")[0]; var spy = setTimeout(function(){ var lines; var re = new Array(); var i = 0; $('.message-item').each(function(index){ if($(this).text().indexOf('Espionage action on') != -1){ //$(this).find('div').show(0); var msgRe = $(this); if(localStorage.ogx_msgRe.indexOf(msgRe.attr('data-msg-id')) != -1){ console.log('déjè présent'); }else{ localStorage.ogx_msgRe = localStorage.ogx_msgRe + msgRe.attr('data-msg-id'); re[i] = new Object(); re[i].att = new Object(); re[i].def = new Object(); re[i].created = msgRe.find('.head-right span').text(); re[i].universe = uni; re[i].msg_id = msgRe.attr('data-msg-id'); re[i].gmt = gmt; lines = msgRe.find('.message-content a:eq(0)').text(); re[i].att.type = 'planet'; if(lines.indexOf('Moon') != -1){ re[i].att.type = 'moon'; } lines = lines.split('[')[1].split(']')[0].split(':'); re[i].att.galaxy = parseInt(lines[0]); re[i].att.system = parseInt(lines[1]); re[i].att.position = parseInt(lines[2]); re[i].att.player_id = msgRe.html().split('statistics?rel=')[1].split("'>")[0]; re[i].att.name = msgRe.find('span:eq(2)').html(); lines = msgRe.find('.message-content a:eq(1)').text(); re[i].def.type = 'planet'; if(lines.indexOf('Moon') != -1){ re[i].att.type = 'moon'; } lines = lines.split('[')[1].split(']')[0].split(':'); re[i].def.galaxy = parseInt(lines[0]); re[i].def.system = parseInt(lines[1]); re[i].def.position = parseInt(lines[2]); re[i].def.player_id = playerId; re[i].def.name = name; i++; } } if(cool === true && (unic() == 'atlas' || unic() == 'novaa')){ if($(this).text().indexOf('Espionage report') != -1){ if(!$(this).find('.ogx-spy').length){ $('<div class="ogx-spy">').prependTo($(this)); $(this).find('div').hide(0); $(this).find('.ogx-spy').show(0); $(this).find('.message-status').show(0); //console.log($(this).html()); espio.coord = $(this).find('a').html().split("[")[1].split("]")[0]; espio.time = $(this).find('.head-right span').html(); espio.player = $(this).find('.msg-player-status').html(); espio.status = ''; if($(this).find('.msg-player-status').attr('class').indexOf('isInactive7') != -1){ espio.status = 'isInactive7'; } if($(this).find('.msg-player-status').attr('class').indexOf('isInactive28') != -1){ espio.status = 'isInactive28'; } espio.metal = intFormatc($(this).find('table tr:eq(1) td:eq(0) div').text().split(':')[1].trim()); espio.crystal = intFormatc($(this).find('table tr:eq(2) td:eq(0) div').text().split(':')[1].trim()); espio.deut = intFormatc($(this).find('table tr:eq(3) td:eq(0) div').text().split(':')[1].trim()); espio.activity = $(this).find('table tr:eq(0) td:eq(1)').text().split('Last activity:')[1].trim(); espio.fleet = $(this).find('table tr:eq(1) td:eq(1)').text().split('Fleet:')[1].trim(); espio.defense = $(this).find('table tr:eq(2) td:eq(1)').text().trim(); if(espio.defense.indexOf('Defense') != -1){ espio.defense = intFormatc(espio.defense.split('Defense:')[1].trim()) }else{ espio.defense = 'no data'; } espio.total = espio.metal + espio.crystal + espio.deut; espio.attack = $(this).find('.message-actions a:eq(7)').attr('onclick') console.log(espio.defense) if(unic() == 'atlas'){ espio.min = 1000000000; } if(unic() == 'nova'){ espio.min = 10000000000; } espio.max = 20000000000000000; if((espio.status == 'isInactive7' || espio.status == 'isInactive28') && espio.total > espio.min && espio.total < espio.max && espio.defense == '0'){ //if(cool==true){ espio.html = ''; espio.html += '<span class="ogx-spy-coord">'+espio.coord+'</span>'; espio.html += '<span class="ogx-spy-time">'+espio.time+'</span>'; //espio.html += '<span class="ogx-spy-player">'+espio.player+'</span>'; espio.html += '<span class="ogx-spy-coord">'+strFormatc(espio.total)+'</span>'; espio.html += '<span class="ogx-spy-coord">'+strFormatc(espio.fleet)+'</span>'; espio.html += '<span>'+strFormatc(espio.defense)+'</span>'; espio.html += '<a class="ogx-spy-plunder" href="#" onclick="'+espio.attack+'">Attack</a>'; espio.html += '<i class="ogx-spy-plus fa fa-chevron-down"></i>'; $(this).find('.ogx-spy').html(espio.html) }else{ $(this).hide(0) } //console.log(espio.player) } } } }); if(re.length > 0){ var post = {}; if(re.length > 50){ post.re = re.slice(0,50); $.post("https://www.fedbac.fr/ogx_spy-v"+v+".php", post, function(json){ if(json != ''){ console.log(json); } }, "text"); post.re = re.slice(50,re.length); $.post("https://www.fedbac.fr/ogx_spy-v"+v+".php", post, function(json){ if(json != ''){ console.log(json); } }, "text"); }else{ post.re = re $.post("https://www.fedbac.fr/ogx_spy-v"+v+".php", post, function(json){ if(json != ''){ console.log(json); } }, "text"); } } //console.log(re) var currentPage = parseInt($('.page-index-text').html().split('/')[0]); clickSpyPage(currentPage); },300) } function moonSpy(){ $(document).on('click','.col-moon div',function(){ //console.log($(this).parent().html()); var lines = $(this).parent().html(); lines = lines.split('SendSpy(')[1].split(',false)')[0]+',false'; lines = lines.split(','); //console.log(lines[0],lines[1],lines[2],lines[3],lines[4]); SendSpy(lines[0],lines[1],lines[2],lines[3],lines[4]); }); } function displayIna(i){ if(!$('.galaxy-item:eq('+i+') .col-player span').hasClass('isInactive7') && !$('.galaxy-item:eq('+i+') .col-player span').hasClass('isInactive28')){ $('.galaxy-item:eq('+i+')').html('') $('.galaxy-item:eq('+i+')').css('height','0px') } $('.filterEmpty').css('height','0px') } cssStyle(); addMenuButton(); playerClick(); if(pagec().indexOf('galaxy') != -1){ $('<a id="displayina" href="#" class="btn-route">').appendTo($('.btn-route:eq(1)').parent()).html('inactifs'); galaxyScan(); refreshPhal(); moonSpy(); } if(pagec().indexOf('messages') != -1){ $(document).on('click','.ogx-spy .ogx-spy-plus',function(e){ e.preventDefault(); console.log('fdgdfg') if($(this).parent().parent().find('.message-head').is(':visible')){ $(this).parent().parent().find('div').hide(0); $(this).parent().parent().find('.message-status').show(0); $(this).parent().show(0); }else{ $(this).parent().parent().find('div').show(0); } }); getSpy(); clickSpy(); } })();