// ==UserScript== // @name The West - Tenue [SOM] beta // @namespace http://userscripts.org/scripts/show/95173 // @description Script for The-West: Tenue [SOM - Scripts-O-Maniacs] [Multilingual] - 1.3.2.n // @author Dun [SOM - Scripts-O-Maniacs] - Originally by Puli / Muche - Translate fr Hack Crow // @website http://scripts-o-maniacs.leforum.eu // @include http://*.the-west.*/game.php* // @include http://userscripts.org/scripts/source/95173.meta.js // @version 1.3.2.3 // // @history 1.3.2.3 Inversion case a coche Mode Configuration et diverses modifs (Bug Chrome) // @history 1.3.2.2 Ajout d'un titre dans les selects pour pouvoir changer de tenue modifiée manuellement // @history 1.3.2.2 Signalement des choix TWPro // @history 1.3.2.1 Ajout case a cocher 'Changement sur selection' // @history 1.3.2 Version finalisée Chrome + Firefox + Updater // @history 1.3.1f Version de test pour l'update // @history 1.3.1e Beta Ajout Maj Auto SOM // @history 1.3.1e Correction injection // @history 1.3.1e Compatibilité Chrome // @history 1.3.1d passage SOM (SOM powa ^^ dixit TontonJohn ^^) // @history 1.3.1c Selection possible des set TWPro, corrections mineures, // @history 1.3.1c possibilité de ne pas changer d'arme et monture // @history 1.3.1b Mise en place d'un bouton pour mettre les items selectionné par TWPro si il est présent // @history 1.3.1b mise en place d'icones à la place des boutons // @history 1.3.1b mise en parralele des selects menu et inventaire // @history 1.3.1a Sauvegarde du dernier set utilisé // @history 1.3.1a Mise en place d'un message lorsque l'habillement est complet // @history 1.3.1a diverses modifications mineures // @history 1.3.1a Dorenavant la tenue change des la selection dans le select de l'inventaire. // @history 1.3.1 by Dun - pantalons et ceintures, compatible TW 1.30 // ==/UserScript== // MAJ Auto var tenue_version = "1.3.2.3"; var url = window.location.href; if (url.indexOf(".the-west.") != -1) { var insertBeforeElement = document.getElementById('left_top'); var newScriptElement = document.createElement('script'); newScriptElement.setAttribute('type', 'text/javascript'); var myScript = "var tenue_version = '"+tenue_version+"';"; newScriptElement.innerHTML = myScript; insertBeforeElement.parentNode.insertBefore(newScriptElement, insertBeforeElement); (function(f){var d=document,s=d.createElement('script');s.setAttribute('type','application/javascript');s.textContent = '('+f.toString()+')()';(d.body||d.head||d.documentElement).appendChild(s);s.parentNode.removeChild(s)})(function(){ // FIN MAJ AUTO var Beta = false; var gLang='fr'; // langue par défaut var wardrobe_text={en:'Wardrobe', sk:'Šatník', cz:'Skříň', fr:'Tenue'}; var new_name_text={en:'New name', sk:'Nový názov', cz:'Nový název', fr:'Nouveau nom'}; var cancel_button_text={en:'Cancel', sk:'Zrušiť', cz:'Zrušit', fr:'Annuler'}; var delete_button_text={en:'Delete', sk:'Zmazať', cz:'Smazat', fr:'Supprimer'}; var save_button_text={en:'Save', sk:'Uložiť', cz:'Uložit', fr:'Sauvegarder'}; var tw_button_text={en:'Selection TWPro', sk:'TWPro', cz:'TWPro', fr:'Sélection TWPro'}; var save_message_text={en:'Wardrobe is saved', sk:'Šatník bol uložený', cz:'Skříň byla uložena', fr:'Tenue mise à jour'}; var confirm_overwrite_text={ en:'Do you realy want to overwrite wardrobe ', sk:'Naozaj chceš prepísať oblečenie s názvom ', cz:'Skutečně chceš přepsat oblečení pod názvem ', fr:'Voulez-vous vraiment modifier la tenue ' }; var save_choose_name_error_text={ en:'You must pick "New name" or one existing wardrobe!', sk:'Najprv musíš vybrať položku "Nový názov" alebo už existujúcu položku!', cz:'Musíš nejdřív vybrat položku "Nový název" nebo už existující položku!', fr:'Vous devez choisir "Nouveau nom" ou une tenue existante !' }; var save_invalid_name_error_text={ en:'Wardrobe name contains invalid characters!', sk:'Názov oblečenia obsahuje neplatné znaky!', cz:'Název oblečení obsahuje neplatné znaky!', fr:'Le nom de la tenue contient des caractères invalides !' }; var delete_choose_name_error_text={ en:'You must pick existing wardrobe!', sk:'Najprv musíš vybrať položku!', cz:'Musíš nejdřív vybrat položku!', fr:'Vous devez choisir une tenue existante !' }; var changeOk_text={ en:'Clothing change Ok', sk:'Ok', cz:'Ok', fr:'Changements de vétements effectués' }; var check_rarm_text={ en:'Don\'t change right arm', sk:'Don\'t change right arm', cz:'Don\'t change right arm', fr:'Ne pas changer d\'arme main droite' }; var check_animal_text={ en:'Don\'t change animal', sk:'Don\'t change animal', cz:'Don\'t change animal', fr:'Ne pas changer d\'animal' }; var check_changeonselect={ en:'Configuration Mode', sk:'Configuration Mode', cz:'Configuration Mode', fr:'Mode configuration' }; var error_confmodenotactivated={ en:'Active Configuration Mode for create new set ', sk:'Active Configuration Mode for create new set ', cz:'Active Configuration Mode for create new set ', fr:'Vous devez activer le Mode Configuration pour gerer les sets !' }; var maxRetry=3; var retryPeriod=300; var gQueue = []; var gQueueIndex = 0; var gQueueTimer = 0; var gQueueHPChange = []; var gLocation = window.location.href; var gArmorInputType = 'drop'; var gInputElement = null; var startOnInv= false; var menuButtonImg='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAAAZCAIAAAB2NbEXAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9oEBw4COumCnaoAAA2oSURBVGje7VpNcxxHcn2ZWd09H/gSQQCSqKVWFG0xSMlSOLz22mGvIzYc9kEHH3z0H/Mv8MFXX/a0p3V4vXZYH7sSSe8uSYmiKIAAOMTHzHRXVaYP2d0YARQIRujk8ACHmZqH6kbmy8yXWU0/efdtfK8v1cwsZiZMWc1MmcW/YoKvBBE1mBkRmZmZAiBiImKCggAwTA3AS8AAnEVe8Jb6lXPAR0dzv5BfCwAxE8BEIGPilBX+Ech+P4CqphRVdTQcnYUFAD/44bqFcaB6dWns++acFGJAKWRcGEDaEHxDzGazsgwiRWzqaZNSHcthde/u4z/90ffsy//zr1/95+8DAFVbGfLSeH1lSGVZAZhOZwDG42FRhpRleRSQazObTufTRrE2NCBIyHl0NK0PDqeHxzPf8bPPv7q0vhRC2Nme3Lr5xv0HTx5+udtyTbiuI5GTEgDUwAARgcwMaoAZiIQIgMGEGUDMehHYSQiaMvHiRwBnV7Ii5zwoi1MrZSHfBTbTIgQGsrWBwkwGMAhAV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HCE0GyAy\nGyAxGR4wGR4vGR4vGh8xGyAyGyAyIyw9Iyw9Iyw+ICk7Iys9JC1AGR4wGyAyGyAxGyAxHCE0HCE0\nGyAyGyAyHCI2HCI1HCE0GyAyGyAxGR4wGR4vGR4vGh8xGyAyGyAyIyw9Iyw9Iyw+ICk7Iys9Gh8x\nGyAyGyAyIyw9FRorExgpHCE0HCI1HCI2GyAyGyAyHCE0HCE0AAAA'; //' var ANIMAL = 0, BODY = 1, FOOT = 2, LEFT_ARM = 3, HEAD = 4, YIELD = 5, RIGHT_ARM = 6, NECK = 7; PANTS = 8, BELT = 9; (function(){ var pos = gLocation.indexOf("//"); var lang = gLocation.substring(pos+2, pos+4); if (wardrobe_text[lang]) { gLang=lang; } }()); function debug(text){ if(Beta){ alert(text); } } function isNull(variable) { return (typeof(variable) === "undefined" || variable === null) ? true : false; } function shouldWear(wearItem){ if(isNull(wearItem)){ return false; } return true; } function trim(str) { return str.replace(/^\s+/, '').replace(/\s+$/, ''); } function getServer(loc) { loc = loc.substring(loc.indexOf('//')+2); loc = loc.substring(0, loc.indexOf('/')); return loc; } function insertAfter(newNode, referenceNode) { referenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling); } function hideElement(element) { element.style.display='none'; } function showElement(element) { element.style.display='block'; } function isElementHidden(element) { return element.style.display !== 'block'; } function removeElement(el) { el.parentNode.removeChild(el); } function getArmorSet(setName) { return localStorage.getItem(getServer(gLocation)+'_'+Character.name+'_'+setName); } function setArmorSet(setName, value) { localStorage.setItem(getServer(gLocation)+'_'+Character.name+'_'+setName, value); } function removeArmorSet(setName) { /* if (GM_deleteValue) { GM_deleteValue(getServer(gLocation)+'_'+Character.name+'_'+setName); } else { GM_setValue(getServer(gLocation)+'_'+unsafeWindow.Character.name+'_'+setName, ''); }*/ localStorage.setItem(getServer(gLocation)+'_'+Character.name+'_'+setName, ''); } function getListOfSets() { var lst = localStorage.getItem(getServer(gLocation)+'_'+Character.name+':listOfSets'); if(isNull(lst)){ lst=""; } return lst; } function setListOfSets(value) { localStorage.setItem(getServer(gLocation)+'_'+Character.name+':listOfSets', value); } function setLastSet(setName){ localStorage.setItem(getServer(gLocation)+'_'+Character.name+':last', setName); } function getLastSet(){ var last=localStorage.getItem(getServer(gLocation)+'_'+Character.name+':last'); return last; } function toggleElement(element) { if (element.style.display==='none') { showElement(element); alignSelected(getLastSet()); } else { hideElement(element); } } // check validity of set name - must not contain ';' function isValidSetName(setName) { return (setName.indexOf(';') < 0); } function isInList(list, value, delimiter) { if (delimiter === undefined) { delimiter = ';'; } var pos = list.indexOf(value); if (pos < 0) { return false; } // check if value is one whole item, not just part of a item if (pos > 0 && list[pos - 1] !== delimiter) { // non-delimiter before return false; } if (pos + value.length < list.length && list[pos + value.length] !== delimiter) { // non-delimiter after return false; } return true; } // select given set name in menu dropdown function selectMenuDropDown() { var dropDown = document.getElementById('armorset_combobox'); if (isNull(dropDown)) { return false; } if (gArmorInputType !== 'drop' || isNull(gInputElement) || isNull(gInputElement.options)) { return false; } var selected = gInputElement.options[gInputElement.selectedIndex]; //debug("selectMenuDropDown " + selected.value ); return alignSelected(selected.value); /* if(!isNull(selected)){ var setName = selected.value; var options = dropDown.options; var i; for(var i=0; i<options.length;i++){ // for (i in options) { if (options[i].value === setName) { options[i].selected = true; return true; } } }*/ } function alignSelected(setName){ var pre=" \u25C8 " ; var current; if (isNull(setName)){ return false; } //debug("alignSelected" + setName); if( setName != "" && setName.indexOf(pre)<0){ var checkbox = document.getElementById("changeonselect"); if(!isNull(gInputElement)){ if(!isNull(checkbox) && checkbox.checked){ gInputElement.options[document.getElementById('armorset_combobox').selectedIndex].selected=true; }else{ current = document.getElementById('optcurInv'); if(current){ current.innerHTML = pre + setName; current.setAttribute("style","font-weight:bold;font-style:italic;"); current.selected = true; } } } current = document.getElementById('optcur'); if(current){ //debug(current.value +" " + setName); current.innerHTML = pre + setName; current.setAttribute("style","font-weight:bold;font-style:italic;"); current.selected = true; } return true; } } // select given set name in inventory dropdown function selectInvDropDown(setName) { if (gArmorInputType !== 'drop' || isNull(gInputElement) || isNull(gInputElement.options)) { return false; } /* var options = gInputElement.options; //Bug chrome Dun for (i in options) { for(var i=0; i<options.length;i++){ if (options[i].value === setName) { options[i].selected = true; return true; } }*/ return alignSelected(setName); } function selectInvDropDownFromMenuDropDown() { var dropDown = document.getElementById('armorset_combobox'); if (isNull(dropDown)) { return false; } var option = dropDown.options[dropDown.selectedIndex]; if (gArmorInputType !== 'drop' || isNull(gInputElement) || isNull(gInputElement.options)) { return false; } //debug("selectInvDropDownFromMenuDropDown " + option.value ) return alignSelected(getLastSet());//option.value); //selectInvDropDown(option.value); } function changeToTextBox(elem) { var checkbox = document.getElementById("changeonselect"); var checked = checkbox.checked; if(checked){ gInputElement = document.createElement('input'); gInputElement.style.width = '123px'; insertAfter(gInputElement, elem); removeElement(elem); gInputElement.focus(); gArmorInputType = 'text'; var codb = document.getElementById('wardrobe_cancelOrDelete_button'); if (codb) { //codb.innerHTML = cancel_button_text[gLang]; ajout_com_icone("wardrobe_cancelOrDelete_button", cancel_button_text[gLang]); } }else{ //for Chrome Options can't be hidden alert(error_confmodenotactivated[gLang]); } } function invDropDownOnChange(event) { if (this.selectedIndex == this.length - 1) { // last, i.e. 'New name' option selected changeToTextBox(gInputElement); }else{ // si la case du mode configuratio est decochée var checkbox = document.getElementById("changeonselect"); var check = checkbox.checked; if(!check){ setArmorOptionOnClickInv(this.options[this.selectedIndex].value); } ajout_com_icone("wardrobe_cancelOrDelete_button", delete_button_text[gLang]); } } function createDropInvDropDown() { var list, count, nNewItem, name, pos; // Select de l'inventaire gInputElement = document.createElement('select'); gInputElement.setAttribute("style","background-color:rgb(207, 195, 166);width:127px;"); // gInputElement.setAttribute("id","selSetInv"); gInputElement.addEventListener('change', invDropDownOnChange, false); //dernier set utilisé if(gInputElement.selectedIndex != -1 ){ selected = ( gInputElement.options[gInputElement.selectedIndex].value); //debug(selected); }else{ selected =getLastSet(); } // Remplissage de la liste des sets list = getListOfSets(); count = 0; nNewItem = document.createElement('option'); nNewItem.setAttribute('id','optcurInv'); nNewItem.innerHTML = ''; gInputElement.appendChild(nNewItem); while (list.length > 0) { pos = list.indexOf(';'); if (pos < 0) { name = list; list = ''; } else { name = list.substring(0, pos); list = list.substring(pos + 1); } if (name === '') { // ignore empty set names for backward compatibility continue; } count++; nNewItem = document.createElement('option'); nNewItem.innerHTML = name; // if(last==name){ // } // Non compatible chrome, pas de clic sur les options // nNewItem.addEventListener('click', setArmorOptionOnClickInv, false); gInputElement.appendChild(nNewItem); } // add 'New name' option nNewItem = document.createElement('option'); nNewItem.innerHTML = '... ' + new_name_text[gLang] + ' ...'; nNewItem.setAttribute('id','inputSet'); gInputElement.appendChild(nNewItem); } function changeToDropDown(elem) { //debug("changeToDropDown"); createDropInvDropDown(); insertAfter(gInputElement, elem); removeElement(elem); gArmorInputType = 'drop'; setChangeOnSelect(); gInputElement.focus(); } function addToQueue(action, hpBonus) { gQueue.push(action); gQueueHPChange.push(hpBonus); } function sortQueue() { var sortElement = function(a,b) { return b.hp-a.hp; } var lQueue = []; //var i; for(var i=0; i<gQueueHPChange.length;i++){ //Bug chrome Dun - for (i in gQueueHPChange) { lQueue[i] = new Object(); lQueue[i].item = gQueue[i]; lQueue[i].hp = gQueueHPChange[i]; } lQueue = lQueue.sort(sortElement); // recreate gQueue in new order gQueue = []; gQueueHPChange = []; var str=""; //Bug chrome Dun - for (i in lQueue) for(var i=0; i<lQueue.length;i++){ str+=lQueue[i]; addToQueue(lQueue[i].item, lQueue[i].hp); } } function isUncarryAction(action) { return ((action === 'head') || (action === 'left_arm') || (action === 'body') || (action === 'right_arm') || (action === 'yield') || (action === 'foot') || (action === 'neck') || (action === 'animal')|| (action === 'pants') || (action === 'belt') ); } function executeQueue(retry) { //debug("Entree executeQueue"); gQueueTimer = 0; if (isNull(retry)) { retry=0; } if (gQueue.length === 0) { // queue finished, select set name in inventory's dropdown /* if(startOnInv){ selectMenuDropDown(); }else{ selectInvDropDownFromMenuDropDown(); }*/ alignSelected(getLastSet()); new HumanMessage(changeOk_text[gLang], {type:'success'}); return; } if (retry >= maxRetry) { // retries failed, skipping item gQueueIndex++; if(gQueueIndex >= gQueue.length) { gQueueIndex=0; gQueue = []; gQueueHPChange = []; return; } } if (gQueueIndex >= gQueue.length) { // index out of bounds gQueueIndex=0; gQueue = []; gQueueHPChange = []; return; } var ok = false, found; var items, itemWearing; if (isUncarryAction(gQueue[gQueueIndex])){ ok = Wear.uncarry(gQueue[gQueueIndex]); found = true; } else { items = Bag.getInstance().items; found = false; for (var i in items) { if (items[i].get_short() === gQueue[gQueueIndex]) { found = true; itemWearing = Wear.wear[i]; if (!isNull(itemWearing) && itemWearing.get_short() === gQueue[gQueueIndex]) { ok = true; break; } ok = Bag.getInstance().carry(i); break; } } } if (found && !ok) { // something bad happened, try again - Dun bug si on ferme l'inventaire, crash sur le wear gQueueTimer = setTimeout(function () {executeQueue(retry+1);}, retryPeriod*(retry+1)*2); return; } // proceed to next item in queue gQueueIndex++; if (gQueueIndex >= gQueue.length) { // queue finished, select set name in inventory's dropdown gQueueIndex = 0; gQueue = []; gQueueHPChange = []; /*if(startOnInv){ selectMenuDropDown(); }else{ selectInvDropDownFromMenuDropDown(); }*/ alignSelected(getLastSet()); new HumanMessage(changeOk_text[gLang], {type:'success'}); return; } gQueueTimer = setTimeout(function () {executeQueue();}, retryPeriod); } function getHPBonus(id, isBagItem) { var item = null; if(!isBagItem) item = Wear.get(id); else var i; var items = Bag.getInstance().items; for(var i=0; i<items.length;i++){ //Bug chrome Dun - for (i in items) { if (items[i].get_short() === id) { item = items[i]; break; } } if (isNull(item)) return 0; var str = 0; var hp = 0; var setStr = 0; // not implemented yet var setHP = 0; // not implemented yet try { str = item.obj.bonus.attributes.strength; if (isNull(str)) str = 0; } catch(e) {} try { hp = item.obj.bonus.skills.health; if (isNull(hp)) hp = 0; } catch(e) {} return str+hp+setStr+setHP; } function setArmorHelper(name, wanted, element) { if (wanted) { if (isNull(element) || element.get_short() !== wanted) { addToQueue(wanted, getHPBonus(wanted, true)-getHPBonus(name, false)); } } else { if (!isNull(element)) { addToQueue(name, 0-getHPBonus(name, false)); // TODO set items needs to affect this line more } } } function checkChangeable(){ var setArm=new Array(); //initialisation avec les items portés pour pas supprimer un item déja porté wearBag= Wear.wear; if(shouldWear(wearBag.animal)) setArm[ANIMAL]=wearBag.animal.obj['short']; if(shouldWear(wearBag.body)) setArm[BODY]=wearBag.body.obj['short']; if(shouldWear(wearBag.foot)) setArm[FOOT]=wearBag.foot.obj['short']; if(shouldWear(wearBag.head)) setArm[HEAD]=wearBag.head.obj['short']; if(shouldWear(wearBag.left_arm)) setArm[LEFT_ARM]=wearBag.left_arm.obj['short']; if(shouldWear(wearBag.yield)) setArm[YIELD]=wearBag.yield.obj['short']; if(shouldWear(wearBag.right_arm)) setArm[RIGHT_ARM]=wearBag.right_arm.obj['short']; if(shouldWear(wearBag.neck)) setArm[NECK]=wearBag.neck.obj['short']; if(shouldWear(wearBag.pants)) setArm[PANTS]=wearBag.pants.obj['short']; if(shouldWear(wearBag.belt)) setArm[BELT]=wearBag.belt.obj['short']; return setArm; } // Function de changement a partir des sets twpro function wearSelected() { var visible = false; var bag_items = Bag.getInstance().items; var wearBag = Wear.wear; var setArm = checkChangeable(); var setSelected = (twpro_toggle_set!=0); var changeAnimal = !(document.getElementById("checkAnimal").checked); var changeRArm = !(document.getElementById("checkRArm").checked); var twproValue = "Set TWPro"; for (var w in bag_items) { var bag_obj =bag_items[w].obj; var inner= bag_obj.twpro_html['innerHTML']; var style= bag_obj.twpro_html['style']; //Si le filtre set TWPro est actif if(twpro_toggle_set!=0){ visible =(style.display=='') ; //var twProSet=document.getElementById('twpro_jobList'); twproValue= TWPro.set_names[twpro_toggle_set]; }else{ var twProSet=document.getElementById('twpro_jobList'); twproValue=twProSet.options[twProSet.selectedIndex].text; visible = (inner.indexOf("highlight")>0); } if(visible){ switch (bag_obj['type']) { case "animal": if(changeAnimal){ setArm[ANIMAL]=bag_obj['short']; } break; case "body": setArm[BODY]=bag_obj['short']; break; case "foot": setArm[FOOT]=bag_obj['short']; break; case "head": setArm[HEAD]=bag_obj['short']; break; case "left_arm": setArm[LEFT_ARM]=bag_obj['short']; break; case "yield": setArm[YIELD]=bag_obj['short']; break; case "right_arm": if(changeRArm){ setArm[RIGHT_ARM]=bag_obj['short']; } break; case "neck": setArm[NECK]=bag_obj['short']; break; case "pants": setArm[PANTS]=bag_obj['short']; break; case "belt": setArm[BELT]=bag_obj['short']; break; default: break; } } } //création de la chaine de set var setTWPro=setArm.join(":"); //debug("set TWPro = " + setTWPro); setArmor(setTWPro); //debug("TWPro Value " + twproValue); alignSelected("TWPro : " + twproValue); setLastSet(''); } function setArmor(armorSet) { if (document.getElementById('bag')) { AjaxWindow.maximize('inventory'); } else { AjaxWindow.show('inventory'); setTimeout(function(){addInventoryButtons();}, 100); setTimeout(function(){setArmor(armorSet);}, 1000); return; } // clean old queue window.clearInterval(gQueueTimer); gQueueIndex = 0; gQueue = []; gQueueHPChange = []; var setArray = []; setArray = armorSet.split(':'); //remove wrong clothes and apply right clothes setArmorHelper('animal', setArray[ANIMAL], Wear.wear.animal); setArmorHelper('body', setArray[BODY], Wear.wear.body); setArmorHelper('foot', setArray[FOOT], Wear.wear.foot); setArmorHelper('left_arm', setArray[LEFT_ARM], Wear.wear.left_arm); setArmorHelper('head', setArray[HEAD], Wear.wear.head); setArmorHelper('yield', setArray[YIELD], Wear.wear.yield); setArmorHelper('right_arm', setArray[RIGHT_ARM], Wear.wear.right_arm); setArmorHelper('neck', setArray[NECK], Wear.wear.neck); setArmorHelper('pants', setArray[PANTS], Wear.wear.pants); setArmorHelper('belt', setArray[BELT], Wear.wear.belt); /// sortQueue(); executeQueue(); } function setArmorOptionOnClick(event) { var element = event.target; startOnInv=false; var setName = (element.options[element.selectedIndex].value);//this.value; //debug("setArmorOptionOnClick " + setName); var armorSet = getArmorSet(setName); setArmor(armorSet); setLastSet(setName); } function setArmorOptionOnClickInv(setName) { startOnInv=true; // var setName = (element.options[element.selectedIndex].value);//this.value; var armorSet = getArmorSet(setName); //debug("setArmorOptionOnClickInv " + setName); setArmor(armorSet); setLastSet(setName); } // fill options in selects function createOptionsList(element) { var list, name, nNewItem, selected; /* if(element.selectedIndex != -1 ){ selected = (element.options[element.selectedIndex].value); debug("createOptionsList Selected : " + selected); }else{*/ selected = getLastSet(); //} // remove old options, save the selected while (element.options.length > 0) { element.options[0] = null; } list = getListOfSets(); nNewItem = document.createElement('option'); nNewItem.setAttribute('id','optcur'); nNewItem.selected=true; // nNewItem.addEventListener('clic', setArmorOptionOnClick, false); // nNewItem.innerHTML = '' ; nNewItem.setAttribute("style","font-weight:bold;font-style:italic;"); element.appendChild(nNewItem); while (list.length > 0) { pos = list.indexOf(';'); if (pos < 0) { name = list; list = ''; } else { name = list.substring(0, pos); list = list.substring(pos + 1); } if (name === '') { // ignore empty set names for backward compatibility continue; } nNewItem = document.createElement('option'); // nNewItem.addEventListener('clic', setArmorOptionOnClick, false); nNewItem.innerHTML = name; /*if(name==selected){ nNewItem.selected=true; }*/ element.appendChild(nNewItem); } } function updateDropdown() { var dropDown = document.getElementById('armorset_combobox'); createOptionsList(dropDown); } function findPosY(obj) { var curtop = 0; if(obj.offsetParent) while(1) { curtop += obj.offsetTop; if(!obj.offsetParent) break; obj = obj.offsetParent; } else if(obj.y) curtop += obj.y; return curtop; } // create right menu button & dropdown function createDropdown() { var rightmenu = document.getElementById('right_menu'); var newLI = document.createElement('li'); newLI.setAttribute('id', 'armorset_li'); newLI.innerHTML='<a href="#"><img src="'+menuButtonImg+'" style="z-index:100"/><span style="width: 102px; color: rgb(255, 255, 255); display: block; z-index: 200; font-size: 13px; position: relative; top: -20px; text-align: center; left: 24px; opacity:1.0;">'+wardrobe_text[gLang]+'</span></a>'; rightmenu.appendChild(newLI); var newDropDown = document.createElement('select'); newDropDown.addEventListener('change', setArmorOptionOnClick, false); newDropDown.setAttribute('id', 'armorset_combobox'); newDropDown.style.width = '127px'; newDropDown.style.position = 'relative'; // fix for update 1.27 right_work_bar = document.getElementById('workbar_right'); if (right_work_bar) { newDropDown.style.top = '-22px'; newDropDown.style.left = '-128px'; } hideElement(newDropDown); newLI.addEventListener('click', function(){ createOptionsList(newDropDown); toggleElement(newDropDown); if (!isElementHidden(newDropDown)) { newDropDown.focus(); } }, false); insertAfter(newDropDown, newLI); } function saveArmor() { var list = getListOfSets(); var setName = trim(gInputElement.value); if (setName === '') { if (gArmorInputType === 'drop') { new HumanMessage(save_choose_name_error_text[gLang]); } gInputElement.focus(); return; } if (!isValidSetName(setName)) { new HumanMessage(save_invalid_name_error_text[gLang]); gInputElement.focus(); return; } var bIsInList = isInList(list, setName); if (bIsInList) { // confirm overwrite if (!confirm(confirm_overwrite_text[gLang] + '"' + setName + '" ?')) { gInputElement.focus(); return; } } var l_animal, l_body, l_foot, l_left_arm, l_head, l_yield, l_right_arm, l_neck,l_pant, l_belt; l_animal=l_body=l_foot=l_left_arm=l_head=l_yield=l_right_arm=l_neck=l_pant=l_belt = ''; if (!isNull(Wear.wear.animal)) { l_animal = Wear.wear.animal.get_short(); } if (!isNull(Wear.wear.body)) { l_body = Wear.wear.body.get_short(); } if (!isNull(Wear.wear.foot)) { l_foot = Wear.wear.foot.get_short(); } if (!isNull(Wear.wear.left_arm)) { l_left_arm = Wear.wear.left_arm.get_short(); } if (!isNull(Wear.wear.head)) { l_head = Wear.wear.head.get_short(); } if (!isNull(Wear.wear.yield)) { l_yield = Wear.wear.yield.get_short(); } if (!isNull(Wear.wear.right_arm)) { l_right_arm = Wear.wear.right_arm.get_short(); } if (!isNull(Wear.wear.neck)) { l_neck = Wear.wear.neck.get_short(); } if (!isNull(Wear.wear.pants)) { l_pant = Wear.wear.pants.get_short(); } if (!isNull(Wear.wear.belt)) { l_belt = Wear.wear.belt.get_short(); } setArmorSet(setName, l_animal+':'+l_body+':'+l_foot+':'+l_left_arm+':'+l_head+':'+l_yield+':'+l_right_arm+':'+l_neck+':'+l_pant+':'+l_belt); if (!bIsInList) { if (list === '') { list = setName; } else { list = list + ';' + setName; } setListOfSets(list); } new HumanMessage(save_message_text[gLang], {type:'success'}); setLastSet(setName); changeToDropDown(gInputElement); updateDropdown(); } function removeArmor() { if (gArmorInputType === 'text') { // cancel adding of new set changeToDropDown(gInputElement); ajout_com_icone("wardrobe_cancelOrDelete_button", delete_button_text[gLang]); return; } // remove existing set var setName = gInputElement.value; if (setName === '') { new HumanMessage(delete_choose_name_error_text[gLang]); gInputElement.focus(); return; } // remove existing set if (!confirm(confirm_overwrite_text[gLang] + '"' + setName + '" ?')) { gInputElement.focus(); return; } removeArmorSet(setName); var listOS = getListOfSets(); listOS = listOS.split(';'); var newListOS = ''; // Dun bug avec chrome : for (var ind in listOS) { for(var ind=0; ind < listOS.length;ind++){ if (listOS[ind] != setName && listOS[ind] != '') { if (newListOS == '') { newListOS = listOS[ind]; } else { newListOS += ';' + listOS[ind]; } } } if(newListOS==""){ setLastSet(""); alignSelected(""); } setListOfSets(newListOS); setLastSet(""); updateDropdown(); changeToDropDown(gInputElement); } function ajout_com_icone(nom_icone, commentaire) { //Ces zones sont créées en début de page var commentaire_icone = document.getElementById('left_top'); var script_commentaire = document.createElement("script"); script_commentaire.type = "text/javascript"; //Affiche le commentaire au format "The West" script_commentaire.innerHTML = "window.addEvent(\"domready\", function(){ $(\"" + nom_icone + "\").addMousePopup(new MousePopup(\"<B>" + commentaire + "</B>\")); });"; commentaire_icone.parentNode.insertBefore(script_commentaire, commentaire_icone); } function setChangeOnSelect(){ var checkbox = document.getElementById("changeonselect"); var zoneMode=document.getElementById('zoneMode'); var optInv=document.getElementById('optcurInv'); var input = document.getElementById('inputSet'); //debug("setChangeOnSelect" + input.value); var check = checkbox.checked; if(check){ showElement(input); showElement(zoneMode); hideElement(optInv); optInv.innerHTML =getLastSet(); }else{ hideElement(zoneMode); hideElement(input); showElement(optInv); alignSelected(getLastSet()); } //alignSelected(getLastSet()); localStorage.setItem("changeonselect", check); } function setCheckedArm(){ var checkbox = document.getElementById("checkRArm"); var check = checkbox.checked; localStorage.setItem("changeRArm", check); } function setCheckedAnimal(){ var checkbox = document.getElementById("checkAnimal"); var check = checkbox.checked; localStorage.setItem("changeAnimal", check); } function addInventoryButtons() { if(!isNull(document.getElementById('rapidoFringue'))){ //Déja présent, pas la peine de le recreer }else{ var invTargetPos = null; // check if inventory window is fully loaded invTargetPos = document.getElementById('bag'); if (!AjaxWindow.windows['inventory'].isReady || isNull(invTargetPos)) { setTimeout(function(){addInventoryButtons();}, 200); return; } invTargetPos = document.getElementById('window_inventory_content'); var nTable = document.createElement('table'); nTable.setAttribute("style", "position: absolute; top:0px; margin-left: -5px; margin-top: 2px;"); nTable.setAttribute("id", "rapidoFringue"); invTargetPos.appendChild(nTable); var nTR = document.createElement('tr'); nTable.appendChild(nTR); var nTD = document.createElement('td'); nTR.appendChild(nTD); // select createDropInvDropDown(); nTD.appendChild(gInputElement); nTR.appendChild(nTD); nTD = document.createElement('td'); nTR.appendChild(nTD); // Check box de selection rapide / modification ns = document.createElement('input'); ns.setAttribute("style","cursor: pointer;"); ns.setAttribute("type","checkbox") ns.setAttribute("id","changeonselect"); ns.addEventListener("click",setChangeOnSelect, false); var isCheck=(localStorage.getItem("changeonselect")); if(isCheck=='true' || isNull(isCheck)){ ns.setAttribute("checked",isCheck); } nTD.appendChild(ns); nTD = document.createElement('td'); nTR.appendChild(nTD); // Zone de modification caché / visible var nsZ = document.createElement('div'); nsZ.setAttribute("id", "zoneMode"); // image modifier / ajouter ns = document.createElement('img'); ns.setAttribute("style", "cursor: pointer; width:30px; height:30p;"); ns.setAttribute("id", "yesico"); ns.setAttribute("src", "images/confirm_buttons/yes.png");//"data:image/gif;base64," + buttonImg); ns.addEventListener("click", saveArmor, false); ns.setAttribute("alt", save_button_text[gLang]); nsZ.appendChild(ns); // image supprimer / annuler ns = document.createElement('img'); ns.setAttribute("style", "cursor: pointer; width:30px; height:30p;"); ns.setAttribute("id", "wardrobe_cancelOrDelete_button"); ns.setAttribute("src", "images/confirm_buttons/no.png");//"data:image/gif;base64," + buttonImg); ns.addEventListener("click", removeArmor, false); nsZ.appendChild(ns); nTD.appendChild(nsZ); ajout_com_icone("yesico", save_button_text[gLang]); ajout_com_icone("changeonselect",check_changeonselect[gLang]); ajout_com_icone("wardrobe_cancelOrDelete_button", delete_button_text[gLang]); setChangeOnSelect(); // Ajout des options pour mettre directement le vetements selectionnés dans TWPro (si TWPro est dispo) if(!isNull(TWPro)){ nTD = document.createElement('td'); nTR.appendChild(nTD); nTD.setAttribute("width","80px"); nTD.setAttribute("align","right"); nTD.setAttribute("style", "position: absolute; align:rigth;"); // Bouton de changement de set à partir de TWPro ns = document.createElement('img'); ns.setAttribute("style","cursor: pointer; width:30px; height:30p;align:right;"); ns.setAttribute("src", "images/jobs/buffelo_bill.png"); //data:image/gif;base64," + buttonImg); ns.addEventListener("click",wearSelected, false); ns.setAttribute("id", "twico"); nTD.appendChild(ns); // Check box de non changement d'arme ns = document.createElement('input'); ns.setAttribute("style","cursor: pointer;"); ns.setAttribute("type","checkbox") ns.setAttribute("id","checkRArm"); var isCheck=(localStorage.getItem("changeRArm")=='true'); if(isCheck) ns.setAttribute("checked",isCheck); ns.addEventListener("click",setCheckedArm, false); nTD.appendChild(ns); // Check box de non changement d'animal ns = document.createElement('input'); ns.setAttribute("style","cursor: pointer;"); ns.setAttribute("type","checkbox"); ns.setAttribute("id","checkAnimal"); var isCheck=(localStorage.getItem("changeAnimal")=='true'); if(isCheck) ns.setAttribute("checked",isCheck); ns.addEventListener("click",setCheckedAnimal, false); //ns.appendChild(nb); nTD.appendChild(ns); ajout_com_icone("twico", tw_button_text[gLang]); ajout_com_icone("checkRArm", check_rarm_text[gLang]); ajout_com_icone("checkAnimal",check_animal_text[gLang]); } if(Beta){ //debug("Beta release"); ns = document.createElement('a'); // ns.setAttribute("href", "javascript:"); nTD.appendChild(ns); nb = document.createElement('img'); nb.setAttribute("style","cursor: pointer; width:30px; height:30p;align:right;"); nb.setAttribute("src", "/images/duel/duel_button.png"); //data:image/gif;base64," + buttonImg); nb.addEventListener("click",function(){ list = getListOfSets(); //debug(list.length); setListOfSets(""); }, false); nb.setAttribute("id", "betaico"); ns.appendChild(nb); ajout_com_icone("betaico","RAZ List"); } updateDropdown(); setChangeOnSelect(); } } function init() { createDropdown(); //search for inventory button var pageElements = document.getElementsByTagName('A'); var invButton; for (var i = 0; i < pageElements.length; i++) { invButton = pageElements[i]; if (invButton.getAttribute('onclick') === "AjaxWindow.show('inventory');" && invButton.parentNode.id === 'menu_inventory') { invButton.addEventListener("click", function(){setTimeout(addInventoryButtons, 100);}, false); } } // fix "abdorment_right" document.getElementById('abdorment_right').style.zIndex = "5"; // fix for update 1.27 right_work_bar = document.getElementById('workbar_right'); if (right_work_bar) { right_work_bar.style.top = (findPosY(right_work_bar)+26)+"px"; } } init(); //MAJ AUTO SOM }) /*************************************************************** * DOM Storage Wrapper Class * * Public members: * ctor({"session"|"local"}[, <namespace>]) * setItem(<key>, <value>) * getItem(<key>, <default value>) * removeItem(<key>) * keys() ***************************************************************/ function Storage(type, namespace) { var object = this; if(typeof(type) != "string") type = "session"; switch(type) { case "local": { object.storage = localStorage; } break; case "session": { object.storage = sessionStorage; } break; default: { object.storage = sessionStorage; } break; } if (!namespace || (typeof(namespace) != "string" && typeof(namespace) != "number")) namespace = "ScriptStorage"; object.namespace = [namespace, "."].join(""); object.setItem = function(key, value) { try { object.storage.setItem(escape([object.namespace, key].join("")), JSON.stringify(value)); } catch(e) { } } object.getItem = function(key, defaultValue) { try { var value = object.storage.getItem(escape([object.namespace, key].join(""))); if(value) return eval(value); else return defaultValue; } catch(e) { return defaultValue; } } object.removeItem = function(key) { try { object.storage.removeItem(escape([object.namespace, key].join(""))); } catch(e) { } } object.keys = function() { var array = []; var i = 0; do { try { var key = unescape(object.storage.key(i++)); if(key.indexOf(object.namespace) == 0 && object.storage.getItem(key)) array.push(key.slice(object.namespace.length)); } catch(e) { break; } } while(true); return array; } } /*************************************************************** * ScriptUpdater Class * * Public members: * ScriptUpdater.check(<script id>, <current script version>[, <callback function>]) * ScriptUpdater.forceCheck(<script id>, <current script version>[, <callback function>]) * ScriptUpdater.forceNotice(<script id>, <current script version>[, <callback function>]) ***************************************************************/ ScriptUpdater = { id: 95173, version: "1.03f", scriptId: null, scriptCurrentVersion: null, scriptCallbackFunction: null, scriptUseNotice: null, scriptForceNotice: null, scriptMetaTags: null, scriptStorage: null, icons: { install: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAALZSURBVBgZBcFLiFVlAADg7zzuPLzjzDjOMINMitIie5gF+UAkIZSgRQuXLZIWrY021dYIggJdJURElJsoqlWRYA9GshGFCNQeOjoTk6bjeOd5zzn/f07flzRNA459ObcHJ3cM9+1fq2prVa2qa+uh7mAZ9xCxiAV8iu9zgDqEvU9ODOx//dkxALBa1kNrZT202I2TZcVyEd28t+Lb66uHcTwHqEMYH+xJwNyDqJUk8oQsp7eV2tqbytJUK+OpyX5bhtojH07Pv58CxKoabOeEmuUy0al4UNDp0umysM5/KxG8eWbW/u1tj4+2xnKAWFUjG3tSqwWr3ShNEzmyjDQjk8gSaiRxyYUbiy7PduZzgFiW40P9mc56sFY00rSRpaQxkaVkGlmGJnNnqXDq7N9LOJYDhLLcNj7Y0uk2AjRkMZE2iGQaeZOqG2IrCmXY/s1rB+6nALEstk0M9VotG0lKliRSpEjw+YUjPjq3RxkKoSjEsoiQwvMnvusXQ09vK1VGUg1qjVrUqDWKUJoc3emVj3dbWeuEUJZLkEMoyrF2u0+aUEPD19OHNXVQ1kEZgy2bHrZzYq/l7qr766/m3VC0ub+SQyyLDXm7R56SpYlYJ0JdOvzYy2JTi3VUa8x35jwxecBKue7S7E+dXW+nI/nB42dGcWLPI1vdXmrcvBO1++iGUmxqtxb+UtVBqCtVrCwVy3Y/dN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/Bh9gP0bOqHLAm2WUF1YQskwrVFYPWkf3h1iXwbvqGfFPSGW9Eah8HSS9fuZDnS32f71m8KFY7xs/QZyu6TH2+2+FAAAAABJRU5ErkJggg%3D%3D", uso: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAQCAYAAAAiYZ4HAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAh9JREFUeNp0krmLWnEQxyf7zLoajyIWXojIxkK0EiIGCRamCKQwEdIIgYQoQSR/wLY2goVVJGCa1BaL2liKBESFiOJFiMRb1xMVRbx+mfdA0RwDA4/3m+Mz3xmAf9hDNJ/P9zWXy935/f7A5eXlFfzPRCKROBgMfqvX62S5XBLabDbbh8M76zRYKpUqvF5vyGw2P+bz+cBisWCz2cB2u33wV2WFQvEoFArlW60WmUwmZLVakdFoRNxu9xd8Fp51UKlUWmS91ev11zweD5AZMAFmsxkgWhpDpsfKarVaE4lEqpVKhUynU4a73++TcrlMarUa6Xa7G7vd/u4QT93c3HzmcrlPSqUSiMVihrvX68F6vYZsNkvPcOFyuV5Uq9VuoVD4ztrv91wOhwMCgQAGgwEsFguYz+eMSyQSkMvlwGazqUAg8KnRaHSo4XA4Q9leYRdmHrpyJpMBehaDwQBCoRB2ux2gapRSqbymsP2PTqezsFqtz+6hpVIpprLRaGTw8BcgBVOo2WyOj8NbLJaP+Xx+k0gkCL00xGNEoJ2WOZlMznQ6nfVsFyaT6X273d4eAmkfj8ckHo+PNRrNSzrm4jRBq9XysDWF18Cg0OzpdPrO6XS+QRVvz6oj0nOch25NYrEYgxEOhxsymezpadyxA8p5HxUDXBTgSUA0Gv3pcDheI2LiNIE6fOAN/cKkK9RdUSwWkx6P5y0mZv+8ud8CDABidDMA4Sb2JAAAAABJRU5ErkJggg%3D%3D" }, $: function(id) { return document.getElementById(id); }, initialize: function(scriptId, scriptCurrentVersion, scriptCallbackFunction, scriptUseNotice, scriptForceNotice) { ScriptUpdater.scriptId = scriptId; ScriptUpdater.scriptCurrentVersion = scriptCurrentVersion; ScriptUpdater.scriptCallbackFunction = typeof(scriptCallbackFunction) == "function" ? scriptCallbackFunction : false; ScriptUpdater.scriptUseNotice = scriptUseNotice; ScriptUpdater.scriptForceNotice = scriptForceNotice; if(ScriptUpdater.scriptStorage == null) { ScriptUpdater.scriptStorage = new Storage("local", "ScriptUpdater." + scriptId); } }, setValue: function(key, value) { if(ScriptUpdater.scriptStorage != null) { ScriptUpdater.scriptStorage.setItem(key, value); } }, getValue: function(key, defaultValue) { if(ScriptUpdater.scriptStorage != null) { return ScriptUpdater.scriptStorage.getItem(key, defaultValue); } else { return defaultValue; } }, getOffers: function() { var offers = ScriptUpdater.getValue("offers", ""); return (typeof(offers) == "undefined" || typeof(offers.length) == "undefined" || typeof(offers.push) == "undefined") ? new Array() : offers; }, addOffer: function(version) { var offers = ScriptUpdater.getOffers(); offers.push(version); ScriptUpdater.setValue("offers", offers); }, alreadyOffered: function(version) { var offers = ScriptUpdater.getOffers(); for(var i = 0; i < offers.length; i++) { if(version.toString() == offers[i].toString()) return true; } return false; }, addStyle: function(css) { var head = document.getElementsByTagName("head")[0]; if (!head) return; var style = document.createElement("style"); style.type = "text/css"; style.textContent = css; head.appendChild(style); }, parseMetaTags: function(metaTags) { function find_meta(element, index, array) { return (element.indexOf("// @") != -1); } var headers = {}; var name, prefix, header, key, value; var lines = metaTags.split(/\n/).filter(find_meta); for(var i in lines) { if(typeof(lines[i]) == "string") { name = lines[i].match(/\/\/ @(\S+)\s*.*/)[1]; value = lines[i].match(/\/\/ @\S+\s*(.*)/)[1]; key = name.split(/:/).reverse()[0]; prefix = name.split(/:/).reverse()[1]; if(prefix) { if(!headers[prefix]) { headers[prefix] = new Object; } header = headers[prefix]; } else { header = headers; } if(header[key] && !(header[key] instanceof Array)) { header[key] = new Array(header[key]); } if(header[key] instanceof Array) header[key].push(value); else header[key] = value; } } return headers; }, checkRemoteScript: function() { if(ScriptUpdater.scriptCurrentVersion && !ScriptUpdater.alreadyOffered(ScriptUpdater.scriptCurrentVersion)) { ScriptUpdater.addOffer(ScriptUpdater.scriptCurrentVersion); } var date = new Date(); ScriptUpdater.setValue("lastCheck", parseInt(date.getTime())); var su_script=document.createElement('iframe'); su_script.setAttribute('id', 'updater_95173'); su_script.setAttribute('style', 'display:none;'); su_script.src="http://userscripts.org/scripts/source/95173.meta.js"; document.body.appendChild(su_script); window.addEventListener('message', onMessage, true); function onMessage(e){ if (e.origin != "http://userscripts.org") return; myversion = unescape(e.data); if (myversion.substring(0, myversion.indexOf("/")) == 95173) gonextstep(); } function gonextstep(){ ScriptUpdater.scriptMetaTags = ScriptUpdater.parseMetaTags(myversion); ScriptUpdater.setValue("versionAvailable", ScriptUpdater.scriptMetaTags.version); if(ScriptUpdater.scriptForceNotice || (!ScriptUpdater.alreadyOffered(ScriptUpdater.scriptMetaTags.version) && ScriptUpdater.scriptUseNotice)) { if(!ScriptUpdater.alreadyOffered(ScriptUpdater.scriptMetaTags.version)) { ScriptUpdater.addOffer(ScriptUpdater.scriptMetaTags.version); } ScriptUpdater.showNotice(); } if(typeof(ScriptUpdater.scriptCallbackFunction) == "function") { ScriptUpdater.scriptCallbackFunction(ScriptUpdater.scriptMetaTags.version); } } }, getLastCheck: function() { return ScriptUpdater.getValue("lastCheck", 0); }, getInterval: function() { var interval = ScriptUpdater.getValue("interval", 86400000); return (typeof(interval) == "undefined" || !interval.toString().match(/^\d+$/)) ? 86400000 : parseInt(interval.toString()); }, setInterval: function(interval) { ScriptUpdater.setValue("interval", parseInt(interval)); }, check: function(scriptId, scriptVersion, scriptCallbackFunction) { ScriptUpdater.initialize(scriptId, scriptVersion, scriptCallbackFunction, true, false); var date = new Date(); if((date.getTime() - ScriptUpdater.getLastCheck()) > ScriptUpdater.getInterval()) { ScriptUpdater.checkRemoteScript(); } }, forceCheck: function(scriptId, scriptVersion, scriptCallbackFunction) { ScriptUpdater.initialize(scriptId, scriptVersion, scriptCallbackFunction, true, false); ScriptUpdater.checkRemoteScript(); }, forceNotice: function(scriptId, scriptVersion, scriptCallbackFunction) { ScriptUpdater.initialize(scriptId, scriptVersion, scriptCallbackFunction, true, true); ScriptUpdater.checkRemoteScript(); }, showNotice: function() { if(ScriptUpdater.scriptMetaTags.name && ScriptUpdater.scriptMetaTags.version) { ScriptUpdater.addStyle([ ["#ScriptUpdater", ScriptUpdater.scriptId, "Mask { position:fixed; width:100%; top:0; left:0; height:100%; background-color:#000; opacity:.7; z-index:9000; }"].join(""), ["#ScriptUpdater", ScriptUpdater.scriptId, "Body * { border:none; font-size:12px; color:#333; font-weight:normal; margin:0; padding:0; background:none; text-decoration:none; font-family:Helvetica Neue,Arial,Helvetica,sans-serif; }"].join(""), ["#ScriptUpdater", ScriptUpdater.scriptId, "Body { width:500px; margin:auto; top:125px; position:fixed; left:35%; text-align:left; background:#DED7C5; border:1px outset #333; padding:0; font-family:Arial; font-size:14px; -moz-border-radius:5px; cursor:default; z-index:9010; color:#333; padding-bottom:1em ; }"].join(""), ["#ScriptUpdater", ScriptUpdater.scriptId, "Body a { margin:0 .5em; text-decoration:underline; color:#000099; font-weight:bold; }"].join(""), ["#ScriptUpdater", ScriptUpdater.scriptId, "Body strong { font-weight:bold; }"].join(""), ["#ScriptUpdater", ScriptUpdater.scriptId, "Body h1 { font-size:13px; font-weight:bold; padding:.5em; border-bottom:1px solid #333; background-color:#999; margin-bottom:.75em; }"].join(""), ["#ScriptUpdater", ScriptUpdater.scriptId, "Body h2 { font-weight:bold; margin:.5em 1em; }"].join(""), ["#ScriptUpdater", ScriptUpdater.scriptId, "Body h1 a { font-size:13px; font-weight:bold; color:#fff; text-decoration:none; cursor:help; }"].join(""), ["#ScriptUpdater", ScriptUpdater.scriptId, "Body h1 a:hover { text-decoration:underline; }"].join(""), ["#ScriptUpdater", ScriptUpdater.scriptId, "Body table { width:auto; margin:0 1em; }"].join(""), ["#ScriptUpdater", ScriptUpdater.scriptId, "Body table tr th { padding-left:2em; text-align:right; padding-right:.5em; line-height:2em; }"].join(""), ["#ScriptUpdater", ScriptUpdater.scriptId, "Body table tr td { line-height:2em; font-weight:bold; }"].join(""), ["#ScriptUpdater", ScriptUpdater.scriptId, "Body li { list-style-type:circle; }"].join(""), ["#ScriptUpdater", ScriptUpdater.scriptId, "Body p { font-size:12px; font-weight:normal; margin:1em; }"].join(""), ["#ScriptUpdater", ScriptUpdater.scriptId, "History { margin:0 1em 1em 1em; max-height:150px; overflow-y:auto; border:1px inset #999; padding:0 1em 1em; width:448px; }"].join(""), ["#ScriptUpdater", ScriptUpdater.scriptId, "History ul { margin-left:2em; }"].join(""), ["#ScriptUpdater", ScriptUpdater.scriptId, "Close { float:right; cursor:pointer; height:14px; opacity:.5; }"].join(""), ["#ScriptUpdater", ScriptUpdater.scriptId, "Close:hover { opacity:.9; }"].join(""), ["#ScriptUpdater", ScriptUpdater.scriptId, "Footer { margin:.75em 1em; }"].join(""), ["#ScriptUpdater", ScriptUpdater.scriptId, "Footer input { border:1px outset #666; padding:3px 5px 5px 20px; background:no-repeat 4px center #eee; -moz-border-radius:3px; cursor:pointer; width:70px; float:right; margin-left:.5em; }"].join(""), ["#ScriptUpdater", ScriptUpdater.scriptId, "Footer input:hover { background-color:#f9f9f9; }"].join(""), ["#ScriptUpdater", ScriptUpdater.scriptId, "Footer select { border:1px inset #666; }"].join(""), "" ].join("\n")); var html = new Array(); html.push(["<h2><a href=\"http://userscripts.org/scripts/show/", ScriptUpdater.id, "\" target=\"_blank\" title=\"About the Userscripts.org Script Updater\"><img src=\"", ScriptUpdater.icons.uso, "\" align=\"absmiddle\" style=\"margin-top:-2px;\"/></a><img id=\"ScriptUpdater", ScriptUpdater.scriptId, "Close\" src=\"", ScriptUpdater.icons.close, "\" title=\"Close\"/>Userscripts.org Updater</h2>"].join("")); if(!ScriptUpdater.scriptForceNotice) { html.push(["<p>There is a new version of <strong><a href=\"http://userscripts.org/scripts/show/", ScriptUpdater.scriptId, "\" target=\"_blank\" title=\"Go to script page\">", ScriptUpdater.scriptMetaTags.name, "</a></strong> available for installation.</p>"].join("")); } else { html.push(["<p><strong><a href=\"http://userscripts.org/scripts/show/", ScriptUpdater.scriptId, "\" target=\"_blank\" title=\"Go to script page\" style=\"margin:0; padding:0;\">", ScriptUpdater.scriptMetaTags.name, "</a></strong></p>"].join("")); } if(ScriptUpdater.scriptCurrentVersion) { html.push(["<p>You currently have version <strong>", ScriptUpdater.scriptCurrentVersion, "</strong> installed. The latest version is <strong>", ScriptUpdater.scriptMetaTags.version, "</strong></p>"].join("")); } if(ScriptUpdater.scriptMetaTags.history) { html.push(["<h2>Version History:</h2><div id=\"ScriptUpdater", ScriptUpdater.scriptId, "History\">"].join("")); var history = new Array(); var version, desc; if(typeof(ScriptUpdater.scriptMetaTags.history) != "string") { for(var i = 0; i < ScriptUpdater.scriptMetaTags.history.length; i++) { version = ScriptUpdater.scriptMetaTags.history[i].match(/(\S+)\s+.*$/)[1]; change = ScriptUpdater.scriptMetaTags.history[i].match(/\S+\s+(.*)$/)[1]; history[version] = typeof(history[version]) == "undefined" ? new Array() : history[version]; history[version].push(change); } } else { version = ScriptUpdater.scriptMetaTags.history.match(/(\S+)\s+.*$/)[1]; change = ScriptUpdater.scriptMetaTags.history.match(/\S+\s+(.*)$/)[1]; history[version] = typeof(history[version]) == "undefined" ? new Array() : history[version]; history[version].push(change); } for(var v in history) { if(typeof(v) == "string" && v.match(/v?[0-9.]+[a-z]?/) || typeof(v) == "number") { html.push(["<div style=\"margin-top:.75em;\"><strong>v", v, "</strong></div><ul>"].join("")); for(var i = 0; i < history[v].length; i++) { html.push(["<li>", history[v][i], "</li>"].join("")); } html.push("</ul>"); } } html.push("</div>"); } html.push(["<div id=\"ScriptUpdater" + ScriptUpdater.scriptId + "Footer\">", "<input type=\"button\" id=\"ScriptUpdater", ScriptUpdater.scriptId, "CloseButton\" value=\"Close\" style=\"background-image:url(", ScriptUpdater.icons.close, ")\"/><input type=\"button\" id=\"ScriptUpdater" + ScriptUpdater.scriptId + "BodyInstall\" value=\"Install\" style=\"background-image:url(", ScriptUpdater.icons.install, ");\"/>", "Check this script for updates "].join("")); html.push(["<select id=\"ScriptUpdater", ScriptUpdater.scriptId, "Interval\">", "<option value=\"3600000\">every hour</option>", "<option value=\"21600000\">every 6 hours</option>", "<option value=\"86400000\">every day</option>", "<option value=\"604800000\">every week</option>", "<option value=\"0\">never</option>", "</select>"].join("")); html.push("</div>"); var noticeBackground = document.createElement("div"); noticeBackground.id = ["ScriptUpdater", ScriptUpdater.scriptId, "Mask"].join(""); document.body.appendChild(noticeBackground); var noticeWrapper = document.createElement("div"); noticeWrapper.setAttribute("style", "position:absolute; width:100%; top:0; left:0; z-index:9010; max-width:auto; min-width:auto; max-height:auto; min-height:auto;"); noticeWrapper.id = ["ScriptUpdater", ScriptUpdater.scriptId, "BodyWrapper"].join(""); var notice = document.createElement("div"); notice.id = ["ScriptUpdater", ScriptUpdater.scriptId, "Body"].join(""); notice.innerHTML = html.join(""); noticeWrapper.appendChild(notice); document.body.appendChild(noticeWrapper); ScriptUpdater.$(["ScriptUpdater", ScriptUpdater.scriptId, "Close"].join("")).addEventListener("click", ScriptUpdater.closeNotice, true); ScriptUpdater.$(["ScriptUpdater", ScriptUpdater.scriptId, "CloseButton"].join("")).addEventListener("click", ScriptUpdater.closeNotice, true); ScriptUpdater.$(["ScriptUpdater", ScriptUpdater.scriptId, "BodyInstall"].join("")).addEventListener("click", function() { setTimeout(ScriptUpdater.closeNotice, 500); document.location = ["http://userscripts.org/scripts/source/", ScriptUpdater.scriptId, ".user.js"].join(""); }, true); var selector = ScriptUpdater.$(["ScriptUpdater", ScriptUpdater.scriptId, "Interval"].join("")); for(var i = 0; i < selector.options.length; i++) { if(selector.options[i].value.toString() == ScriptUpdater.getInterval().toString()) selector.options[i].selected = true; } ScriptUpdater.setInterval(selector.value); selector.addEventListener("change", function() { ScriptUpdater.setInterval(selector.value); }, true); window.addEventListener("keyup", ScriptUpdater.keyUpHandler, true); } }, closeNotice: function() { document.body.removeChild(ScriptUpdater.$(['ScriptUpdater', ScriptUpdater.scriptId, 'BodyWrapper'].join(""))); document.body.removeChild(ScriptUpdater.$(['ScriptUpdater', ScriptUpdater.scriptId, 'Mask'].join(""))); window.removeEventListener("keyup", ScriptUpdater.keyUpHandler, true); }, keyUpHandler: function(event) { switch(event.keyCode) { case 27: ScriptUpdater.closeNotice(); break; } } }; //ScriptUpdater.forceNotice(95173, tenue_version); //ScriptUpdater.forceCheck(95173, tenue_version); ScriptUpdater.check(95173, tenue_version); } else { (function(f){var d=document,s=d.createElement('script');s.setAttribute('type','application/javascript');s.textContent = '('+f.toString()+')()';(d.body||d.head||d.documentElement).appendChild(s);s.parentNode.removeChild(s)})(function(){ function sendMessage(){ var dstWindow = window.parent; mymessage = String(escape(document.body.textContent)); if(dstWindow.postMessage){ dstWindow.postMessage('95173'+mymessage, '*'); } } sendMessage(); }) } //FIN MAJ AUTO SOM
Mozilla add on,User script,Grease Monkey Script, greasemonkey userscripts, updater userscripts mafia wars userscripts mafia wars autoplayer userscripts mafia wars wall userscripts scripts userscripts travian greasemonkey greasemonkey download greasemonkey facebook greasemonkey tutorial greasemonkey youtube greasemonkey travian greasemonkey chrome greasemonkey mafia wars greasemonkey mafia wars autoplayer
Saturday, January 29, 2011
The West - Tenue [SOM] Beta
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment