Taggescript - med små forrandringer.

Status
Stengt for ytterligere svar.

DeletedUser

Guest
Ja, oppdatering av TW har fått noen få bugs, så er det som gjør det. Er også det samme med eldre versjoner av Opera, så er TW som er synderen. En ting som skaper mye problemer er navneendring på knapper. Ressursskriptet sliter på grunn av "OK" er byttet med "Ok", men det er jo fikset :)

Slike små "fiks" skaper mye problemer og det hadde med fordel kunne forblitt som det var tidligere.
 

DeletedUser

Guest
Er det noen som får til å fikse taggescriptet slik at det fungerer på Opera også? :) Er jo helt håpløst å tagge mange angrep med det innlagte taggescriptet i TW og såvidt jeg vet er det ikke noen veldig enkle måter å skifte faner på i chrome...?
 

Kvænangen

Velkjent medlem
Reaksjonspoeng
135
Joda, rustern er klar over det, men ønsker vell en mer effektiv måte å gjøre det på, som i opera hvor man bare trenger og trykke på en tast.
 

DeletedUser

Guest
Stemmer. Langt mere effektivt å bytte faner ved å trykke på 1 knapp enn å holde inne 1 og trykke på 1 og sleppe begge to. Jeg vet jeg er kresen/vrang, men det er fakta :p

Regner uansett ikke jeg er eneste som ønsker å ha scriptet i opera også da de fleste bruker opera til vanlig på TW. Derfor lurer jo på om det er noen som vet om det lar seg gjøre å endre på scriptet eller om det rett og slett er opera som ikke klarer ikke klarer å kjøre det? :)
 

Munchlaxxxx

Aktivt medlem
Reaksjonspoeng
43
Stemmer. Langt mere effektivt å bytte faner ved å trykke på 1 knapp enn å holde inne 1 og trykke på 1 og sleppe begge to. Jeg vet jeg er kresen/vrang, men det er fakta :p

For meg kan jeg holde inne ctrl og bare tappe tab for å bytte faner. Det blir jo i praksis som å trykke en knapp. Altså, jeg trenger ikke slippe begge knappene for å bytte videre.
 

49n@r

Nytt medlem
Reaksjonspoeng
2
Trur det har vært en oppdatering en plass som gjør scriptet ubrukelig:( Håper noen kan gi en forklaring på hva som har skjedd;)
legger ved et bilde av hvordan det ser ut nå (V12):
[spoil]direktelink: http://bildr.no/view/1346686[/spoil]
 
Sist redigert:

DeletedUser

Guest
For meg kan jeg holde inne ctrl og bare tappe tab for å bytte faner. Det blir jo i praksis som å trykke en knapp. Altså, jeg trenger ikke slippe begge knappene for å bytte videre.

Hehe, joda. Det stemmer nok dette. Men om man skal bruke denne måten å skifte faner på samtidig som man bruker taggescriptet (om man feks får 100 incs på et par minutt så åpner ihvertfall jeg alle angrepene i faner), så vil man åpne scriptet i ny fane om man ikke slipper ctrl. Om det var dette du mente? For om man skal skifte faner kombinert med å bruke scriptet i hver fane tror jeg man må slippe både tab og ctrl, trykke på scriptet, og trykke inn både ctrl og tab igjen. Det er ganske tungvindt med tanke på at man faktisk bare kan trykke på 2 - museklikk - 2 - museklikk - med opera :)
 

Johnny Knoxville

Populær på forumet
Reaksjonspoeng
320
Man trenger da virkelig ikke å bruke akkurat chrome på alle de 100 angrepene som ble sendt samtidig. Trenger jo bare å tage et av dem med tid, og resten uten.
 

Kvænangen

Velkjent medlem
Reaksjonspoeng
135
Jeg gjemte noen adels nuke blant de 100 angrepene som jeg sendte samtidig, og det gjør jeg 3 ganger til. Plutselig så har jeg tatt noen byer av deg pga. du kun sjekket tiden på 4 av mine 400 angrep. See?
 

DeletedUser

Guest
Hehe, det stemmer veldig bra det, Simen :) Var noe lignende det der jeg tenkte. Men dte jeg var ute etter var jo forsåvidt om det lot seg gjøre å fikse scriptet tilpasset opera eller om det rett og slett var opera som ikke klarte å kjøre det. Men utifra det jeg har fått i svar fra dere, så er det vel opera såvidt jeg skjønner. Så da får vi bare vente og se om det kommer til å funke i den nærmeste fremtid eller hva som skjer :)
 

