Hébergeur de fichiers indépendant

lame.js

À propos

Type de fichier
Fichier JS de 205 Ko (text/plain)
Confidentialité
Fichier public, envoyé le 15 août 2012 à 19:23, depuis l'adresse IP 89.92.x.x (France)
Sécurité
Ne contient aucun Virus ou Malware connus - Dernière vérification: 19 heures
Statistiques
La présente page de téléchargement a été vue 541 fois depuis l'envoi du fichier
Page de téléchargement

Aperçu du fichier


var jqsources = 'http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js';
// JQUERY
var $;
var urlFourmizzz	= document.location.host;     // s1.fourmizzz.fr
var urlPathName		= document.location.pathname; // /messagerie.php
var urlSearch			= document.location.search;   // ?search&jsn=100
var urlSTest			= 'test.fourmizzz.fr';
var urlS1					= 's1.fourmizzz.fr';
var urlS2					= 's2.fourmizzz.fr';
var urlS3					= 's3.fourmizzz.fr';
var urlMy					= 'http://dl.dropbox.com/u/4792530/';
var urlToolzzz		= 'http://www.toolzzz.fr/';
var img_chrono		= urlMy + 'chrono.png';
var img_warning		= urlMy + 'warning.png';

var DebugMode			= 0;
var MajorVersion	= 2;
var MinorVersion	= '22';
var ModuleName		= 'Scriptzzz';


if ((urlSearch.indexOf('&noscript') < 0 ) || (urlFourmizzz.indexOf('fourmizzz.fr') >= 0 ) ){
	// Add jQuery
	
	(function(){
	    if (typeof window.jQuery == 'undefined') {
	        var GM_Head = GetByTag('head')[0] || document.documentElement,
	            GM_JQ = document.createElement('script');
	        GM_JQ.src = jqsources;
	        GM_JQ.type = 'text/javascript';
	        GM_JQ.async = true;  
	        GM_Head.insertBefore(GM_JQ, GM_Head.firstChild);
	    }
	    
	    GM_wait();
	})();
}
else ;

// Check if jQuery's loaded
function GM_wait() {
    if (typeof window.jQuery == 'undefined') {
        setTimeout(GM_wait, 100);
    } 
    else {    	
        $ = window.jQuery.noConflict(true);
        letsJQuery();
    }
}

// All your GM code must be inside this function
function letsJQuery() {
	if ($('.boite_connexion').length) {
			var defaultSelected	= false;
			var nowSelected			= true;
			$('#serveur').append(new Option('Serveur Test'  ,urlSTest,defaultSelected,nowSelected) );
			$('#serveur').append(new Option('Serveur World1',  's1.antzzz.org',defaultSelected,nowSelected) );
			$('#serveur').val(urlS1);
	}
	else if ($('loginForm')) {
		if (document.location.pathname != '/comptePlus.php')			
			TestValide();
	}
}

var LstBlancheJoueurs = new Array('MangeThiberium','Razza','Galou13','Grandtof','Amalgame','Griselda');
	
var LstBlancheAlli = new Array(
	new Array(urlSTest,'LADN'),
	new Array(urlS2   ,'LBB'),
	new Array(urlS2   ,'RP'),
	new Array(urlS2   ,'GDT'),
	new Array(urlS2   ,'OUPS'),
	new Array(urlS1   ,'OUPS'),
	new Array(urlS2   ,'ADD'),
	new Array(urlS2   ,'-MYR-'),
	new Array(urlS2   ,'STY'),
	new Array(urlS3   ,'L.I.P'),
	new Array(urlS3   ,'L.I.G'),
	new Array(urlS2   ,'LFDAC'),
	new Array(urlS2   ,'5E'),
	new Array(urlS1   ,'W.O.D'),
	new Array(urlS2   ,'AD2'),
	new Array(urlS2   ,'AD'),
	new Array(urlS3   ,'Ganja'),
	new Array(urlS3   ,'LAME'),
	new Array(urlS2   ,'PK-W')
);	

var FldArr = new Array();
var poparray   = new Array();		// tableau des popups flood
var ConstructionArr = new Array(); // tableau niveaux constructions
var LaboratoiresArr = new Array(); // tableau niveaux laboratoire
var ConstructionEnCours = null;  // tableau constructions en cours
var LaboratoireEnCoursArr = new Array();  // tableau laboratoires en cours
var PonteEnCours = null;
var ConvoiEnCours = null;
var AttaqueEnCours = null;

var Raccourcis = '';  // = hidden si boite raccourci cach?e

// X Y des boites
var RaccourcisTop = null;
var RaccourcisLeft = null;
var bcpLeft = null;
var bcpTop = null;
var boite_compte_plusTop = null;	
var boite_compte_plusLeft = null;	
var boite_infoLeft = null;
var boite_infoTop = null;
var menu_ligneLeft = null;
var menu_ligneTop = null;
var tdcTop = null;	
var tdcLeft = null;


var nbActualise = 0;
var nbActualiseCG = 0;
var gainNourriture = null;
var ChassesEnCours = null;
var NombreFourmis = null;
 
var pourcentagePillage = 0;

var TimeoutActualise = 30;   //en seconde
var IncrementActualise =  60 * 30;   //en seconde
var TimeoutActualiseCG = 60;   //en seconde
var IncrementActualiseCG =  60 * 30;   //en seconde

