// ==UserScript==
// @name GobZilla
// @namespace Gobland
// @description Décoche par défaut la case active dla et le vestaire. Affiche des icones dans la vue. Affiche le nombre d'entrainements restants. Récup des attributs (mes sais pas quoi en faire^^)
// @include http://games.gobland.fr/jeuC.html
// @include http// ==UserScript==
// @name GobZilla
// @namespace Gobland
// @description Décoche par défaut la case active dla et le vestaire. Affiche des icones dans la vue. Affiche le nombre d'entrainements restants. Récup des attributs (mes sais pas quoi en faire^^)
// @include http://games.gobland.fr/jeuC.html
// @include https://games.gobland.fr
// @include http://games.gobland.fr/Vue.php
// @include http://games.gobland.fr/ProfilPerso.php
// @include http:/games.gobland.fr/ProfilMonster.php
// @match http://games.gobland.fr/index.php*
// @match https://games.gobland.fr/index.php*
// @match http://games.gobland.fr/playActions.php?todo=52
// @require https://greasemonkey.github.io/gm4-polyfill/gm4-polyfill.js
// @require https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js
// @copyright lordslair, Seishin et Death Métal
// @license https://creativecommons.org/licenses/by-sa/4.0/
// @version 0.0.4.2
// Heavily inspired by http://userscripts-mirror.org/scripts/show/41369
// ==/UserScript==
//================================================================================================================
/// INFO BULLES TALENTS (trouver le moyen de recup les carac, car quand on les récup ça prend en compte les bonus)
//=================================================================================================================
$( document ).ready(function() {
$('a:contains("Afflux Sanguin")').prop('title',
'Apprenti ' + Math.floor((skills.PV/30) ) + 'D3' +
' Compagnon ' + Math.floor((skills.PV/25) ) + 'D3' +
' Maître ' + Math.floor((skills.PV/20) ) + 'D3' +
' Grand Maître ' + Math.floor((skills.PV/15) )+ 'D3') ;
});
$( document ).ready(function() {
$('a:contains("Appel des Ombres")').prop('title',
'Apprenti......' + ' MT +' + (skills.MTP/2)+ ' | ' + ' RT +0 ' + ' | ' + ' MP +0 ' + ' | ' + ' RT -' + (skills.RPP/2) +
' Compagnon......' + ' MT +' + (skills.MTP)+ ' | ' + ' RT +0 '+ ' | ' + ' MP +0 '+ ' | ' + ' RP -' + (skills.RPP) +
' Maître......' + ' MT +' + (skills.MTP)+ ' | ' + ' RT +' + (skills.RTP/2) + ' | ' + ' MP -' +(skills.MPP/2) + ' | ' + ' RP -' + (skills.RPP) +
' Grand Maître......' + ' MT +' + (skills.MTP)+ ' | ' + ' RT +' + (skills.RTP)+ ' | ' + ' MP -' +(skills.MPP)+ ' | ' + ' RP-' + (skills.RPP));
});
$( document ).ready(function() {
$('a:contains("Appel de la Nature")').prop('title',
'Apprenti......' + ' MS +' + (skills.MSP/2)+ ' | ' + ' RS +0 ' + ' | ' + ' MC +0 ' + ' | ' + ' RC -' + (skills.RCP/2) +
' Compagnon......' + ' MS +' + (skills.MSP)+ ' | ' + ' RS +0 '+ ' | ' + ' MC +0 '+ ' | ' + ' RC -' + (skills.RCP) +
' Maître......' + ' MS +' + (skills.MSP)+ ' | ' + ' RS +' + (skills.RSP/2) + ' | ' + ' MC -' +(skills.MCP/2) + ' | ' + ' RC -' + (skills.RCP) +
' Grand Maître......' + ' MS +' + (skills.MSP)+ ' | ' + ' RS +' + (skills.RSP)+ ' | ' + ' MC -' +(skills.MCP)+ ' | ' + ' RC -' + (skills.RCP));
});
$( document ).ready(function() {
$('a:contains("Connaissance des Monstres")').prop('title', 'portée : ' + (Math.floor((+skills.PER)+(+skills.PERM)+(+skills.PERP))));
});
$( document ).ready(function() {
$('a:contains("Projectile")').prop('title',
' ATT ' + Math.floor(((skills.PER/2 + skills.ATT/2)) - Math.max(0,2/4-0)) + 'D6 +' + ( skills.PERM/2 ) +
' DEG ' + Math.floor((skills.PER/2 + skills.ATT/2)) + 'D3 +' + (skills.ATTM/2 + skills.PERM/2 ));
});
$( document ).ready(function() {
$('a:contains("Baratin")').prop('title',
' Apprenti full ' + Math.floor((skills.PER)/5 + (skills.REG)/5)+'D6' +
' Compagnon full ' + Math.floor((skills.PER)/4 + (skills.REG)/5) +'D6' +
' Maître full ' + Math.floor((skills.PER)/3 + (skills.REG)/5)+'D6' +
' Grand Maître full ' + Math.floor((skills.PER)/2 + (skills.REG)/5)+'D6');
});
$( document ).ready(function() {
$('a:contains("Chirurgie")').prop('title',
'Apprenti ' + Math.floor((3/2)*skills.REG) + 'D3'+
' Compagnon ' + Math.floor((4/2)*skills.REG) + 'D3'+
' Maître ' + Math.floor((5/2)*skills.REG) + 'D3'+
' Grand Maître ' + Math.floor((6/2)*skills.REG) + 'D3');
});
$( document ).ready(function() {
$('a:contains("Téléportation")').prop('title',
'Apprenti ' + 'Portée horizontale : ' + Math.floor((Math.sqrt((19+8*((skills.MM)*1)/5+3)-7)/2 + 20 + +skills.PER + +skills.PERM)) + ' Portée verticale : ' + Math.floor(((Math.sqrt(((19+8*(skills.MM*1)/5+3)-7)/2))/3)+3)) ;
});
$( document ).ready(function() {
$('a:contains("Double Dague")').prop('title',
'Grand Maître : 1ere attaque : ' + skills.ATT+ 'D6'+ '+' + skills.ATTP*1+ '+' + +skills.ATTM +
' 2eme attaque : ' + Math.floor(skills.ATT-+skills.ATT*0.25) + 'D6'+ '+' + Math.floor(skills.ATTP*1*0.25)+ '+' + Math.floor(skills.ATTM*0.25) +
' 3eme attaque : ' + Math.floor(skills.ATT-+skills.ATT*0.5) + 'D6'+ '+' + Math.floor(skills.ATTP*1*0.5)+ '+' + Math.floor(skills.ATTM*0.5) +
' 4eme attaque : ' + Math.floor(skills.ATT-+skills.ATT*0.75) + 'D6'+ '+' + Math.floor(skills.ATTP*1*0.75)+ '+' + Math.floor(skills.ATTM*0.75) +
' Dégâts : ' + skills.DEG + 'D3'+ '+' + Math.floor(skills.DEGP*1.5)+ '+' + Math.floor(skills.DEGM)) ;
});
$( document ).ready(function() {
$('a:contains("Alchimie")').prop('title',
'Apprenti : 1ere attaque' + skills.ATTP);
});
//====================================================================================
/// Décocher par défaut la case activer sa DLA sur la page de Log-In piqué a Seishin
//====================================================================================
(function() {
'use strict';
$('input[type=checkbox][name=aDLA]').prop( "checked", false);
})();
//===================================================
// Décocher par défaut le vestaire piqué a Seishin
//===================================================
(function() {
'use strict';
$('input[type=checkbox][name=VESTIAIRE]').prop( "checked", false );
})();
//====================================================================================
///Info Bulle CdM (en construction a faire une fois la base de données cdm solide)
//====================================================================================
$( document ).ready(function() {
$('a:contains("Abishaii Bleu")').prop('title', 'XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX XXX');});
//====================================================================================
///fonction principale pour remplacer le texte et ajouter des icones dans Gobland
//====================================================================================
(function () {
'use strict';
var words = {
///les mots a changer/améliorer + icones
'((286|386|387|393|46237|95720|130171|46237|47717|95720|130171|53|101759|101|50127|95982|108284|100794|94082|108|121|129|141|180|48520|66516|69423|119472|32954|))' : '🥰', // Clan et CM
'Champi-Glouton' : 'Champi-Glouton 👾', // Monstres manque CdM
'Basilic': 'Basilic 👾',
'Gnu Sauvage': 'Gnu Sauvage 👾',
'Mille-pattes géant': 'Mille-pattes géant 👾',
'Erinyes': 'Erinyes 👾',
'Gnoll': 'Gnoll 👾',
'Halfelin': 'Halfelin 👾',
'Momie': 'Momie 👾',
'Monstre Rouilleur': 'Monstre Rouilleur 👾',
'Galopin': 'Galopin 👾',
'Gargouille': 'Gargouille 👾',
'Incube': 'Incube 👾',
'Succube': 'Succube 👾',
'Babélien': 'Babélien 👾',
'Golem de Chair': 'Golem de Chair 👾',
'Homme-Lézard': 'Homme-Lézard 👾',
'Méphite de Feu': 'Méphite de Feu 👾',
'Naga': 'Naga 👾',
'Ogre': 'Ogre 👾',
'Ondine': 'Ondine 👾',
'Rat-garou': 'Rat-garou 👾',
'Scorpion Géant': 'Scorpion Géant 👾',
'Oni': 'Oni 🎯', //gros monstres (liste a completer)
'Marid': 'Marid 🎯',
'Vampire': 'Vampire 🎯',
'Megantereon': 'Megantereon 🎯',
'Automate': 'Automate 🎯',
'Viverne': 'Viverne 🎯',
'Homothérium': 'Homothérium 🎯',
'Horreur chasseresse': 'Horreur chasseresse 🎯',
'Behemoth': 'Behemoth🎯',
'Sphinx': 'Sphinx 🎯',
'Cerbère': 'Cerbère 🎯',
'Légion-en-peine' : 'Légion-en-peine🎯',
'Danseur de Mort' : 'Danseur de Mort🎯',
'Chimère' : 'Chimère🎯',
'Tarasque': 'Tarasque🎯',
'Hydre': 'Hydre🎯',
'Balrog': 'Balrog🎯',
'Dragon': 'Dragon🎯',
'Phoenix': 'Phoenix🎯',
'Vampire Archaïque': 'Vampire Archaïque🎯',
'Troll': 'Troll🎯',
'Barghest' : 'Barghest🎯',
'Potion' : 'Potion 🧪', //icones équipement
'Parchemin' : 'Parchemin 📜',
'CT| Canines de Trõll' : ' CT 💰',
'Anneau' : 'Anneau 💍 ',
'Bouclier' : 'Bouclier 🛡️',
'Corps' : 'Corps ☠️',
'Arme 1 Main' : 'Arme 1 main 🗡️',
'Ankheg' : 'Ankheg 👨🍳', //monstre a cuisiner (insectes)
'Araignée Géante' : 'Araignée Géante 👨🍳',
'Brontoscorpion' : 'Brontoscorpion 👨🍳',
'Fourmi Guerrière' : 'Fourmi Guerrière 👨🍳',
'Fourmi Ouvrière' : 'Fourmi Ouvrière 👨🍳',
'Guêpe géante' : 'Guêpe géante 👨🍳',
'Limace Géante' : 'Limace Géante 👨🍳',
'Mante religieuse géante' : 'Mante religieuse géante 👨🍳',
'Meganeura' : 'Meganeura 👨🍳',
'Mille-pattes géant' : 'Mille-pattes géant 👨🍳',
'Nuage dinsectes' : 'Nuage dinsectes 👨🍳',
'Nuée de Vermines' : 'Nuée de Vermines 👨🍳',
'Reine Fourmi' : 'Reine Fourmi 👨🍳',
'Scarabée Géant' : 'Scarabée Géant 👨🍳',
'Scorpion Géant' : 'Scorpion Géant 👨🍳',
'Strige': 'Strige 👨🍳',
'Thri-kreen': 'Thri-kreen 👨🍳',
'Baguette' : 'Baguette 🪄 ',
'Escalier' : 'Escalier 🪜 ',
'Baie' : 'Baie 🫐',
'Zone de ténèbres' : 'Zone de ténèbres 🌫️',
'Porte' : 'Porte 🚪',
//Mon Profil
//'Perception' : 'PER 👁️' ,
'Santé' : 'Santé ❤️',
'Echéance du Tour' : 'Echéance du Tour⏱️',
'Combat' : 'Combat ⚔️',
'Affinités' : 'Affinités ✨',
///'Apprenti': 'Apprenti 1️⃣',
///'Compagnon':'Compagnon 2️⃣',
///'Grand Maître':'Grand Maître 4️⃣',
///'Maître':'Maître 3️⃣',
'':''};
///enclenchement des remplacements et ajouts d'icones
var regexs = [], replacements = [],
tagsWhitelist = ['PRE', 'BLOCKQUOTE', 'CODE', 'INPUT', 'BUTTON', 'TEXTAREA'],
rIsRegexp = /^\/(.+)\/([gim]+)?$/,
word, text, texts, i, userRegexp;
function prepareRegex(string) {
return string.replace(/(\({2}|([\[\]\^\&\$\.\?\/\\\+\{\}])|\)$)/g, '\\$1');
}
function isTagOk(tag) {
return tagsWhitelist.indexOf(tag) === -1;
}
for (word in words) {
if ( typeof word === 'string' && words.hasOwnProperty(word) ) {
userRegexp = word.match(rIsRegexp);
// add the search/needle/query
if (userRegexp) {
regexs.push(new RegExp(userRegexp[1], 'g'));
} else {
regexs.push(
new RegExp(prepareRegex(word).replace(/\\?\*/g, function (fullMatch) {
return fullMatch === '\\*' ? '*' : '[^ ]*';
}), 'g')
);
}
replacements.push(words[word]);
}
}
texts = document.evaluate('//body//text()[ normalize-space(.) != "" ]', document, null, 6, null);
for (i = 0; text = texts.snapshotItem(i); i += 1) {
if ( tagsWhitelist.indexOf(text.parentNode.tagName) ) {
regexs.forEach(function (value, index) {
text.data = text.data.replace( value, replacements[index] );
});
}
}
}());
///fonction principale pour remplacer le texte et ajouter des icones dans Gobland(fin)
///---------------------------------------------------------------------------------------------///
//===============================================================
// R E C U P D E S I N F O S P A G E P R O F I L
//===============================================================
// calcul du nombre d'entrainement pour passer au lvl sup
var gobExperience = $('th:contains("Expérience")').parent().closest('tr');
var tdExp = $('td:first', gobExperience);
var sExp = tdExp.html();
res = sExp.match(/: (\d+) \((\d+) PI \| Niveau (\d+) : (\d+)/);
var nbTrain = Math.ceil((res[4].valueOf() - res[2].valueOf())/( 2 * res[1].valueOf()));
var pExp = sExp.indexOf(")");
var sTrain = (nbTrain > 1) ? " entraînements" : " entraînement";
tdExp.html(sExp.substr(0, pExp + 1 ) + " ---> Il te reste " + nbTrain + sTrain + sExp.substr(pExp + 1));
/// RECUP DES CARACS
var skills = {};
// Recup position et PER
var gobPosition = $('th:contains("Position")').parent().closest('tr').text();
var pos = gobPosition.match(/X = ([-]*\d+) \| Y = ([-]*\d+) \| N = ([-]*\d+)/);
skills.X = pos[1];
skills.Y = pos[2];
skills.N = pos[3];
var per = gobPosition.match(/Perception......: (\d+)/);
skills.PER = per[1];
var perp = gobPosition.match(/Cases (\W(\d+))/);
skills.PERP = perp[1];
var perm = gobPosition.match(/Cases (\W(\d+))(\W(\d+))/);
skills.PERM = perm[3];
// Recup PV, PVMax et REG
var gobSante = $('th:contains("Santé")').parent().closest('tr');
var tdSante = $('td:first', gobSante);
res = tdSante.html().split(/<BR>/i); //gobSante.match(/: (\d+)([^:]+): (\d+)([^:]+): (\d+)/);
skills.PV = res[0].match(/: (\d+)/)[1];
skills.PVMax = res[1].match(/: (\d+)/)[1];
// skills.REG = $('span#reg').html();
var regensgob = $('td:contains("Régénération")').parent().closest('tr').text();
var reg = regensgob.match(/Régénération..: (\d+)/);
skills.REG = reg[1];
var regp = regensgob.match(/D3(\W(\d+))/);
skills.REGP = regp[1];
var regm = regensgob.match(/D3(\W(\d+))(\W(\d+))/);
skills.REGM = regm[3];
/// recup DEG
var degatsgob = $('div:contains("Dégâts")').parent().closest('tr').text();
var deg = degatsgob.match(/: (\d+)/);
skills.DEG = deg[1];
var degp = degatsgob.match(/D3(\W(\d+))/);
skills.DEGP = degp[1];
var degm = degatsgob.match(/D3(\W(\d+))(\W(\d+))/);
skills.DEGM = degm[3];
/// recup ARM
var armuresgob = $('div:contains("Armure")').parent().closest('tr').text();
var armp = armuresgob.match(/Armure.....: (\d+)/);
skills.ARMP = armp[1];
var armm = armuresgob.match(/Armure.....: (\d+)(\W)(\d+)/);
skills.ARMM = armm[3];
/// recup ATT
var attaquesgob = $('td:contains("Attaque")').parent().closest('tr').text();
var att = attaquesgob.match(/Attaque.....: (\d+)/);
skills.ATT = att[1];
var attp = attaquesgob.match(/Attaque.....: (\d+)D6(\W(\d+))/);
skills.ATTP = attp[2];
var attm = attaquesgob.match(/Attaque.....: (\d+)D6(\W(\d+))(\W(\d+))/);
skills.ATTM = attm[4];
/// recup ESQ
var esquivesgob = $('td:contains("Esquive")').parent().closest('tr').text();
var esq = esquivesgob.match(/Esquive....: (\d+)/);
skills.ESQ = esq[1];
var esqp = esquivesgob.match(/Esquive....: (\d+)D6(\W(\d+))(\W)(\d+)/);
skills.ESQP = esqp[2];
var esqm = esquivesgob.match(/Esquive....: (\d+)D6(\W)(\d+)(\W(\d+))/);
skills.ESQM = esqm[4];
///recup Magies (a finir)
skills.RM = $('td.invisible:contains("(RM)")').next('td').text().match(/= ([-]*\d+)/)[1];
skills.RMP = $('td.invisible:contains("(RM)")').next('td').text().match(/(\d+)(\W(\d+))/)[1];
skills.RMM = $('td.invisible:contains("(RM)")').next('td').text().match(/(\d+)(\W(\d+))/)[2];
skills.MM = $('td.invisible:contains("(MM)")').next('td').text().match(/= ([-]*\d+)/)[1];
skills.MMP = $('td.invisible:contains("(MM)")').next('td').text().match(/(\d+)(\W(\d+))/)[1];
skills.MMM = $('td.invisible:contains("(MM)")').next('td').text().match(/(\d+)(\W(\d+))/)[2];
skills.RS = $('td.invisible:contains("(RS)")').next('td').text().match(/= ([-]*\d+)/)[1];
skills.RSP = $('td.invisible:contains("(RS)")').next('td').text().match(/(\d+)(\W(\d+))/)[1];
skills.RSM = $('td.invisible:contains("(RS)")').next('td').text().match(/(\d+)(\W(\d+))/)[2];
skills.MS = $('td.invisible:contains("(MS)")').next('td').text().match(/= ([-]*\d+)/)[1];
skills.MSP = $('td.invisible:contains("(MS)")').next('td').text().match(/(\d+)(\W(\d+))/)[1];
skills.MSM = $('td.invisible:contains("(MS)")').next('td').text().match(/(\d+)(\W(\d+))/)[2];
skills.RT = $('td.invisible:contains("(RT)")').next('td').text().match(/= ([-]*\d+)/)[1];
skills.RTP = $('td.invisible:contains("(RT)")').next('td').text().match(/(\d+)(\W(\d+))/)[1];
skills.RTM = $('td.invisible:contains("(RT)")').next('td').text().match(/(\d+)(\W(\d+))/)[2];
skills.MT = $('td.invisible:contains("(MT)")').next('td').text().match(/= ([-]*\d+)/)[1];
skills.MTP = $('td.invisible:contains("(MT)")').next('td').text().match(/(\d+)(\W(\d+))/)[1];
skills.MTM = $('td.invisible:contains("(MT)")').next('td').text().match(/(\d+)(\W(\d+))/)[2];
skills.RC = $('td.invisible:contains("(RC)")').next('td').text().match(/= ([-]*\d+)/)[1];
skills.RCP = $('td.invisible:contains("(RC)")').next('td').text().match(/(\d+)(\W(\d+))/)[1];
skills.RCM = $('td.invisible:contains("(RC)")').next('td').text().match(/(\d+)(\W(\d+))/)[2];
skills.MC = $('td.invisible:contains("(RT)")').next('td').text().match(/= ([-]*\d+)/)[1];
skills.MCP = $('td.invisible:contains("(RT)")').next('td').text().match(/(\d+)(\W(\d+))/)[1];
skills.MCM = $('td.invisible:contains("(RT)")').next('td').text().match(/(\d+)(\W(\d+))/)[2];
skills.RP = $('td.invisible:contains("(RP)")').next('td').text().match(/= ([-]*\d+)/)[1];
skills.RPP = $('td.invisible:contains("(RP)")').next('td').text().match(/(\d+)(\W(\d+))/)[1];
skills.RPM = $('td.invisible:contains("(RP)")').next('td').text().match(/(\d+)(\W(\d+))/)[2];
skills.MP = $('td.invisible:contains("(MP)")').next('td').text().match(/= ([-]*\d+)/)[1];
skills.MPP = $('td.invisible:contains("(MP)")').next('td').text().match(/(\d+)(\W(\d+))/)[1];
skills.MPM = $('td.invisible:contains("(MP)")').next('td').text().match(/(\d+)(\W(\d+))/)[2];
skills.RR = $('td.invisible:contains("(RR)")').next('td').text().match(/= ([-]*\d+)/)[1];
skills.RRP = $('td.invisible:contains("(RR)")').next('td').text().match(/(\d+)(\W(\d+))/)[1];
skills.RRM = $('td.invisible:contains("(RR)")').next('td').text().match(/(\d+)(\W(\d+))/)[2];
// var tNiveaux = { "(Apprenti)" : 1,
// "(Compagnon)" : 2,
// "(Maître)" : 3,
// "(Grand Maître)" : 4 };