Loot Statistics/Code

//Based on: Updated on January 2, 2010 http://tibiacalc.vndv.com/loot.txt  var current_tibia_version = 8.54; /* Code used for Loot_Statistics */

var ajax_load_bar = new Image; ajax_load_bar.src = "http://images3.wikia.nocookie.net/dantest/images/d/de/Ajax_Load_Bar.gif";

function gebi (id) { return document.getElementById(id); } function hebi (id) { gebi(id).style.display = 'none'; } function sebi (id, b) { gebi(id).style.display = (b ? 'block' : 'inline'); } function shebi (id, bt, a, b) { var d = gebi(id).style.display; gebi(id).style.display = (d == 'none' ? 'inline' : 'none'); if (typeof bt != 'undefined') { bt.value = (d == 'none' ? b : a); } } hebi('lootparser_loot'); hebi('lootparser_add');

function trim (str) { str = str.replace(/^\s\s*/, ''); var ws = /\s/, i = str.length; while (ws.test(str.charAt(--i))){} return str.slice(0, i + 1); } function stripslashes (str) { return (str+).replace(/\\(.?)/g, function (s, n1) {   switch (n1) {      case '\\': return '\\';      case : return '';      default: return n1;    }  }); } function is_numeric (v) { v = parseFloat(v); return (typeof v === 'number' && !isNaN(v)); } function ucwords (str) { str = (str+'').replace(/^(.)|\s(.)/g, function ($1) { return $1.toUpperCase; }); return str.replace(' Of The ', ' of the '); } function array_sort (inputArr, numeric, by_key, reverse) { var tmp_arr={}, valArr=[], keyArr=[], keys=[], sorter, i, k, populateArr = []; if (typeof by_key == 'undefined') { by_key = false;} if (typeof reverse == 'undefined') { reverse = false;} if (typeof numeric == 'undefined') { numeric = false;} if (numeric) { sorter = function (a, b) { if (a == b) { return 0; } if (a > b) { return (reverse ? -1 : 1); } return (reverse ? 1 : -1); }; } else { sorter = function (a, b) { if (!is_numeric(a) && !is_numeric(b)) { if (a.search(/a[n]? /i) === 0) { a = a.substr(a.indexOf(" ")+1); } if (b.search(/a[n]? /i) === 0) { b = b.substr(b.indexOf(" ")+1); } var ac = (a.substr(0,1).toUpperCase == a.substr(0,1)), bc = (b.substr(0,1).toUpperCase == b.substr(0,1)); if (a == b) { return 0; } if (ac && !bc) { return (reverse ? -1 : 1); } if (!ac && bc) { return (reverse ? 1 : -1); } if (a > b) { return (reverse ? -1 : 1); } return (reverse ? 1 : -1); }     else { a = parseFloat(a) || 0; b = parseFloat(b) || 0; return (reverse ? b - a : a - b); } }; }  if (by_key) { /*Make a list of key names*/ for (k in inputArr) { if (inputArr.hasOwnProperty(k)) { keys.push(k); } } keys.sort(sorter); /*Rebuild array with sorted key names*/ for (i = 0; i < keys.length; i++) { k = keys[i]; tmp_arr[k] = inputArr[k]; } for (i in tmp_arr) { if (tmp_arr.hasOwnProperty(i)) { populateArr[i] = tmp_arr[i]; } } } else { var bubbleSort = function (keyArr, inputArr) { var i, j, tempValue, tempKeyVal; for (i = inputArr.length-2; i >= 0; i--) { for (j = 0; j <= i; j++) { ret = sorter(inputArr[j+1], inputArr[j]); if (ret < 0) { tempValue = inputArr[j]; inputArr[j] = inputArr[j+1]; inputArr[j+1] = tempValue; tempKeyVal = keyArr[j]; keyArr[j] = keyArr[j+1]; keyArr[j+1] = tempKeyVal; }       }      }    }; /*Get key and value arrays*/ for (k in inputArr) { if (inputArr.hasOwnProperty(k)) { valArr.push(inputArr[k]); keyArr.push(k); } } /*Sort our new temporary arrays*/ try { bubbleSort(keyArr, valArr); } catch (e) { return false; } /*Repopulate the old array*/ for (i = 0; i < valArr.length; i++) { populateArr[keyArr[i]] = valArr[i]; } } return populateArr; }