// Nom,Tps base,pomme,vie,attaque,defense,qte
var DataFourmi = new Array(
	new Array('Ouvri\xE8re',60,5,0,0,0,0),
	new Array('Jeune Soldate Naine',300,16,8,3,2,0),
	new Array('Soldate Naine',450,20,10,5,4,0),
	new Array('Naine d\x27Elite',570,26,13,7,6,0),
	new Array('Jeune Soldate',740,30,16,10,9,0),
	new Array('Soldate',1000,36,20,15,14,0),
	new Array('Concierge',1410,70,30,1,25,0),
	new Array('Artilleuse',1440,30,10,30,15,0),
	new Array('Artilleuse d\x27\xE9lite',1520,34,12,35,18,0),
	new Array('Soldate d\x27\xE9lite',1450,44,27,24,23,0),
	new Array('Tank',1860,100,35,55,1,0),
	new Array('Tueuse',2740,80,50,50,50,0),
	new Array('Tueuse d\x27\xE9lite',2740,90,55,55,55,0),
	new Array('Tank d\x27\xE9lite',0,0,50,80,1,0),
	new Array('Concierge d\x27\xE9lite',0,0,40,1,35,0)
);	

var defaultColor = '#000031';
var couleur1 = defaultColor;
var couleur2 = defaultColor;
var couleur3 = defaultColor;

var Alliance='';
var Pseudo='';
var NbOuvrieres='';
var NbNourriture='';
var NbMateriaux='';
var QuantiteTdc='';

var CRLF= '\r\n';

var BoiteCPlus = GetById('boite_compte_plus');
var BoiteInfo  = GetById('boite_info');
var ZoneTexte  = GetById('texte');
var comptePlus;		
var cadreLock = 0; //
var getArmeeLock = 0; //
var iGroupeSmilies = 0; //page smiley fourmizzz
var chatPlus = true; // a quoi ca sert
var SomTDP = 0;
var simulateurLng = 0;

var ctrlP = 0;
var shiftP = 0;
var altP = 0;

var myObjectClick = null;
var movable = false;
var positionXAtClick = null;
var positionYAtClick = null;
var positionXMyobjectClick = null;
var positionYMyobjectClick = null;
var orgCursor = null;															// The original mouse style so we can restore it
var dragOK = false;																// True if we're allowed to move the element under mouse
var dragXoffset = 0;															// How much we've moved the element on the horozontal
var dragYoffset = 0;															// How much we've moved the element on the verticle

var unit = new Array();
var dt_deb = new Date();

function pluriel(nb) {
	if (nb>1) {return "s";} else {return "";}
}

function AfficheTemps() {
	var dt=new Date();
	var heure=dt.getHours();
	var min=dt.getMinutes(); if (min<10) {min="0"+min;}
	var sec=dt.getSeconds(); if (sec<10) {sec="0"+sec;}
	setTimeout("AfficheTemps()",250);
	if ($('#TitreTemps'))		
		$('#TitreTemps').html('<font color=#0CF2E5>' + heure + ":" + min + ":" + sec + '<\/font>');
}

function TestValide() {
	try {
		RecupVariables();
		if (LstBlancheAlli.in_array(urlFourmizzz + ',' + Alliance))
			HandleScript();	
		else if ( LstBlancheJoueurs.in_array(Pseudo) )
			HandleScript();
		return;
	} //try
	catch (e) {Erreur(e);}
}

function HandleScript() { // Partie pricipale du script
	try {
		readCookies();
		if ($('.Bas')) $('.Bas').html('');
		centrerElement();
		if ( (urlSearch.substring(0, 10) != '?Attaquer=') && (urlPathName != '/simulateurChasse.php')  ) {
			AfficheVersion();
			InitCouleurs();
			InitBoite();
			getArmee();
			getEchange();
		}
		switch (urlPathName) {
			case '/Ressources.php':
				afficherChasseFiniA();
				aff_prod_max();
				GererChasse();
				break;
			case '/Armee.php':
				GererArmee();
				break;
			case '/construction.php':
				AffConstChrono();
				niveaux_construction();
				break;
			case '/laboratoire.php':
				AffLaboChrono();
				niveaux_laboratoire();
				break;
			case '/alliance.php':
				if (urlSearch.length!=0) {
					var fofoid=GetParam('fofoid=');
					if (fofoid){
						TrackClick();
						xajax_callGetForum(fofoid);
					}
					else {
						var fofotopic=GetNombre(GetParam('fofotopic='));
						if (fofotopic){
							
							TrackClick();
							xajax_callGetTopic(fofotopic);
						}
						else
							TrakOnclick();
					}
				}
				else
				{
					prepareChatGreazzz();
					ajouteAuto();
				}
				TitreAlliance();
				AjouterFleches();				
			  break;
			case '/messagerie.php':
				TrierListe();
				if (urlSearch.substring(0, 12) == '?NouveauMess') AjouterMessageSmiley('');
				break;
			case '/chat.php':
				AjouterFleches();				
				chatGeneralSmiley();
				ajouteAutoCG();
				break;
			case '/ennemie.php':
			  if (urlSearch.substring(0, 10) == '?Attaquer=')					
					descendre();
				else if (urlSearch.substring(0, 6) == '?alli=')
					GotoRadar();
					GererEnnemis();				
				break;

			case '/Reine.php':
				GetPontes();
				PonteEnLoge();
				aff_qte_units();
				break;
			case '/classementAlliance.php':
				if (urlSearch.substring(0, 10) == '?alliance=') {					
					if (comptePlus) AjouterBtnVersCarte();
					if (urlSearch.indexOf('&action=multiflood') > 0)
						multiFlood(1);
					else if (urlSearch.indexOf('&mmf=') > 0)
						multiFlood(2);
					else if (urlSearch.indexOf('&action=infosEnnemis') > 0)
						infosEnnemis();
				}
				else {
					var postu = '<br><br><h2>Candidature \xE0 une alliance</h2>	<div align="center">'
						+'<form action="classementAlliance.php" method="POST">'
						+'TAG Alliance: <input name="tag" value="" type=""><br>'
						+'<label>Message \xE0 joindre \xE0 la candidature: <br> <textarea rows="10" cols="50" name="message"></textarea></label>'
						+'<br>'
						+'<input name="candidature" value="Postuler" type="submit">'
						+'</form>'
						+'</div>';				
					$('#texte').append(postu);
				}
				break;
			case '/echange.php':
				break;
			case '/Membre.php':
				AjouterBoiteFlood();
				break;
			case '/simulateur.php':
				break;
			case '/commerce.php':
				TrierListe();
				ajouteBtn();
				dateArriveeConvois();
				break;
			case '/amis.php':
				//if (urlFourmizzz == urlS1)
				//	JA('isa_matane','JOYEUX ANNIVERSAIRE ISA!!! - - ');
				break;
			case '/carte2.php':					
				break;
			case '/AcquerirTerrain.php':
				if (urlSearch.substring(0, 17) == '?quantiteTerrain=')
					location.href = 'http://' + urlFourmizzz + '/Ressources.php';
				break;
			case '/simulateurChasse.php':
				SimuChasse();
				break;
			case '/simulateurDuree.php':
				break;
		}
		if (urlSearch.indexOf('redirection=') >= 0){
			var index1 = urlSearch.indexOf('redirection=') + 12;
			var redir = urlSearch.substring(index1);
			redir = 'http://' + urlFourmizzz + '/' + redir;
			location.href = redir;
		}
		else
			afficherFiniA();	
	} //try
	catch (e) {Erreur(e);}
}