DeletedUser

Guest
Kommer fortsatt opp nanananananana på opera. :Neutral:
 
Sist redigert av en moderator:

DeletedUser

Guest
Jeg har en fix for å få tagget sent-tiden (og arrival-tiden) i opera (wasntme) Den er ikke spesielt god, men var lettvint og grei nok til å kunne brukes :) Har kun testet på min egen laptop, så kan ikke automatisk garantere at den fungerer for noen andre.
 

DeletedUser

Guest
Fikk forbedret min "ikke spesielt gode" måte å fikse scriptet på, så nå burde den fungere hos de fleste. Hvis noen får problemer tviler jeg sterkt på at jeg kommer til å rette opp koden. Det eneste "min del" av scriptet gjør er å oversette datoen fra norsk til engelsk i Opera samtidig som den fjerner millisekundene i datoen, slik at en kode i scriptet vil kunne tagge arrival og sent time.

[SPOIL]
Kode:
javascript:  hops = document.getElementById('edit').parentNode.parentNode.parentNode.getElementsByTagName('td');  hop = hops[11].innerText;  hop = hop.slice(0, -4);  hop = hop.replace("januar","january");  hop = hop.replace("februar","february");  hop = hop.replace("mars","march");  hop = hop.replace("mai","may");  hop = hop.replace("juni","june");  hop = hop.replace("juli","july");  hop = hop.replace("oktober","october");  hop = hop.replace("desember","december");  hops[11].innerText = hop;var doc=document;    if(window.frames.length>0)doc=window.main.document;    url = doc.URL;    function myErrorSuppressor() {      return true;  }  window.onerror = myErrorSuppressor;    function labelAttack() {      if (typeof (theFormat) == 'undefined') theFormat = '{unit} - {origin} - {player} - ID: {atkid} - Sent: {sent}';      arrUnitNames = ['Scout', 'LC', 'HC', 'Axe', 'Sword', 'Ram', '***Noble***'];      arrReplace = ['unit', 'coords', 'player', 'distance', 'sent', 'duration', 'arrival', 'origin', 'destination', 'destinationxy', 'atkid'];      arrHead = ['Unit', 'Sent', 'Duration', 'Name To'];      arrValues = arrReplace;        function fnReg(txtString) {          return new RegExp("\{" + txtString + "\}", "ig");      }      arrReplace = arrReplace.map(fnReg);        function fnGetConfig() {          var oRequest = new XMLHttpRequest();          var sURL = "http://" + window.location.hostname + "/interface.php?func=get_config";          oRequest.open("GET", sURL, 0);          oRequest.send(null);          if (oRequest.status == 200) return oRequest.responseXML;          alert("Error executing XMLHttpRequest call to get Config!");      }      var xmldocument = fnGetConfig();      theUnitSpeed = xmldocument.getElementsByTagName('unit_speed')[0].childNodes[0].nodeValue;      theWorldSpeed = xmldocument.getElementsByTagName('speed')[0].childNodes[0].nodeValue;        function myGetCoords(theString) {          return /(.*?)\s\(((\d+)\|(\d+))\)\sK(\d+)/i.exec(theString);      }        function myZeroPad(theString) {          theInt = parseInt(theString, 10);          return (theInt > 9 ? theInt : '0' + theInt);      }        function myGetElementsByTagName(theObj, theString) {          return theObj.getElementsByTagName(theString);      }        function myGetInner(theObj) {          return theObj.innerHTML;      }        function myGetInnerofFirstLink(theObj) {          return myGetInner(myGetElementsByTagName(theObj, 'a')[0]);      }        function myInsRow() {          return theTable.insertRow(intRow++);      }        function fnAttackID() {          var a = document.URL.match(/\d+/g);          return document.URL.match(/\d+/g)[a.length - 1];      }        function myInsCell(theInt) {          return newRow.insertCell(theInt);      }        function mySetInner(theObj, theString) {          theObj.innerHTML = theString;          return theObj;      }        function myInsTH(theString) {          newCell = newRow.appendChild(document.createElement('th'));          return mySetInner(newCell, theString);      }        function myTime(theInt) {          return myZeroPad(theInt / Const3600) + ':' + myZeroPad(theInt % (Const3600) / Const60) + ':' + myZeroPad(theInt % Const60);      }        function fnInt(txtInt) {          return parseInt(txtInt, 10);      }        function fnDate(txtDate) {          arrMs = txtDate.match(/:(\d{3})$/i);          if (arrMs) txtDate = txtDate.replace(/:(\d{3})$/i, '');          var dtNew = new Date(txtDate);          if (dtNew == 'Invalid Date') {              var arrDate = txtDate.match(/\b(\d+)\b/ig);              arrDate = arrDate.map(fnInt);              if (arrDate[2] < 2000) arrDate[2] += 2000;              dtNew = new Date(arrDate[2], arrDate[1] - 1, arrDate[0], arrDate[3], arrDate[4], arrDate[5]);          }          if (arrMs) dtNew.setMilliseconds(arrMs[1]);          return dtNew;      }      Const3600 = 3600;      Const60 = 60;      ConstWidth = 'width';      theTable = document.getElementById('edit').parentNode.parentNode.parentNode.parentNode;      theTable.removeAttribute(ConstWidth);      var arrRows = theTable.rows;      var intRows = arrRows.length;      for (intRow = 0; intRow < intRows; intRow++) {          theRow = arrRows[intRow];          theLength = (arrCells = theRow.cells) ? arrCells.length : 0;          if (theLength) {              arrCells[theLength - 1].colSpan = 5 - theLength;          }      }      arrValues[2] = myGetInnerofFirstLink(arrRows[1].cells[2]);        arrAttack = (arrRows[2].cells[1].textContent).match(/\d+\|\d+/ig);      arrAttack = arrAttack[arrAttack.length - 1];      arrTarget = (arrRows[4].cells[1].textContent).match(/\d+\|\d+/ig);      arrTarget = arrTarget[arrTarget.length - 1];        arrValues[1] = arrRows[2].cells[1].textContent;      arrValues[7] = arrAttack;       arrValues[8] = arrTarget;       arrValues[9] = arrRows[4].cells[1].textContent;      arrValues[10]=url.match(/id=(\d+)/)[1];        arrValues[6] = typeof (arrRows[5].cells[1].innerText) == 'undefined' ? arrRows[5].cells[1].textContent : arrRows[5].cells[1].innerText;      dtArrival = fnDate(arrValues[6]);      arrValues[6] = fnDateFormat(dtArrival);      /*alert(fnDateFormat(dtArrival));      for (x = 0; x < arrRows.length - 1; x++) {         // alert(x + " " + arrRows[x].cells.length);          for (y = 0; y < arrRows[x].cells.length; y++) {              alert("X: " + x + " Y: " + y + " --- " + arrRows[x].cells[y].textContent);          }                }        alert(arrRows[intRows - 2].cells[1].innerHTML);      */     /* alert(intRows);      alert(arrRows[intRows - 1].cells[1]);*/      arrArrivalIn = myGetInner(arrRows[6].cells[1]).match(/\d+/ig);                msecsArrivalIn = (arrArrivalIn[0] * Const3600 + arrArrivalIn[1] * Const60 + arrArrivalIn[2] * 1) * 1000;       /*alert('txtAttacker :'+txtAttacker+'\narrAttack :'+arrAttack[2]+'|'+arrAttack[3]+'\narrTarget :'+arrTarget[2]+'|'+arrTarget[3]+'\ndtArrival :'+dtArrival+'\narrArrivalIn :'+arrArrivalIn[0]+':'+arrArrivalIn[1]+':'+arrArrivalIn[2]+':'+arrArrivalIn[3]+'\nsecsArrivalIn :'+secsArrivalIn);*/        theXdiff = parseInt(arrAttack.split("|")[0] - arrTarget.split("|")[0]);      theYdiff = parseInt(arrAttack.split("|")[1] - arrTarget.split("|")[1]);      dblDistance = Math.sqrt(theXdiff * theXdiff + theYdiff * theYdiff);      arrValues[3] = dblDistance.toFixed(2);      var intRow = intRows - 2;      arrElements = myGetElementsByTagName(theTable, 'input');      theInputButton = arrElements[1];      theInputEdit = arrElements[0];      theInputEdit.size = Const60;      newRow = myInsRow();      mySetInner(myInsCell(0), 'Distance:').colSpan = 2;      mySetInner(myInsCell(1), arrValues[3] + ' Fields').colSpan = 2;      newRow = myInsRow();      arrHead.forEach(myInsTH);      function fnPreg(varValue, intIdx) {          newInput.value = newInput.value.replace(arrReplace[intIdx], varValue);      }        function fnDateFormat(dtDate) {          intMs = dtDate.getMilliseconds();          return myZeroPad(dtDate.getHours()) + ':' + myZeroPad(dtDate.getMinutes()) + ':' + myZeroPad(dtDate.getSeconds()) + '.' + (intMs > 99 ? intMs : '0' + myZeroPad(intMs)) + ' ' + myZeroPad(dtDate.getDate()) + '/' + myZeroPad(dtDate.getMonth() + 1);      }      for (theIndex in arrUnitNames) {          msecsDuration = Math.round([9,10,11,18,22,30,35][theIndex] * Const60 * 1000 * dblDistance / theWorldSpeed / theUnitSpeed);          secsDiff = (msecsDuration - msecsArrivalIn) / 1000;          if (secsDiff > 0) {              arrValues[0] = arrUnitNames[theIndex];              arrValues[5] = myTime(msecsDuration / 1000);              dtSent = new Date(dtArrival - msecsDuration);              arrValues[4] = fnDateFormat(dtSent);              newRow = myInsRow();              mySetInner(myInsCell(0), arrUnitNames[theIndex]);              mySetInner(myInsCell(1), secsDiff < Const60 && 'just now' || secsDiff < Const3600 && Math.floor(secsDiff / Const60) + ' mins ago' || myTime(secsDiff) + ' ago');              mySetInner(myInsCell(2), arrValues[5]);              newCell = myInsCell(3);              newButton = newCell.appendChild(theInputButton.cloneNode(true));              newInput = newCell.appendChild(theInputEdit.cloneNode(true));              newInput.id = 'I' + theIndex;              newInput.value = theFormat;              arrValues.forEach(fnPreg);              newButton.onmousedown = new Function('theInputEdit.value=document.getElementById(\'I' + theIndex + '\').value;');          }      }  }  labelAttack();    void (0);
[/SPOIL]