/* a is item name, b is item count */ function wikimarkup(a, b) { a = stripslashes(a); var tmp = (a.indexOf(" ") == -1) ? a.length : a.indexOf(" "); tmp = [a.slice(0, tmp), a.substr(tmp+1)]; if (ucwords(tmp[0]) == "Nothing") { return "|Empty, "+b+"\r\n"; } else if (ucwords(tmp[0]) == "A" || ucwords(tmp[0]) == "An") { return "|"+tmp[1]+", "+b+"\r\n"; } else if (is_numeric(tmp[0])) { /*check if last letter is s*/ var lastletter = tmp[1].substr(-1); if (lastletter == "s") { /*remove the s*/ var itemname = tmp[1].substr(0, tmp[1].length - 1); /*need to check if the last letters are 'ie', so we can replace it with 'y'*/ lastletter = itemname.substr(-2); /*reuse variable, heh*/ if (lastletter == "ie") { var newitemname = itemname.substr(0, itemname.length - 2); newitemname += "y"; return "|"+tmp[0]+" "+itemname+"s, "+b+"\r\n"; }     else { return "|"+tmp[0]+" "+itemname+"s, "+b+"\r\n"; }   }    else { /*leave last letter, it isnt a s!*/ return "|"+tmp[0]+" "+tmp[1]+", "+b+"\r\n"; } }  else { return "|"+a+", "+b+"\r\n"; } }