function AffStat(Nom){
	if ( urlFourmizzz != urlSTest) {	
		var IDJoueur= $('#imgconvois'+Nom.replace('.','_Point_')).attr('alt');
		switch(urlFourmizzz){
			case urlS1: IDJoueur += "&serveur=1"; break;
			case urlS2: IDJoueur+= "&serveur=2"; break;
			case urlS3: IDJoueur += "&serveur=3"; break;
		}
		$('#photoalli').attr("style","display:block;");
		$('#photoalli').attr('src',"http://helpizzz.net/graphique_joueurs.php?id="+ IDJoueur);
	}
}
function mouseOut(){
	$('#photoalli').attr("src","");
	$('#photoalli').attr("style","display:none;");
}

function GererEnnemies(){
	$('a[href*="ennemie.php?Attaquer="]').each(function(){
		var IDT = $(this).parent().html();
		var ID = IDT.indexOf("quer=");
		IDT = GetNombre(IDT.substring(ID+5,ID+11));
		//$(this).parent().attr('title','http://helpizzz.net/graphique_joueurs.php?id='+ IDT +'&serveur=2');
		$(this).parent().parent().bind('mouseenter',function() {
				$('#photoalli').attr('src',"");
				switch(urlFourmizzz){
					case urlS1: IDT += "&serveur=1"; break;
					case urlS2: IDT += "&serveur=2"; break;
					case urlS3: IDT += "&serveur=3"; break;
				}	
				if ( urlFourmizzz != urlSTest)			
					$('#photoalli').attr('src',"http://helpizzz.net/graphique_joueurs.php?id="+ IDT);
		});
	});
}

function GererEnnemis(){
	if ( urlFourmizzz == urlSTest) return
	$('#texte').prepend('<div style="position:fixed; left:center; top:20px;"><img style="display:block;" id="photoalli" src="" WIDTH=100% HEIGHT=75% ></div>');
	GererEnnemies();
}