Beklager for at jeg dobbel-posta :(
 

DeletedUser

Guest
Forrige oppdatering forrandret hvordan datoene blir skrevet i kommando siden for et enkelt angrep. Derfor vil ikke det forrige fungerende scriptet kunne tagge med ca "sent"-tid. Her er et som værtfall vil fungere ut august:
Kode:
javascript:  hops = document.getElementById('edit').parentNode.parentNode.parentNode.getElementsByTagName('td');  hop = hops[11].innerText;  hop = hop.slice(0, -4);  hop = hop.replace("jan.","january");  hop = hop.replace("feb.","february");  hop = hop.replace("mar.","march");  hop = hop.replace("mai","may");  hop = hop.replace("jun.","june");  hop = hop.replace("jul.","july");  hop = hop.replace("okt.","october");  hop = hop.replace("aug.","october");  hop = hop.replace("des.","december");  hops[11].innerText = hop;var doc=document;    if(window.frames.length>0)doc=window.main.document;    url = doc.URL;    function myErrorSuppressor() {      return true;  }  window.onerror = myErrorSuppressor;    function labelAttack() {      if (typeof (theFormat) == 'undefined') theFormat = '{unit} - {origin} - {player} - ID: {atkid} - Sent: {sent}';      arrUnitNames = ['Scout', 'LC', 'HC', 'Axe', 'Sword', 'Ram', '***Noble***'];      arrReplace = ['unit', 'coords', 'player', 'distance', 'sent', 'duration', 'arrival', 'origin', 'destination', 'destinationxy', 'atkid'];      arrHead = ['Unit', 'Sent', 'Duration', 'Name To'];      arrValues = arrReplace;        function fnReg(txtString) {          return new RegExp("\{" + txtString + "\}", "ig");      }      arrReplace = arrReplace.map(fnReg);        function fnGetConfig() {          var oRequest = new XMLHttpRequest();          var sURL = "http://" + window.location.hostname + "/interface.php?func=get_config";          oRequest.open("GET", sURL, 0);          oRequest.send(null);          if (oRequest.status == 200) return oRequest.responseXML;          alert("Error executing XMLHttpRequest call to get Config!");      }      var xmldocument = fnGetConfig();      theUnitSpeed = xmldocument.getElementsByTagName('unit_speed')[0].childNodes[0].nodeValue;      theWorldSpeed = xmldocument.getElementsByTagName('speed')[0].childNodes[0].nodeValue;        function myGetCoords(theString) {          return /(.*?)\s\(((\d+)\|(\d+))\)\sK(\d+)/i.exec(theString);      }        function myZeroPad(theString) {          theInt = parseInt(theString, 10);          return (theInt > 9 ? theInt : '0' + theInt);      }        function myGetElementsByTagName(theObj, theString) {          return theObj.getElementsByTagName(theString);      }        function myGetInner(theObj) {          return theObj.innerHTML;      }        function myGetInnerofFirstLink(theObj) {          return myGetInner(myGetElementsByTagName(theObj, 'a')[0]);      }        function myInsRow() {          return theTable.insertRow(intRow++);      }        function fnAttackID() {          var a = document.URL.match(/\d+/g);          return document.URL.match(/\d+/g)[a.length - 1];      }        function myInsCell(theInt) {          return newRow.insertCell(theInt);      }        function mySetInner(theObj, theString) {          theObj.innerHTML = theString;          return theObj;      }        function myInsTH(theString) {          newCell = newRow.appendChild(document.createElement('th'));          return mySetInner(newCell, theString);      }        function myTime(theInt) {          return myZeroPad(theInt / Const3600) + ':' + myZeroPad(theInt % (Const3600) / Const60) + ':' + myZeroPad(theInt % Const60);      }        function fnInt(txtInt) {          return parseInt(txtInt, 10);      }        function fnDate(txtDate) {          arrMs = txtDate.match(/:(\d{3})$/i);          if (arrMs) txtDate = txtDate.replace(/:(\d{3})$/i, '');          var dtNew = new Date(txtDate);          if (dtNew == 'Invalid Date') {              var arrDate = txtDate.match(/\b(\d+)\b/ig);              arrDate = arrDate.map(fnInt);              if (arrDate[2] < 2000) arrDate[2] += 2000;              dtNew = new Date(arrDate[2], arrDate[1] - 1, arrDate[0], arrDate[3], arrDate[4], arrDate[5]);          }          if (arrMs) dtNew.setMilliseconds(arrMs[1]);          return dtNew;      }      Const3600 = 3600;      Const60 = 60;      ConstWidth = 'width';      theTable = document.getElementById('edit').parentNode.parentNode.parentNode.parentNode;      theTable.removeAttribute(ConstWidth);      var arrRows = theTable.rows;      var intRows = arrRows.length;      for (intRow = 0; intRow < intRows; intRow++) {          theRow = arrRows[intRow];          theLength = (arrCells = theRow.cells) ? arrCells.length : 0;          if (theLength) {              arrCells[theLength - 1].colSpan = 5 - theLength;          }      }      arrValues[2] = myGetInnerofFirstLink(arrRows[1].cells[2]);        arrAttack = (arrRows[2].cells[1].textContent).match(/\d+\|\d+/ig);      arrAttack = arrAttack[arrAttack.length - 1];      arrTarget = (arrRows[4].cells[1].textContent).match(/\d+\|\d+/ig);      arrTarget = arrTarget[arrTarget.length - 1];        arrValues[1] = arrRows[2].cells[1].textContent;      arrValues[7] = arrAttack;       arrValues[8] = arrTarget;       arrValues[9] = arrRows[4].cells[1].textContent;      arrValues[10]=url.match(/id=(\d+)/)[1];        arrValues[6] = typeof (arrRows[5].cells[1].innerText) == 'undefined' ? arrRows[5].cells[1].textContent : arrRows[5].cells[1].innerText;      dtArrival = fnDate(arrValues[6]);      arrValues[6] = fnDateFormat(dtArrival);      /*alert(fnDateFormat(dtArrival));      for (x = 0; x < arrRows.length - 1; x++) {         // alert(x + " " + arrRows[x].cells.length);          for (y = 0; y < arrRows[x].cells.length; y++) {              alert("X: " + x + " Y: " + y + " --- " + arrRows[x].cells[y].textContent);          }                }        alert(arrRows[intRows - 2].cells[1].innerHTML);      */     /* alert(intRows);      alert(arrRows[intRows - 1].cells[1]);*/      arrArrivalIn = myGetInner(arrRows[6].cells[1]).match(/\d+/ig);                msecsArrivalIn = (arrArrivalIn[0] * Const3600 + arrArrivalIn[1] * Const60 + arrArrivalIn[2] * 1) * 1000;       /*alert('txtAttacker :'+txtAttacker+'\narrAttack :'+arrAttack[2]+'|'+arrAttack[3]+'\narrTarget :'+arrTarget[2]+'|'+arrTarget[3]+'\ndtArrival :'+dtArrival+'\narrArrivalIn :'+arrArrivalIn[0]+':'+arrArrivalIn[1]+':'+arrArrivalIn[2]+':'+arrArrivalIn[3]+'\nsecsArrivalIn :'+secsArrivalIn);*/        theXdiff = parseInt(arrAttack.split("|")[0] - arrTarget.split("|")[0]);      theYdiff = parseInt(arrAttack.split("|")[1] - arrTarget.split("|")[1]);      dblDistance = Math.sqrt(theXdiff * theXdiff + theYdiff * theYdiff);      arrValues[3] = dblDistance.toFixed(2);      var intRow = intRows - 2;      arrElements = myGetElementsByTagName(theTable, 'input');      theInputButton = arrElements[1];      theInputEdit = arrElements[0];      theInputEdit.size = Const60;      newRow = myInsRow();      mySetInner(myInsCell(0), 'Distance:').colSpan = 2;      mySetInner(myInsCell(1), arrValues[3] + ' Fields').colSpan = 2;      newRow = myInsRow();      arrHead.forEach(myInsTH);      function fnPreg(varValue, intIdx) {          newInput.value = newInput.value.replace(arrReplace[intIdx], varValue);      }        function fnDateFormat(dtDate) {          intMs = dtDate.getMilliseconds();          return myZeroPad(dtDate.getHours()) + ':' + myZeroPad(dtDate.getMinutes()) + ':' + myZeroPad(dtDate.getSeconds()) + '.' + (intMs > 99 ? intMs : '0' + myZeroPad(intMs)) + ' ' + myZeroPad(dtDate.getDate()) + '/' + myZeroPad(dtDate.getMonth() + 1);      }      for (theIndex in arrUnitNames) {          msecsDuration = Math.round([9,10,11,18,22,30,35][theIndex] * Const60 * 1000 * dblDistance / theWorldSpeed / theUnitSpeed);          secsDiff = (msecsDuration - msecsArrivalIn) / 1000;          if (secsDiff > 0) {              arrValues[0] = arrUnitNames[theIndex];              arrValues[5] = myTime(msecsDuration / 1000);              dtSent = new Date(dtArrival - msecsDuration);              arrValues[4] = fnDateFormat(dtSent);              newRow = myInsRow();              mySetInner(myInsCell(0), arrUnitNames[theIndex]);              mySetInner(myInsCell(1), secsDiff < Const60 && 'just now' || secsDiff < Const3600 && Math.floor(secsDiff / Const60) + ' mins ago' || myTime(secsDiff) + ' ago');              mySetInner(myInsCell(2), arrValues[5]);              newCell = myInsCell(3);              newButton = newCell.appendChild(theInputButton.cloneNode(true));              newInput = newCell.appendChild(theInputEdit.cloneNode(true));              newInput.id = 'I' + theIndex;              newInput.value = theFormat;              arrValues.forEach(fnPreg);              newButton.onmousedown = new Function('theInputEdit.value=document.getElementById(\'I' + theIndex + '\').value;');          }      }  }  labelAttack();    void (0);
 

Clayzer

Velkjent medlem
Reaksjonspoeng
155
Forrige oppdatering forrandret hvordan datoene blir skrevet i kommando siden for et enkelt angrep. Derfor vil ikke det forrige fungerende scriptet kunne tagge med ca "sent"-tid. Her er et som værtfall vil fungere ut august:
Kode:
javascript:  hops = document.getElementById('edit').parentNode.parentNode.parentNode.getElementsByTagName('td');  hop = hops[11].innerText;  hop = hop.slice(0, -4);  hop = hop.replace("jan.","january");  hop = hop.replace("feb.","february");  hop = hop.replace("mar.","march");  hop = hop.replace("mai","may");  hop = hop.replace("jun.","june");  hop = hop.replace("jul.","july");  hop = hop.replace("okt.","october");  hop = hop.replace("aug.","october");  hop = hop.replace("des.","december");  hops[11].innerText = hop;var doc=document;    if(window.frames.length>0)doc=window.main.document;    url = doc.URL;    function myErrorSuppressor() {      return true;  }  window.onerror = myErrorSuppressor;    function labelAttack() {      if (typeof (theFormat) == 'undefined') theFormat = '{unit} - {origin} - {player} - ID: {atkid} - Sent: {sent}';      arrUnitNames = ['Scout', 'LC', 'HC', 'Axe', 'Sword', 'Ram', '***Noble***'];      arrReplace = ['unit', 'coords', 'player', 'distance', 'sent', 'duration', 'arrival', 'origin', 'destination', 'destinationxy', 'atkid'];      arrHead = ['Unit', 'Sent', 'Duration', 'Name To'];      arrValues = arrReplace;        function fnReg(txtString) {          return new RegExp("\{" + txtString + "\}", "ig");      }      arrReplace = arrReplace.map(fnReg);        function fnGetConfig() {          var oRequest = new XMLHttpRequest();          var sURL = "http://" + window.location.hostname + "/interface.php?func=get_config";          oRequest.open("GET", sURL, 0);          oRequest.send(null);          if (oRequest.status == 200) return oRequest.responseXML;          alert("Error executing XMLHttpRequest call to get Config!");      }      var xmldocument = fnGetConfig();      theUnitSpeed = xmldocument.getElementsByTagName('unit_speed')[0].childNodes[0].nodeValue;      theWorldSpeed = xmldocument.getElementsByTagName('speed')[0].childNodes[0].nodeValue;        function myGetCoords(theString) {          return /(.*?)\s\(((\d+)\|(\d+))\)\sK(\d+)/i.exec(theString);      }        function myZeroPad(theString) {          theInt = parseInt(theString, 10);          return (theInt > 9 ? theInt : '0' + theInt);      }        function myGetElementsByTagName(theObj, theString) {          return theObj.getElementsByTagName(theString);      }        function myGetInner(theObj) {          return theObj.innerHTML;      }        function myGetInnerofFirstLink(theObj) {          return myGetInner(myGetElementsByTagName(theObj, 'a')[0]);      }        function myInsRow() {          return theTable.insertRow(intRow++);      }        function fnAttackID() {          var a = document.URL.match(/\d+/g);          return document.URL.match(/\d+/g)[a.length - 1];      }        function myInsCell(theInt) {          return newRow.insertCell(theInt);      }        function mySetInner(theObj, theString) {          theObj.innerHTML = theString;          return theObj;      }        function myInsTH(theString) {          newCell = newRow.appendChild(document.createElement('th'));          return mySetInner(newCell, theString);      }        function myTime(theInt) {          return myZeroPad(theInt / Const3600) + ':' + myZeroPad(theInt % (Const3600) / Const60) + ':' + myZeroPad(theInt % Const60);      }        function fnInt(txtInt) {          return parseInt(txtInt, 10);      }        function fnDate(txtDate) {          arrMs = txtDate.match(/:(\d{3})$/i);          if (arrMs) txtDate = txtDate.replace(/:(\d{3})$/i, '');          var dtNew = new Date(txtDate);          if (dtNew == 'Invalid Date') {              var arrDate = txtDate.match(/\b(\d+)\b/ig);              arrDate = arrDate.map(fnInt);              if (arrDate[2] < 2000) arrDate[2] += 2000;              dtNew = new Date(arrDate[2], arrDate[1] - 1, arrDate[0], arrDate[3], arrDate[4], arrDate[5]);          }          if (arrMs) dtNew.setMilliseconds(arrMs[1]);          return dtNew;      }      Const3600 = 3600;      Const60 = 60;      ConstWidth = 'width';      theTable = document.getElementById('edit').parentNode.parentNode.parentNode.parentNode;      theTable.removeAttribute(ConstWidth);      var arrRows = theTable.rows;      var intRows = arrRows.length;      for (intRow = 0; intRow < intRows; intRow++) {          theRow = arrRows[intRow];          theLength = (arrCells = theRow.cells) ? arrCells.length : 0;          if (theLength) {              arrCells[theLength - 1].colSpan = 5 - theLength;          }      }      arrValues[2] = myGetInnerofFirstLink(arrRows[1].cells[2]);        arrAttack = (arrRows[2].cells[1].textContent).match(/\d+\|\d+/ig);      arrAttack = arrAttack[arrAttack.length - 1];      arrTarget = (arrRows[4].cells[1].textContent).match(/\d+\|\d+/ig);      arrTarget = arrTarget[arrTarget.length - 1];        arrValues[1] = arrRows[2].cells[1].textContent;      arrValues[7] = arrAttack;       arrValues[8] = arrTarget;       arrValues[9] = arrRows[4].cells[1].textContent;      arrValues[10]=url.match(/id=(\d+)/)[1];        arrValues[6] = typeof (arrRows[5].cells[1].innerText) == 'undefined' ? arrRows[5].cells[1].textContent : arrRows[5].cells[1].innerText;      dtArrival = fnDate(arrValues[6]);      arrValues[6] = fnDateFormat(dtArrival);      /*alert(fnDateFormat(dtArrival));      for (x = 0; x < arrRows.length - 1; x++) {         // alert(x + " " + arrRows[x].cells.length);          for (y = 0; y < arrRows[x].cells.length; y++) {              alert("X: " + x + " Y: " + y + " --- " + arrRows[x].cells[y].textContent);          }                }        alert(arrRows[intRows - 2].cells[1].innerHTML);      */     /* alert(intRows);      alert(arrRows[intRows - 1].cells[1]);*/      arrArrivalIn = myGetInner(arrRows[6].cells[1]).match(/\d+/ig);                msecsArrivalIn = (arrArrivalIn[0] * Const3600 + arrArrivalIn[1] * Const60 + arrArrivalIn[2] * 1) * 1000;       /*alert('txtAttacker :'+txtAttacker+'\narrAttack :'+arrAttack[2]+'|'+arrAttack[3]+'\narrTarget :'+arrTarget[2]+'|'+arrTarget[3]+'\ndtArrival :'+dtArrival+'\narrArrivalIn :'+arrArrivalIn[0]+':'+arrArrivalIn[1]+':'+arrArrivalIn[2]+':'+arrArrivalIn[3]+'\nsecsArrivalIn :'+secsArrivalIn);*/        theXdiff = parseInt(arrAttack.split("|")[0] - arrTarget.split("|")[0]);      theYdiff = parseInt(arrAttack.split("|")[1] - arrTarget.split("|")[1]);      dblDistance = Math.sqrt(theXdiff * theXdiff + theYdiff * theYdiff);      arrValues[3] = dblDistance.toFixed(2);      var intRow = intRows - 2;      arrElements = myGetElementsByTagName(theTable, 'input');      theInputButton = arrElements[1];      theInputEdit = arrElements[0];      theInputEdit.size = Const60;      newRow = myInsRow();      mySetInner(myInsCell(0), 'Distance:').colSpan = 2;      mySetInner(myInsCell(1), arrValues[3] + ' Fields').colSpan = 2;      newRow = myInsRow();      arrHead.forEach(myInsTH);      function fnPreg(varValue, intIdx) {          newInput.value = newInput.value.replace(arrReplace[intIdx], varValue);      }        function fnDateFormat(dtDate) {          intMs = dtDate.getMilliseconds();          return myZeroPad(dtDate.getHours()) + ':' + myZeroPad(dtDate.getMinutes()) + ':' + myZeroPad(dtDate.getSeconds()) + '.' + (intMs > 99 ? intMs : '0' + myZeroPad(intMs)) + ' ' + myZeroPad(dtDate.getDate()) + '/' + myZeroPad(dtDate.getMonth() + 1);      }      for (theIndex in arrUnitNames) {          msecsDuration = Math.round([9,10,11,18,22,30,35][theIndex] * Const60 * 1000 * dblDistance / theWorldSpeed / theUnitSpeed);          secsDiff = (msecsDuration - msecsArrivalIn) / 1000;          if (secsDiff > 0) {              arrValues[0] = arrUnitNames[theIndex];              arrValues[5] = myTime(msecsDuration / 1000);              dtSent = new Date(dtArrival - msecsDuration);              arrValues[4] = fnDateFormat(dtSent);              newRow = myInsRow();              mySetInner(myInsCell(0), arrUnitNames[theIndex]);              mySetInner(myInsCell(1), secsDiff < Const60 && 'just now' || secsDiff < Const3600 && Math.floor(secsDiff / Const60) + ' mins ago' || myTime(secsDiff) + ' ago');              mySetInner(myInsCell(2), arrValues[5]);              newCell = myInsCell(3);              newButton = newCell.appendChild(theInputButton.cloneNode(true));              newInput = newCell.appendChild(theInputEdit.cloneNode(true));              newInput.id = 'I' + theIndex;              newInput.value = theFormat;              arrValues.forEach(fnPreg);              newButton.onmousedown = new Function('theInputEdit.value=document.getElementById(\'I' + theIndex + '\').value;');          }      }  }  labelAttack();    void (0);

Nå trippel posta du! :eek:

Men ellers bra script, bortsett fra at det ser ut som den bommer veldig på datoen :razz:
 
Status
Stengt for ytterligere svar.
Topp