var newdiv; function lootparser_loot_process { /* start execution time counter */ var starttime = new Date; starttime = starttime.getTime; /* end execution time counter */

/*Cleaning DOM*/ var rdel, i = 0, results = document.getElementById('lootparser_loot_results'); while ((rdel = gebi('lootparser_loot_results'+i))) { results.removeChild(rdel); i++; } results.innerHTML = ""; gebi('lootparser_loot_totallines').innerHTML = ""; gebi('lootparser_loot_totaltime').innerHTML = ""; /* monsters[x] = y x = monster name y = amount of x killed */ var monsters = {}; /* totalloot[x][y] = z x = monster name y = item name z = item count 1 holds all items seperate 2 will add all items that have the same name */ var totalloot1 = {}; var totalloot2 = {}; /* total amount of gold */ var totalgold = {}; /*lets analyse the data*/ var data = trim(gebi('lootparser_loot_log').value).split("\n"); var totallines = data.length; gebi('lootparser_loot_totallines').innerHTML = "Analysing "+totallines+" lines..."; var x, info, loot, monster; var y, itemlooted, tmp; var lastletter, itemname; for (x in data) { if (!data.hasOwnProperty(x)) { continue; } info = data[x].indexOf("Loot of"); if (info > -1) { info = data[x].substr(info+8); loot = trim(info.substr(info.indexOf(":") + 1)); monster = trim(info.slice(0, info.indexOf(":"))); if (typeof monsters[monster] == 'undefined') { monsters[monster] = 1; } else { monsters[monster]++; } loot = loot.split(","); for (y in loot) { if (!loot.hasOwnProperty(y)) { continue; } /*sorting loot*/ itemlooted = ucwords(trim(loot[y])); /*the name of the looted item, capitalised*/ itemlooted = itemlooted.replace("Of", "of"); /*"of" shouldn't be capitalised*/ if (typeof totalloot1[monster] == 'undefined') { totalloot1[monster] = {}; totalloot2[monster] = {}; } if (typeof totalloot1[monster][itemlooted] == 'undefined') { totalloot1[monster][itemlooted] = 1; } else { totalloot1[monster][itemlooted]++; } /* Start sorting all of the same items for totalloot2 */ tmp = itemlooted.indexOf(" "); tmp = [itemlooted.slice(0, tmp), itemlooted.substr(tmp+1)]; if (ucwords(tmp[0]) == "A" || ucwords(tmp[0]) == "An") { if (tmp[1] == "Gold Coin") {/*add a gold coin*/ if (typeof totalgold[monster] == 'undefined') { totalgold[monster] = 1; } else { totalgold[monster]++; } }         if (typeof totalloot2[monster][tmp[1]] == 'undefined') { totalloot2[monster][tmp[1]] = 1; } else { totalloot2[monster][tmp[1]]++; } }       else if (is_numeric(tmp[0])) { itemlooted = itemlooted.replace("A", "a"); /*"a" shouldn't be capitalised*/ if (tmp[1] == "Gold Coins") {/*increase total amount of gold*/ if (typeof totalgold[monster] == 'undefined') { totalgold[monster] = parseInt(tmp[0], 10); } else { totalgold[monster] += parseInt(tmp[0], 10); } }         lastletter = tmp[1].substr(-1); if (lastletter == "s") { /*remove the s*/ itemname = tmp[1].substr(0, tmp[1].length - 1); /*need to check if the last letters are 'ie', so we can replace it with 'y'*/ lastletter = itemname.substr(-2); /*reuse variable, heh*/ /*need to check if the last letters are 'ie', so we can replace it with 'y'*/ if (lastletter == "ie") { itemname = itemname.substr(0, itemname.length - 2); itemname += "y"; }           else if (lastletter == "ve") { itemname = itemname.substr(0, itemname.length - 2); itemname += "fe"; }           if (typeof totalloot2[monster][itemname] == 'undefined') { totalloot2[monster][itemname] = parseInt(tmp[0], 10); } else { totalloot2[monster][itemname] += parseInt(tmp[0], 10); } }         /*last letter isn't a s*/ else { if (typeof totalloot2[monster][tmp[1]] == 'undefined') { totalloot2[monster][tmp[1]] = parseInt(tmp[0], 10); } else { totalloot2[monster][tmp[1]] += parseInt(tmp[0], 10); } }       }        /*no "a, an" or number, so put full item name*/ else { itemlooted = itemlooted.replace("A", "a"); /*"a" shouldn't be capitalised*/ if (typeof totalloot2[monster][itemlooted] == 'undefined') { totalloot2[monster][itemlooted] = 1; } else { totalloot2[monster][itemlooted]++; } }     }    }  }  var id_inc = 0; var in_tmp = ''; /*Sort*/ totalloot1 = array_sort(totalloot1, false, true); totalloot2 = array_sort(totalloot2, false, true); for (x in totalloot1) { if (totalloot1.hasOwnProperty(x)) { totalloot1[x] = array_sort(totalloot1[x], false, true); } } for (x in totalloot2) { if (totalloot2.hasOwnProperty(x)) { totalloot2[x] = array_sort(totalloot2[x], true, false, true); } } var tl1 = 0; for (x in totalloot2) { if (totalloot2.hasOwnProperty(x)) { tl1++; } } if (tl1 === 0) { results.innerHTML = "No monsters killed!"; } else { newdiv = document.createElement('div'); newdiv.setAttribute('id', 'lootparser_loot_results'+id_inc); newdiv.style.position = 'relative'; id_inc++; var i = 0; for (x in totalloot2) { if (totalloot2.hasOwnProperty(x)) { if ((i / 15) == Math.floor(i / 15)) { if (i !== 0) { in_tmp += ' '; } in_tmp += '     ";    in_tmp = '   ';      newdiv.innerHTML = in_tmp;      results.appendChild(newdiv);      id_inc++;    }  } /* start execution time counter */  var endtime = new Date;   endtime = endtime.getTime;  var totaltime = Math.round((endtime - starttime)*1000);  gebi('lootparser_loot_totaltime').innerHTML = "Calculation made in "+(totaltime/1000000)+" seconds"; /* end execution time counter */ }

/*textold can be an input from a wiki textarea textnew should be generated by lootparser_loot_process Gives alert and returns false on failure*/ function lootparser_add(textold, textnew, wysiwygtag) { var errors = ['Wrong data in input to be added', 'Wrong data in original input', 'Names of creatures doesn\'t match', 'names/kills/version is missing'];

if (typeof wysiwygtag == 'undefined') { wysiwygtag = true; } var textoldo = textold; /*original old text*/ textnew = textnew.slice(textnew.search('{'+'{'), textnew.search('}'+'}')+2);/*Take only the Template part*/ textnew = textnew.slice(textnew.search(/\|/)+1, textnew.search('}'));/*Take only the parameters*/ var textnewa = textnew.split(/[\s]{1,2}\|/);/*make it an warray*/ var textoldao = {}, textnewao = {}, x, tmp; for (x in textnewa) { /*parse values into an associative array*/ if (!textnewa.hasOwnProperty(x)) { continue; } if (textnewa[x].search('=') != -1) { tmp = textnewa[x].split('='); } else if (textnewa[x].search(',') != -1) { tmp = textnewa[x].split(','); } else { alert(errors[0]+'(0)'); return false; } tmp[0] = trim(tmp[0]); tmp[1] = trim(tmp[1]); textnewao[tmp[0]] = tmp[1]; if (tmp[0] == 'name') { textnewao.name = ucwords(textnewao.name); } if (tmp[0] == 'name' || tmp[0] == 'version') { continue; } if (!is_numeric(tmp[1])) { alert(errors[0]+'(1)'); return false; } } /*Looking for matching version number on textold & textnew*/ var matches, vo, vn, textold_match = false; matches = textold.match(/\{\{[\s\S]*?\|[\s]{0,1}version=[\s\S]*?[\s]{0,3}?\|[\s\S]*?\}\}(?:[\s\S]{0,20}Average [\[]{0,2}gold[\]]{0,2}:[\s]{0,3}[\d\.]*[\s]?[\w]{0,6}|[\s\S]*?)/gi); for (x in matches) { if (matches.hasOwnProperty(x)) { vo = matches[x].match(/[\s\S]*version=([\s\S]*?)[\s]{0,3}?\|[\s\S]*/i)[1]; vn = textnew.match(/[\s\S]*version=([\s\S]*?)[\s]{0,3}?\|[\s\S]*/i)[1]; if (vo == vn) { textold_match = matches[x]; break; }   }  }  if (textold_match === false) { textoldao = textnewao; } /*will insert the new loot at beginning of page*/ else { /*will add the new loot to an existing one*/ textold = textold_match; textold = textold.slice(textold.search('{'+'{'), textold.search('}'+'}')+2);/*Take only the Template part*/ textold = textold.slice(textold.search(/\|/)+1, textold.search('}'));/*Take only the parameters*/ var textolda = textold.split(/[\s]{1,2}\|/); for (x in textolda) {/*parse values into an associative array and sum the new loots*/ if (!textolda.hasOwnProperty(x)) { continue; } if (textolda[x].search('=') != -1) { tmp = textolda[x].split('='); } else if (textolda[x].search(',') != -1) { tmp = textolda[x].split(','); } else { alert(errors[1]+'(2)'); return false; } tmp[0] = trim(tmp[0]); tmp[1] = trim(tmp[1]); textoldao[tmp[0]] = trim(tmp[1]); if (tmp[0] == 'version') { continue; } if (tmp[0] == 'name') { textoldao.name = ucwords(textoldao.name); if (textnewao.name != textoldao.name) { alert(errors[2]+'(3)'); return false; } continue; }     if ((!is_numeric(trim(tmp[1])))) { alert(errors[1]+'(4)'); return false; } if (tmp[0] in textnewao) { if (!textnewao.hasOwnProperty(tmp[0])) { continue; } textoldao[tmp[0]] = parseInt(textnewao[tmp[0]], 10) + parseInt(textoldao[tmp[0]], 10); delete textnewao[tmp[0]]; }   }    for (x in textnewao) { if (textnewao.hasOwnProperty(x)) { textoldao[x] = textnewao[x]; } }/*add the loots not present on old loots*/ } /*Generating wiki markup*/ var avgold = Math.round((textoldao['Gold Coin'] / textoldao.kills) *100)/100 || 0; var out = "{"+"{Loot\n"; if ('name' in textoldao && 'kills' in textoldao && 'version' in textoldao) {/*1st values*/ out += '|version=' + textoldao.version + "\n"; out += '|kills=' + textoldao.kills + "\n"; out += '|name=' + textoldao.name + "\n"; if ('Empty' in textoldao) { out += '|Empty=' + textoldao.Empty + "\n"; } delete textoldao.version; delete textoldao.kills; delete textoldao.name; delete textoldao.Empty; } else { alert(errors[3]+'(5)'); return false; } textoldao = array_sort(textoldao, true, true, true); for (x in textoldao) { if (textoldao.hasOwnProperty(x)) { out += '|' + x + ', ' + textoldao[x] + '\n'; } } /*Rest of values*/ out += "}"+"}"; out += '\r\n Average gold: '+ avgold;

var res = (!textold_match ? out+'\n\n\n'+textoldo : textoldo.replace(textold_match, out)); res = (wysiwygtag ? '__NOWYSIWYG__\n\n' : ) + res.replace(/__NOWYSIWYG__/g, );

while (res.search('\r\n\r\n\r\n') != -1) { res = res.replace('\r\n\r\n\r\n', '\r\n\r\n'); } while (res.search('\r\r\r') != -1) { res = res.replace('\r\r\r', '\r\r'); } while (res.search('\n\n\n') != -1) { res = res.replace('\n\n\n', '\n\n'); } while (res.search('&a'+'mp;') != -1) { res = res.replace('&a'+'mp;', '&'); } while (res.search('&l'+'t;') != -1) { res = res.replace('&l'+'t;', '<'); } while (res.search('&g'+'t;') != -1) { res = res.replace('&g'+'t;', '>'); } while (res.search('') != -1) { res = res.replace('', ''); } return res; }

function set_opacity(id, op) { if ((id = gebi(id))) { id.style.opacity = op / 100; id.style.filter = 'alpha(opacity='+op+')'; } }

function upload_to_wikia_end(id, msg) { var i, timer = 0; for (i=80; i>=1; i--) { setTimeout("set_opacity('"+id+"',"+i+")", timer * 4); timer++; } setTimeout("hebi('"+id+"')", 330); setTimeout("alert('"+msg+"')", 340); }

function upload_to_wikia(div_id) { gebi('lootparser_loot_combined_b'+div_id).disabled = true; hebi('lootparser_loot_combined_b'+div_id); hebi('lootparser_loot_combined_t'+div_id); var divtodo = gebi('lootparser_loot_combined'+div_id); /*Function to add data to each monster page*/ var lootparser_ajax_add = function (newtext, monster, wpp) { var lootparser_loot_t; if (typeof (lootparser_loot_t = getXmlHttpRequestObject) == 'boolean') { return; } lootparser_loot_t.onreadystatechange = function { if (lootparser_loot_t.readyState != 4) { return; } upload_to_wikia_end('lootparser_loot_block'+div_id, (lootparser_loot_t.status == 200) ?        'You added current loot view to the statistics page for '+monster :         'Problems found while uploading loot, you may need to check the loot statistics page for '+monster      );/*fade out*/ i = 1; while ((x = gebi('lootparser_loot_combined_b'+i))) { if (x.value == 'Upload') { x.disabled = false; } i++; } };   var bound2 = '--u9NhcWCckcbMykvMxYdPSR'; var bound = '--'+bound2; var params = '\r\n'+bound+'\r\n'+'Content-Disposition: form-data; name="wpCategorySelectWikitext"\r\n\r\n'+'[]'+'\r\n'+ bound+'\r\n'+'Content-Disposition: form-data; name="wpCategorySelectSourceType"\r\n\r\n'+'json'+'\r\n'+ bound+'\r\n'+'Content-Disposition: form-data; name="wpLogin"\r\n\r\n'+'\r\n'+ bound+'\r\n'+'Content-Disposition: form-data; name="wpSection"\r\n\r\n'+'\r\n'+ bound+'\r\n'+'Content-Disposition: form-data; name="wpStarttime"\r\n\r\n'+wpp.wpStarttime+'\r\n'+ bound+'\r\n'+'Content-Disposition: form-data; name="wpEdittime"\r\n\r\n'+wpp.wpEdittime+'\r\n'+ bound+'\r\n'+'Content-Disposition: form-data; name="wpScrolltop"\r\n\r\n'+'0'+'\r\n'+ bound+'\r\n'+'Content-Disposition: form-data; name="wpAutoSummary"\r\n\r\n'+wpp.wpAutoSummary+'\r\n'+ bound+'\r\n'+'Content-Disposition: form-data; name="wpTextbox1"\r\n\r\n'+newtext+'\r\n'+ bound+'\r\n'+'Content-Disposition: form-data; name="csWikitext"\r\n\r\n'+'\r\n'+ bound+'\r\n'+'Content-Disposition: form-data; name="wpSummary"\r\n\r\n'+'Kills added with tibia wikia loot parser'+'\r\n'+ bound+'\r\n'+'Content-Disposition: form-data; name="wpMinoredit"\r\n\r\n'+'1'+'\r\n'+ bound+'\r\n'+'Content-Disposition: form-data; name="wpSave"\r\n\r\n'+'Save page'+'\r\n'+ bound+'\r\n'+'Content-Disposition: form-data; name="wpEditToken"\r\n\r\n'+wpp.wpEditToken+'\r\n'+ bound+'\r\n'+'Content-Disposition: form-data; name="antispam"\r\n\r\n'+wpp.antispam+'\r\n'+ bound+'--'; lootparser_loot_t.open("POST", '/index.php?title='+monster+'/Loot_Statistics&action=submit'); lootparser_loot_t.setRequestHeader("Content-length", params.length); lootparser_loot_t.setRequestHeader("Content-Type", 'multipart/form-data; boundary='+bound2); lootparser_loot_t.send(params); };

/*Function to check data to be added to each monster page*/ var lootparser_ajax_addcheck = function(newtext, monster, div_id) { var lootparser_loot_t; if (typeof (lootparser_loot_t = getXmlHttpRequestObject) == 'boolean') { return; }

var x, i = 1, timer, b_id = 'lootparser_loot_block'+div_id; /*Disabling buttons, overlay div*/ while ((x = gebi('lootparser_loot_combined_b'+i))) { x.disabled = true; i++; } newdiv = document.createElement('div'); newdiv.setAttribute('id', b_id); newdiv.style.display = 'none'; newdiv.style.position = 'absolute'; newdiv.style.top = '0px'; newdiv.style.left = '0px'; newdiv.style.width = '100%'; newdiv.style.height = '100%'; newdiv.style.backgroundColor = '#666666'; newdiv.style.textAlign = 'center'; newdiv.innerHTML = 'Uploading   '; gebi('lootparser_loot_results'+div_id).appendChild(newdiv); set_opacity(b_id, 0); sebi(b_id, true);/*fade in*/ for (i=1; i<=80; i++) { setTimeout("set_opacity('"+b_id+"',"+i+")", timer * 5); timer++; }

lootparser_loot_t.onreadystatechange = function { if (lootparser_loot_t.readyState != 4) { return; } var oldtext = (text = lootparser_loot_t.responseText); if ((oldtext = oldtext.match(/([\s\S]*?)<\/textarea>/i)) === null) { alert('There was a problem trying to get current statistics for '+monster); return false; }     oldtext = trim(oldtext[1]);/*oldtext = wikia textarea contents*/ newtext = newtext.slice(newtext.search('{'+'{'), newtext.search('}'+'}')+2);/*Take only the Template part*/ if ((newtext = lootparser_add(oldtext, newtext)) === false) { return; } var matches, x, wpp = {'wpStarttime':, 'wpEdittime':, 'wpAutoSummary':, 'wpEditToken':, 'antispam':''}; for (x in wpp) {/*Extra data for wikia edits*/ if (wpp.hasOwnProperty(x)) { matches = text.match(new RegExp(']*name=["\']'+x+'["\'][^>]*)>', 'i')); wpp[x] = matches[1].match(/value=["']([\s\S]*?)["']/i)[1] || ''; }     }      lootparser_ajax_add(newtext, monster, wpp); };   lootparser_loot_t.open('GET', '/index.php?title='+monster+'/Loot_Statistics&action=edit'); lootparser_loot_t.send(null); }; var mdata, wdata; i = 1; results = document.getElementById('lootparser_loot_results');

wdata = divtodo.innerHTML; if ((mdata = wdata.match(/\{\{[\s\S]*?name=([\s\S]*?)\|[\s\S]*?\}\}/i)) === null) { alert('There was a problem trying to get statistics from page(2)'); return; } mdata = ucwords(trim(mdata[1])).replace(/ /g,"_"); lootparser_ajax_addcheck(wdata, mdata, div_id); }

function lootparser_add_process { /* start execution time counter */ var starttime = new Date; starttime = starttime.getTime; /* end execution time counter */ var tmp = lootparser_add(gebi('lootparser_add_log1').value, gebi('lootparser_add_log2').value); gebi('lootparser_add_results').value = (!tmp ? '' : tmp); /* start execution time counter */ var endtime = new Date; endtime = endtime.getTime; var totaltime = Math.round((endtime - starttime)*1000); gebi('lootparser_add_totaltime').innerHTML = "Calculation made in "+(totaltime/1000000)+" seconds"; /* end execution time counter */ }

function lootparser_add_init { newdiv = document.createElement('div'); newdiv.setAttribute('id', 'lootparser_add_main1'); newdiv.setAttribute('style', 'display: none;'); newdiv.innerHTML = ' Log Merger '+ 'This one is provided in case you need to manually merge some statistics. '+ 'Copy the "old" loot statistics in the left box, then copy the ones that need to be added to it into the right one. '+ '  '+  ' '+  ' '+  ' '+ ''; document.getElementById('lootparser_add').appendChild(newdiv);

newdiv = document.createElement('div'); newdiv.setAttribute('id', 'lootparser_add_main2'); newdiv.setAttribute('style', 'display: none;'); newdiv.innerHTML = ''+ ' '+  ' '+  '  '+  ' '; document.getElementById('lootparser_add').appendChild(newdiv); document.getElementById('lootparser_add').style.fontSize= '100%'; document.getElementById('lootparser_add').style.border= '1px solid #bfcfcf'; document.getElementById('lootparser_add').style.color = '#000000'; document.getElementById('lootparser_add').style.backgroundColor = '#f9fcff'; document.getElementById('lootparser_add').style.paddingLeft='10px'; document.getElementById('lootparser_add').style.paddingRight='10px'; document.getElementById('lootparser_add').style.paddingTop='5px'; document.getElementById('lootparser_add').style.paddingBottom='5px'; document.getElementById('lootparser_add').style.marginBottom='10px'; sebi('lootparser_add_main1'); } function lootparser_loot_init { newdiv = document.createElement('div'); newdiv.setAttribute('id', 'lootparser_loot_main1'); newdiv.setAttribute('style', 'display: none;'); newdiv.innerHTML = ' Log Analyzer/Uploader '+ 'This page will analyse your Server Log file and will then give you an overview of the monsters killed, and their loot. '+ 'If yu are logged in to wikia it will give you the option to upload statistics to corresponding monster loot statistics page. '+ 'All this is to make your life easier, you do not have to manually count or edit anything. '+ '  '+  'Copy the Server Log in this box: '+ ' '+ ' '+  ' '+ '<input type="button" value="Clear" onclick="gebi(\'lootparser_loot_log\').value = \'\'">'; document.getElementById('lootparser_loot').appendChild(newdiv);

newdiv = document.createElement('div'); newdiv.setAttribute('id', 'lootparser_loot_main2'); newdiv.setAttribute('style', 'display: none;'); newdiv.innerHTML = '<input type="button" value="Go back to the form" onclick="hebi(\'lootparser_loot_main2\'); sebi(\'lootparser_loot_main1\');">'+ ' '+  '<div id="lootparser_loot_totallines"> '+ '<div id="lootparser_loot_results"> '+ ' '+ '<div id="lootparser_loot_totaltime"> '; document.getElementById('lootparser_loot').appendChild(newdiv); document.getElementById('lootparser_loot').style.fontSize= '100%'; document.getElementById('lootparser_loot').style.border= '1px solid #bfcfcf'; document.getElementById('lootparser_loot').style.color = '#000000'; document.getElementById('lootparser_loot').style.backgroundColor = '#f9fcff'; document.getElementById('lootparser_loot').style.paddingLeft='10px'; document.getElementById('lootparser_loot').style.paddingRight='10px'; document.getElementById('lootparser_loot').style.paddingTop='5px'; document.getElementById('lootparser_loot').style.paddingBottom='5px'; document.getElementById('lootparser_loot').style.marginBottom='10px'; sebi('lootparser_loot_main1'); } /* End of Code used for Loot_Statistics */

/*Hide bar and show loot parser */ lootparser_add_init; hebi('lootparser_add_img'); sebi('lootparser_add', true); hebi('lootparser_add_main2'); sebi('lootparser_add_main1');/* Fix for IE*/ lootparser_loot_init; hebi('lootparser_loot_img'); sebi('lootparser_loot', true); hebi('lootparser_loot_main2'); sebi('lootparser_loot_main1');/* Fix for IE*/