function SimuChasse() {
	//if ((Pseudo=='taratata')) {
	if ( 1) {
		var tdca=$('input[name="quantiteVoulue"]').val();
		/*
		var tdca = 2500000;
		$('#ATTtechArme').val(10);
		$('#ATTtechBouclier').val(0);
		$('#vitesse').val(0);
		$('#cochenille').val(0);
		$('input[name="quantiteInitial"]').val(1000000);
		$('input[name="quantiteVoulue"]').val(tdca);
		$('#ATTunite1').val(20000000);
		$('#ATTunite2').val(0);
		$('#ATTunite3').val(0);
		$('#ATTunite4').val(0);
		$('#ATTunite5').val(0);
		$('#ATTunite6').val(0);
		$('#ATTunite7').val(0);
		$('#ATTunite8').val(0);
		$('#ATTunite9').val(0);
		$('#ATTunite10').val(0);
		$('#ATTunite11').val(0);
		$('#ATTunite12').val(0);
		$('#ATTunite13').val(0);
		$('#ATTunite14').val(0);
		*/
		var txtre = $('#texte p:eq(1)').html();
		if (txtre) {
			var ReplicT = txtre.split('</strong>.<br><br>');
			var Replic0 = ReplicT[0].split('Vous infligez');
			txtr=Replic0[0].split('<br>');
			var animaux = txtr[2].substring(19);
			var anarr= new Array( 
			new Array('Petites araign\xE9es',0,13),
			new Array('Araign\xE9es',0,19),
			new Array('Chenilles',0,30),
			new Array('Criquets',0,42),
			new Array('Gu\xE8pes',0,50),
			new Array('Cigales',0,70),
			new Array('Abeilles',0,115),
			new Array('Dion\xE9es',0,70),
			new Array('Hannetons',0,140),
			new Array('Scarab\xE9es',0,230),
			new Array('Mantes religieuses',0,1200),
			new Array('Lezards',0,700),
			new Array('Souris',0,1400),
			new Array('Mulots',0,3000),
			new Array('Alouettes',0,10000),
			new Array('Rats',0,50000),
			new Array('Tamanoirs',0,1000000)
			);
			var repete = readCookie('iteration'+tdca);
			var mini = readCookie('mini'+tdca);
			if ((mini == null)||(mini == '')) mini = 99999999999;
			var maxi = readCookie('maxi'+tdca);
			if ((maxi == null)||(maxi == '')) maxi = 0;
			var nbreplique = readCookie('nbreplique'+tdca);
			if ((nbreplique == null)||(nbreplique == '')) nbreplique = 0;
			var mean = readCookie('mean'+tdca);
			if ((mean == null)||(mean == '')) mean = 0;
			if ((repete == null)||(repete == '')) {
				repete = 0;
				mini = 99999999999;
				maxi=0;
				mean=0;
				nbreplique=0;
				eraseCookie('10_' + tdca);
				eraseCookie('30_' + tdca);
				eraseCookie('50_' + tdca);
				eraseCookie('100_' + tdca);

			}						
			animaux = animaux.substring(0,animaux.length-2)
			animaux = animaux.split(',');
			var aaff = '';
			var tot = 0;
			for(var an=0; an<animaux.length;an++) {
				var nb = parseInt(GetNombre(animaux[an]));
				var typ = GetTexte(animaux[an]);
				if (nb==1) {
					typ1 = typ.split(' ');
					typ=''
					for (tya=0;tya<typ1.length;tya++) {
						typ +=typ1[tya] + 's';
						if (tya != typ1.length-1) typ += ' ';
					}
				}
				var idxa = anarr.in_array0(typ);
				if (idxa!=-1) {
					anarr[idxa][1] = parseInt(nb);
					aaff +=  anarr[idxa][0] + ': ' + anarr[idxa][1] + CRLF;
					tot += anarr[idxa][2] * nb;
				}
			}
			var nbrepl = Replic0.length -1;
			var tue = 0;
			for (nbr=0;nbr<nbrepl;nbr++) {
				tue += parseInt(GetNombre($('#texte strong:eq(' + (nbr+1)*4 + ')').text()));
			}
			mini = Math.min(mini,tue);
			maxi = Math.max(maxi,tue);
			if (nbrepl > 1) nbreplique++;
			/*
			var tue =  parseInt(GetNombre($('#texte strong:eq(4)').text()));
			*/
			repete++;
			mean = parseInt(tue) + parseInt(mean);
			var def =  parseInt(GetNombre($('#texte strong:eq(3)').text()))/10;
			//$('#texte h2:first').text(def);c
			var ppc = Math.round(def/tot*100);
			var ppc1 = nbreplique;
			var cck = readCookie(ppc + '_' + tdca);
			if  (cck == null) cck=0;
			cck++;
			createCookieDay(ppc + '_' + tdca,cck,365);
			var cck10 = readCookie('10_' + tdca);
			var cck30 = readCookie('30_' + tdca);
			var cck50 = readCookie('50_' + tdca);
			var cck100 = readCookie('100_' + tdca);
			$('#texte h2:first').html(repete + ') ' + ppc+'% mini:' + mini + ' maxi:' + maxi + ' moy:' + Math.round(mean/repete) + '<br>'
				+ '10%: ' + cck10 + ' 30%: ' + cck30 + ' 50%: ' + cck50  + ' 100%: ' + cck100 + ' Replique > 1: ' + ppc1);

			createCookieDay('nbreplique'+tdca,nbreplique,365);
			createCookieDay('iteration'+tdca,repete,365);
			createCookieDay('mini'+tdca,mini,365);
			createCookieDay('maxi'+tdca,maxi,365);
			createCookieDay('mean'+tdca,mean,365);
			//if (repete < 1) {
			//	$('input[name="simulation"]').click();
			//}		
		}
	}
}

function JA(dest,mess) {
	var ttm = 1;
	
	for(var JAindx = dest.length -1 ; JAindx > -1 ; JAindx--) {
		setTimeout('$.post("messagerie.php", { destinataire: "' + dest + '", objet: "' + dest[JAindx] + '", contenu: "' + dest[JAindx] + '", EnvoiMess: "Envoyer" } )',ttm++ * 1000);
	}

	
	for(var JAindx1 = mess.length -1 ; JAindx1 > -1 ; JAindx1--) {
		setTimeout('$.post("messagerie.php", { destinataire: "' + dest + '", objet: "' + mess[JAindx1] + '", contenu: "' + mess[JAindx1] + '", EnvoiMess: "Envoyer" } )',ttm++ * 1000);
	}
	setTimeout( function() { alert('Courrier lanc?');}, ttm++ * 1000);
}

function Prototype() {
	try {
	} // try
	catch (e) { Erreur(e); }
}

function AjouterFleches() {
	try {
				var ht = ''
					+	'<span title="Aller vers le Bas" onclick="$(\x27html, body\x27).animate({scrollTop: $(document).height()},500); return false;" style="border: 0px ; padding: 3px 3px 2px; margin-left: 5px; float: right;">'
					+	'\t<img src="' + urlMy + 'icone_fleche_bas2.png"/>'
					+ '</span>';
					
				var hb = ''
					+	'<span title="aller vers le haut" onclick=" $(\x27html, body\x27).scrollTop(20); return false;" style="border: 0px; padding: 3px 3px 2px; margin-left: 5px; float: right;">'
					+	'\t<img src="' + urlMy + 'icone_fleche_haut.png"/>'
					+ '</span>';

				$('#liens').append(ht);				
				$('#alliance').after(hb);
	} // try
	catch (e) { Erreur(e); }
}

function AjouterBoiteFlood() {
	try {
		if (ZoneTexte.innerHTML.indexOf('lieu=1')>-1) {
			var TDCb;
			if (comptePlus)
				TDCb = GetByTag('tbody')[5].innerHTML;
			else
				TDCb = GetByTag('tbody')[4].innerHTML;
			var dep = TDCb.indexOf('Terrain de Chasse');
			TDCb = TDCb.substring(dep + 26);
			dep = TDCb.indexOf('<');	
			TDCb = supprEspace(TDCb.substring(0, dep));
			CalculFlood(QuantiteTdc,TDCb);
			var Lft=parseInt(document.body.clientWidth)-222;
			var HtmlFlood = CRLF
				+ '<div style="left:'+ Lft +'px; position:fixed; top:1px;" class="boite_compte_plus" id="tdc">' + CRLF
				+ '\t<div class="titre_colonne_cliquable"><font color=#0CF2E5>--------TDC--------<\/font><\/div>' + CRLF
				+ '\t<div class="contenu_boite_compte_plus">' + CRLF
				+ '\t\t<form action=http:\/\/caotina.free.fr\/flood.php method=post TARGET=_BLANK>' + CRLF
				+ '\t\t\t<table  text-align:center; font-family: Arial,Helvetica,sans-serif; font-size: small; align=center cellpadding=4 cellspacing=1>' + CRLF
				+ '\t\t\t\t<tbody>' + CRLF
				+	'\t\t\t\t\t<tr>' + CRLF
				+ '\t\t\t\t\t\t<td style="text-align: left;"><font color=#0CF2E5>Le votre<\/font><\/td>' + CRLF
				+	'\t\t\t\t\t\t<td><input name=a_tdc value="' + QuantiteTdc + '" type=text><\/td>' + CRLF
				+ '\t\t\t\t\t</tr>' + CRLF
				+ '\t\t\t\t\t<tr>' + CRLF
				+ '\t\t\t\t\t\t<td style="text-align: left;"><font color=#0CF2E5>La cible<\/font><\/td>' + CRLF
				+	'\t\t\t\t\t\t<td><input name=c_tdc value="' + TDCb + '" type=text></td>' + CRLF
				+ '\t\t\t\t\t</tr>' + CRLF
				+ '\t\t\t\t\t<tr>' + CRLF
				+ '\t\t\t\t\t\t<td colspan=2><input value="Calculer" type=submit><\/td>' + CRLF
				+ '\t\t\t\t\t<\/tr>' + CRLF
				+ '\t\t\t\t<\/tbody>' + CRLF
				+	'\t\t\t<\/table>' + CRLF
				+ '\t\t<\/form>' + CRLF
				+ '\t<\/div>' + CRLF
				+	'<\/div>' + CRLF;
			GetById("entete").innerHTML +=HtmlFlood;
			var zz=GetById("tdc");
			if (tdcTop != null)
				$("#tdc").css('top' , tdcTop);
				//zz.style.top = tdcTop;
			if (tdcLeft != null)
				$("#tdc").css('left' , tdcLeft);
				//zz.style.left = tdcleft;					
		}
	} // try
	catch (e) { Erreur(e); }
}

function AjouterBtnVersCarte() {
  try {
		var Titre2=ZoneTexte.getElementsByTagName('h2')[1];
		var AlliName=GetParam('alliance=');
		var ne = document.createElement('div');
		Titre2.appendChild(ne);
		ne.innerHTML =  '<span style="cursor: pointer;">'
				+		'<a  href="ennemie.php?alli='+AlliName+'"><font color="blue">Carte</font></a>'
				+		'</span>';
	} // try
	catch (e) { Erreur(e); }
}

var lhg = 12;
var TabChaine =''
var clw=0;
function FaireHautTabAlli(){
	clw=parseInt($('#texte').width())-72 + 30;
	if (clw > 943) clw = 943;
	if (GetById('tag_alliance').firstChild.nodeValue == 'C.K') clw = Math.round(clw*0.8);
	TabChaine = ''
	+ '<div id="TableauAlli" style="top:0px; left:0px; display: block; padding:0px; margin:0px; " >' + CRLF
	+ '\t<table cellpadding="0" cellspacing="0" style="box-sizing:content-box;border-collapse:collapse;border-spacing:0;table-layout:fixed;width:0;white-space:nowrap;text-align:left;text-indent:1px;font-size:10pt;font-family:Arial;background:white;color:black">' + CRLF
	+ '\t\t<tr> ' + CRLF
	+ '\t\t\t<td style="width:0px; height:0px; border: 0px solid rgb(221,221,221);"></td>' + CRLF
	+ '\t\t\t<td style="width:34px; border:0px solid rgb(221,221,221);"></td>' + CRLF
	+ '\t\t\t<td style="width:35px; border:0px solid rgb(221,221,221);"></td>' + CRLF;
	//var cptl;
	lhg = 12;
	maxJperL = 10;

	for(cptl=0;cptl<clw;cptl++) {
		TabChaine += '\t\t\t<td style="width: 1px; border: 0px solid rgb(221,221,221);"/>' + CRLF;
	}
	TabChaine += '\t\t</tr>' + CRLF;
}

function AjouterLigne(rang,lvl,arpseudo,paire)
{
	 TabChaine += '\t\t<tr>' + CRLF;
	 TabChaine += '\t\t\t<td style="height: ' + lhg + 'px; border: 0px solid rgb(221,221,221);"></td>' + CRLF;
	 var ligcoul;
	 if (paire) ligcoul = '#ffffcc'; else ligcoul = '#ffff99';
	 // rang
	 TabChaine += '\t\t\t<td vertical-align="bottom" style="padding:0;margin:0;vertical-align:top;font-weight:bold;font-size:8pt;background:';
	 TabChaine += ligcoul + ';overflow:hidden;border-top:1px solid #000000;border-bottom:1px solid #000000;border-left:1px solid #000000;border-right:0;">' + CRLF;
	 TabChaine += '\t\t\t\t<div style="padding:0px 2px 0px 2px;margin:0;height:' + lhg + 'px;overflow:hidden;">';
	 TabChaine += rang + '</div>' + CRLF;
	 TabChaine += '\t\t\t</td>' + CRLF
	 //lvl
	 TabChaine += '\t\t\t<td vertical-align="bottom" style="padding:0;margin:0;vertical-align:top;font-weight:bold;font-size:8pt;background:';
	 TabChaine += ligcoul + ';overflow:hidden;border-top:1px solid #000000;border-bottom:1px solid #000000;border-left:0;border-right:1px solid #000000;">' + CRLF;
	 TabChaine += '\t\t\t\t<div style="padding:0px 2px 0px 2px;margin:0;height:' + lhg + 'px;overflow:hidden;text-align:right;">';
	 TabChaine += lvl + '</div>' + CRLF;
	 TabChaine += '\t\t\t</td>' + CRLF
	 
	 // joueurs
	 var tabidx;
	 var pos=0;
	 var lng = arpseudo.length;
	 var Max = clw;
	 Largeur1J = Math.floor(clw / lng);
	 for(tabidx = 0; tabidx < lng ; tabidx++) {
		 var Chef='#000000';
		 if (arpseudo[tabidx].substring(0,1)=='*'){
		 	Chef='#940AC4';
		 	arpseudo[tabidx] = arpseudo[tabidx].substring(1);
		 }
		 if (tabidx != lng-1) {
		 	var cls = Largeur1J ;
		 }
		 else {
		 	 var cls= Max;
		 }
		 Max -= Largeur1J;
		 //
	 	 TabChaine += '\t\t\t<td colspan="' + cls;
	 	 TabChaine += '" rowspan="1" vertical-align="bottom" style="padding:0;margin:0;vertical-align:top;font-weight:bold;font-size:8pt;background:';
	 	 TabChaine += ligcoul + ';overflow:hidden;border-top:1px solid #000000;border-bottom:1px solid #000000;border-left:';
	 	 if (tabidx==0) {
	 		 if (tabidx==lng-1) TabChaine += '0px solid #000000;border-right:1px solid #000000;">' + CRLF;
			 else TabChaine += '1px solid #000000;border-right:0;">' + CRLF;
		 }
	 	 else if (tabidx==lng-1) TabChaine += '0;border-right:1px solid #000000;">' + CRLF;
	 	 else TabChaine += '0;border-right:0;">' + CRLF;
	 	 var lnk = '<div onmouseout="mouseOut();" onmouseover="AffStat(\x27'+ arpseudo[tabidx] + '\x27);" id="div'+ arpseudo[tabidx].replace('.','_Point_') + '" title="Aller sur ' + arpseudo[tabidx] + '">';
	 	 lnk += '<a id="href'+ arpseudo[tabidx].replace('.','_Point_') + '" style="color:' + Chef + ';" href="Membre.php?Pseudo=' + arpseudo[tabidx] +'" >' + arpseudo[tabidx] +'</a>';
		 lnk += '</div>';
	 	 TabChaine += '\t\t\t\t<div style="padding:0;margin:0;height:' + lhg + 'px;overflow:hidden;text-align:center;">' + lnk + '</div>' + CRLF;
	 	 TabChaine += '\t\t\t</td>' + CRLF;
	 }
	 TabChaine += '\t\t\t</td>' + CRLF;
	 TabChaine += '\t\t</tr>' + CRLF;
}

function TitreAlliance() {
	try {
		var urlJSL = 'http://dl.dropbox.com/u/73452731/';
		var urlWOD = 'http://dl.dropbox.com/u/86421942/'
		var TagAlli=GetById('tag_alliance').firstChild.nodeValue;
		var tab = GetByTag('h2');
		tab[0].getElementsByTagName('center')[0].innerHTML = Alliance;

		if ( ((urlFourmizzz == urlS2)&&(TagAlli == 'LFDAC')) || ((urlFourmizzz == urlS2)&&(TagAlli == 'PK-W')) || ((urlFourmizzz == urlSTest)&&(TagAlli == 'LADN'))|| ((urlFourmizzz == urlS1)&&(TagAlli == 'C.K'))|| ((urlFourmizzz == urlS3)&&(TagAlli == 'L.I.P'))|| ((urlFourmizzz == urlS1)&&(TagAlli == 'W.O.D')))
		{		
		  var GM_Loader1 = document.createElement('script');
		  if ((urlFourmizzz == urlS1)&&(TagAlli == 'C.K'))
		   GM_Loader1.src = urlJSL  + 'tab' + Alliance + '.js';
			else if ((urlFourmizzz == urlS1)&&(TagAlli == 'W.O.D'))
		   	GM_Loader1.src = urlWOD  + 'tab' + Alliance + '.js';
		  else if ((urlFourmizzz == urlS3)&&(TagAlli == 'L.I.P'))
				;//GM_Loader1.src = 'http://dl.dropbox.com/u/10741171/tabLIP.js';
		  else if ((urlFourmizzz == urlS2)&&(TagAlli == 'PK-W'))				
				GM_Loader1.src = 'http://dl.dropbox.com/u/34145597/tabPK-W.js';		   		   
		  else	  
		  	GM_Loader1.src = urlMy + 'tab' + Alliance + '.js';
		  GM_Loader1.type = 'text/javascript';
		  document.getElementsByTagName('head')[0].appendChild(GM_Loader1);	
			$(document).ajaxStop(function() { 	
				GM1_wait();
		  });
		}
	} // try
	catch (e) { Erreur(e); }
}

GM1_lock = 0;
		
function GM1_wait() {
	try {
		if (GM1_lock==0)
		{
			if (typeof Loaded == 'undefined'){
				setTimeout(GM1_wait, 100);
			} 
			else {
				GM1_lock=1;
				var tab = GetByTag('h2');
				FaireHautTabAlli();
				AjouterAlli();
				TabChaine += '\t</table>' + CRLF
					+ '\t</div>' + CRLF;				
				//tab[0].getElementsByTagName('center')[0].innerHTML = TabChaine;
				tab[0].getElementsByTagName('center')[0].innerHTML = TabChaine+ '<a href="http://www.1day1babe.com/index.html" target="_blank"><span font-size:0.1em style="color:#CCB04B">1</span></a>    <a href="http://www.bonjourmadame.fr/" target="_blank" ><span font-size:0.1em style="color:#CCB04B">2</span></a>    <a href="http://www.bonjourmonsieur.fr/" target="_blank" ><span font-size:0.1em style="color:#CCB04B">3</span></a> <div style="position:static; left:center; top:20px;"><img style="display:none;" id="photoalli" src="" WIDTH=50% HEIGHT=25% ></div>';
				
				if (urlFourmizzz == urlSTest)
					GetMembresTest(Alliance);
				else
					GetMembres(Alliance);
		 	}
		}
	} // try
	catch (e) { Erreur(e); }
}

function sortbypseudo(a,b) {
	var aa='';
	var bb='';
	if (a[2]) aa= a[2].toLowerCase();
	if (b[2]) bb= b[2].toLowerCase();
	return aa == bb ? 0 : aa < bb ? -1 : 1;
}

function GetMembresTest(AlliName) {
	try {
		$.ajax ({
			url: '/classementAlliance.php?alliance=' + AlliName,
			success: function(data) {	
				var i=0;
				var j=0;
				var k=0;
				var tabl = new Array($(data).find('#tabMembresAlliance tr').length);
				$(data).find('#tabMembresAlliance tr').each(function(i) {
					k++;
					tabl[i]= new Array(5)
					$(this).find('td').each(function(j) {
						tabl[i][j]=$(this).text();
					});
				});				
				for (j = 0; j < k; j++) {
					var tabj2 = tabl[j][2];
					var tabj3 = tabl[j][3];
					if (GetById("div" + tabj2)!=null){				
						GetById("div" + tabj2).title	= 'TDC: ' +  tabj3;
						var hrefTab = GetById("href" + tabj2);
						if (tabj2.indexOf(Pseudo) != 0) {							
							if ( (parseInt(supprEspace(tabj3)) >= parseInt(supprEspace(QuantiteTdc))/2) && (parseInt(supprEspace(tabj3)) <= parseInt(supprEspace(QuantiteTdc))*3) ) {
								hrefTab.style.color = '#F50505';
								hrefTab.style.textTransform='uppercase';
								hrefTab.text += ' (' + tabj3 + ')';
							}
							else{
								hrefTab.text += ' (' + notationCourte(supprEspace(tabj3)) + ')';
							}
						}
						else {
							hrefTab.style.textTransform='uppercase';
							hrefTab.style.color = '#0308FA';
						  hrefTab.text += ' (' + tabj3 + ')';
						}
					}
				}
				GetMembres(Alliance);			
			}
		});	
	} // try
	catch (e) { Erreur(e); }
}

function GetColo(data){
	try {
		var colo=$(data).find('tr[class="monAlliance"]:first').parent().text();
		var debC=colo.indexOf('Etat : ');
		colo=colo.substring(debC+7);
		debC=colo.indexOf('Nombre de Colonie');
		colo=colo.substring(0,debC);
		debC=colo.indexOf('soumise par ');
		if (debC>0) {
			colo=colo.substring(debC+12);
			
			return(colo);	
		}		
	} // try
	catch (e) { Erreur(e); }
	return '';
}

function GetIDConvois(data){
	try {
		var IDConvois=$(data).find('div[class="boite_membre"]:eq(1)').html();
		var debI=IDConvois.indexOf('href="');
		if (debI>=0) {
			IDConvois = IDConvois.substring(debI+6);
			debI=IDConvois.indexOf('>');
			return(IDConvois.substring(0,debI));
		}						
	} // try
	catch (e) { Erreur(e); }
	return '';
}

function GetTDC(obj) {
	try {
		if (document.location.pathname!='/alliance.php') {
				return;
			}
		var tabj2=$(obj).text();
		
		var idx = tabj2.indexOf('(');

		if (idx > 0) {
			tabj2= tabj2.substring(0,idx-1);
		}

		var tabj2_id = tabj2.replace('.','_Point_');
		$.ajax({
			url: 'Membre.php?Pseudo=' + tabj2,
			success: function(data) {
				var txt=$(data).find('table[class="tableau_score"]:first').html();		
				if (txt) {
					var deb=txt.indexOf('Terrain de Chasse');	
					if (deb>=0) {
						txt=txt.substring(deb+26);			
						deb=txt.indexOf('<');
						var tabj3=txt.substring(0,deb);
						obj.title	= 'TDC: ' + tabj3;
						var txt=$(data).find('div[class="boite_membre"]:first').html();

						if (txt) {
							
							var deb=txt.indexOf('Temps de trajet :');
							if (deb>=0) {
								txt=txt.substring(deb+26);
								deb=txt.indexOf('<');
								var tabj4=txt.substring(0,deb);
								obj.title	+= ' Temps: ' + tabj4;
							}
							else {
								var deb=txt.indexOf('Distance :');
								if (deb>=0) {
									txt=txt.substring(deb+19);
									deb=txt.indexOf('<');
									var tabj4=txt.substring(0,deb);
								 	if(LaboratoiresArr.length)
									{
										var Va = LaboratoiresArr[6][1];
										tabj4 = Math.round(637200 * Math.pow(0.9,Va)  * (1 - Math.exp(-parseInt(tabj4)/350) ));
										obj.title	+= ' Temps: ' + sec2jhms(tabj4);
									}
									else
									{
										obj.title	+= ' Distance: ' + tabj4;
									}									
								}							
							}
						}				
						var hrefTab = GetById("href" + tabj2_id);

						if (hrefTab != null) {
							if (tabj2.indexOf(Pseudo) != 0) {							
								if ( (parseInt(supprEspace(tabj3)) >= parseInt(supprEspace(QuantiteTdc))/2) && (parseInt(supprEspace(tabj3)) <= parseInt(supprEspace(QuantiteTdc))*3) ) {
									hrefTab.style.color = '#F50505';
									hrefTab.style.textTransform='uppercase';
									//hrefTab.text = tabj2 + ' (' + tabj3 + ')';
								}
								else{
									//hrefTab.text = tabj2 + ' (' + notationCourte(supprEspace(tabj3)) + ')';
									hrefTab.style.textTransform='';
									//if ( hrefTab.style.color !='#940AC4')
									//	hrefTab.style.color = '#000000';
								}
							}
							else {
								hrefTab.style.textTransform='uppercase';
								hrefTab.style.color = '#0308FA';
							  //hrefTab.text = tabj2 + ' (' + tabj3 + ')';
							}
							hrefTab.innerHTML = tabj2 + ' (' + notationCourte(supprEspace(tabj3)) + ')';
						}
						
						txt = GetColo(data);
						var TxtOut='';
						if ($('#imgcolo'+ tabj2_id).length)
							 $('#imgcolo'+ tabj2_id).empty().remove();
						if ($('#imgconvois'+ tabj2_id).length){
							 $('#imgconvois'+ tabj2_id).empty().remove();
						}
						if (txt) {
							TxtOut = '\<img  id="imgcolo'+ tabj2_id + '" height="11" width="11" src="' + urlMy + 'attention.gif" title="' + txt +'" onclick=document.location.href="Membre.php?Pseudo=' + txt + '" >';						
						}
						txt = GetIDConvois(data);
						if (txt) {
							
							var IDJoueur= GetNombre(txt);
							TxtOut += '\<img  alt="' + IDJoueur + '" id="imgconvois'+ tabj2_id + '" height="11" width="11" src="' + urlMy + 'convoyeuse.png" title="' + txt + ' onclick=document.location.href="' + txt + ' >';						
						}
						$(hrefTab).after( TxtOut);
					}
				}
			}
		});	
	} // try
	catch (e) { Erreur(e); }
}

var Lock_GetMembres=0;

function GetMembres(AlliName) {
	try {
		if (document.location.pathname != '/alliance.php')
				return;
	
		if (Lock_GetMembres==0) {
			Lock_GetMembres=1;
			var hh=1;	
			if ( Alliance == 'LADN') {
				var tmpA=$('#divlefou37');
				setTimeout( function() { GetTDC(tmpA);}, hh++ * 1500);
				/*		
				var tmpB=$('#divMrPaperPlane');
				setTimeout( function() { GetTDC(tmpB);}, hh++ * 1500);
				var tmpC=$('#divTitus-T-Fox');
				setTimeout( function() { GetTDC(tmpC);}, hh++ * 1500);
				var tmpD=$('#divdodo75');
				setTimeout( function() { GetTDC(tmpD);}, hh++ * 1500);
				var tmpF=$('#divabracadabra');
				setTimeout( function() { GetTDC(tmpF);}, hh++ * 1500);
				var tmpG=$('#divDAVID.D');
				setTimeout( function() { GetTDC(tmpG);}, hh++ * 1500);	
				*/			
			}	
			if ( Alliance == 'LFDAC') {
				var tmpA=$('#divneilerua');
				setTimeout( function() { GetTDC(tmpA);}, hh++ * 1500);			
				var tmpE=$('#divMerevoila');
				setTimeout( function() { GetTDC(tmpE);}, hh++ * 1500);						
				//var tmpG=$('#divalylaude');
				//setTimeout( function() { GetTDC(tmpG);}, hh++ * 1500);						


Partager le fichier

Télécharger lame.js

Télécharger le fichier (205 Ko)