Truppenzähler mit Bogen

DeletedUser

Gast
Hey,
Ich denke wie man dem Thread Namen entnehmen kann, ist ein Truppenzähler für / mit Bogen gesucht.

Sry, wusste nicht wo ichs hinposten soll, also in Fragen.

Hoffe mir kann jmd. helfen :smile:

LG
 

DeletedUser

Gast
javascript: var doc; if (top.frames.length > 1){ doc = (top.frames[1].document.URL.match('game.php') == 'game.php') ? top.frames[1].document : top.frames[0].document; } else { doc = document; }; if (!doc.URL.match('mode=units')){ UI.InfoMessage('Du musst dich auf der "Truppen"-Übersicht befinden!',3000,true); } else { script(doc); }; function script(doc){ if (typeof(world) == 'undefined') { units = Array(Array(0,'Speerträger'),Array(1,'Schwertkämpfer'),Array(2,'Axtkämpfer'),Array(3,'Bogenschützen'),Array(4,'Späher'),Array(5,'Leichte Kavallerie'),Array(6,'Berittener Bogenschütze'),Array(7,'Schwere Kavallerie'),Array(8,'Rammböcke'),Array(9,'Katapulte')); } else { if (world == 'oBogen') { units = Array(Array(0,'Speerträger'),Array(1,'Schwertkämpfer'),Array(2,'Axtkämpfer'),Array(3,'Bogenschützen'),Array(4,'Späher'),Array(5,'Leichte Kavallerie'),Array(6,'Schwere Kavallerie'),Array(7,'Rammböcke'),Array(8,'Katapulte')); } else if (world == 'mBogen') { units = Array(Array(0,'Speerträger'),Array(1,'Schwertkämpfer'),Array(2,'Axtkämpfer'),Array(3,'Bogenschützen'),Array(4,'Späher'),Array(5,'Leichte Kavallerie'),Array(6,'Berittener Bogenschütze'),Array(7,'Schwere Kavallerie'),Array(8,'Rammböcke'),Array(9,'Katapulte')); } } units_count = units.length; troops = new Array(units_count); for (var i = 0; i < units_count; i++) troops=0; village_count = 0; var troops_cells = document.getElementById('units_table').getElementsByTagName('td'); for (var x = 0; x < troops_cells.length; x++) { if (typeof(art) == 'undefined') { if (troops_cells[x].firstChild.nodeValue == 'eigeni' || troops_cells[x].firstChild.nodeValue == 'uswärts' || troops_cells[x].firstChild.nodeValue == 'untrwägs') { village_count += 1; next = troops_cells[x].nextSibling; for (var y = 0; y < units_count; y++) { do {next = next.nextSibling;} while (next.nodeType != 1) troops[y] += parseInt(next.firstChild.nodeValue); } } } else { if (world == 'Im Dorf' && troops_cells[x].firstChild.nodeValue == 'eigeni') { village_count += 1; next = troops_cells[x].nextSibling; for (var y = 0; y < units_count; y++) { do {next = next.nextSibling;} while (next.nodeType != 1) troops[y] += parseInt(next.firstChild.nodeValue); } } else if (world == 'uswärts' && troops_cells[x].firstChild.nodeValue == 'uswärts' || troops_cells[x].firstChild.nodeValue == 'untrwägs') { village_count += 1; next = troops_cells[x].nextSibling; for (var y = 0; y < units_count; y++) { do {next = next.nextSibling;} while (next.nodeType != 1) troops[y] += parseInt(next.firstChild.nodeValue); } } else if (world == 'Gesamt' && troops_cells[x].firstChild.nodeValue == 'eigeni' || troops_cells[x].firstChild.nodeValue == 'uswärts' || troops_cells[x].firstChild.nodeValue == 'untrwägs') { village_count += 1; next = troops_cells[x].nextSibling; for (var y = 0; y < units_count; y++) { do {next = next.nextSibling;} while (next.nodeType != 1) troops[y] += parseInt(next.firstChild.nodeValue); }; } } } if (village_count > 0) { var output =''; for (var i = 0; i < units_count; i++) { output += "<tr><td style='color:blue'>&nbsp;&nbsp;" + units[1] + "&nbsp;&nbsp;&nbsp;</td><td style='color:red; text-align:right'>" + troops + "</td></tr>"; } width = 330; height = 290; left = (screen.width - width)/2; top = (screen.height - height)/2; popup = window.open('','','width='+width+', height='+height+', top='+top+', left='+left); popup.document.write("<html><head><title>Truppenübersicht</title></head><body style='background-color: #F1EBDD; border: 1px #804000 solid'><br><table>" + output + "</table><br></body></html>"); } else { UI.InfoMessage('Fehler! Keine Dörfer/Truppen gefunden!',3000,true); } };

Das funzt bei mir :wink:
 
Zuletzt bearbeitet von einem Moderator:

DeletedUser7971

Gast
Du mussts in nen Code machen sonst nimmts das Script nicht wegen Zeilenunbruch...
 

DeletedUser7971

Gast
Jonas muss es mit [:code][:confused:code] ohne : posten, sonst machts nen Zeilenumbruch rein...
 

DeletedUser

Gast
Code:
javascript: var doc; if (top.frames.length > 1){ doc = (top.frames[1].document.URL.match('game.php') == 'game.php') ? top.frames[1].document : top.frames[0].document; } else { doc = document; }; if (!doc.URL.match('mode=units')){ UI.InfoMessage('Du musst dich auf der "Truppen"-Übersicht befinden!',3000,true); } else { script(doc); }; function script(doc){ if (typeof(world) == 'undefined') { units = Array(Array(0,'Speerträger'),Array(1,'Schwertkäm pfer'),Array(2,'Axtkämpfer'),Array(3,'Bogenschüt zen'),Array(4,'Späher'),Array(5,'Leichte Kavallerie'),Array(6,'Berittener Bogenschütze'),Array(7,'Schwere Kavallerie'),Array(8,'Rammböcke'),Array(9,'Katapu lte')); } else { if (world == 'oBogen') { units = Array(Array(0,'Speerträger'),Array(1,'Schwertkäm pfer'),Array(2,'Axtkämpfer'),Array(3,'Bogenschüt zen'),Array(4,'Späher'),Array(5,'Leichte Kavallerie'),Array(6,'Schwere Kavallerie'),Array(7,'Rammböcke'),Array(8,'Katapu lte')); } else if (world == 'mBogen') { units = Array(Array(0,'Speerträger'),Array(1,'Schwertkäm pfer'),Array(2,'Axtkämpfer'),Array(3,'Bogenschüt zen'),Array(4,'Späher'),Array(5,'Leichte Kavallerie'),Array(6,'Berittener Bogenschütze'),Array(7,'Schwere Kavallerie'),Array(8,'Rammböcke'),Array(9,'Katapu lte')); } } units_count = units.length; troops = new Array(units_count); for (var i = 0; i < units_count; i++) troops[i]=0; village_count = 0; var troops_cells = document.getElementById('units_table').getElements ByTagName('td'); for (var x = 0; x < troops_cells.length; x++) { if (typeof(art) == 'undefined') { if (troops_cells[x].firstChild.nodeValue == 'eigeni' || troops_cells[x].firstChild.nodeValue == 'uswärts' || troops_cells[x].firstChild.nodeValue == 'untrwägs') { village_count += 1; next = troops_cells[x].nextSibling; for (var y = 0; y < units_count; y++) { do {next = next.nextSibling;} while (next.nodeType != 1) troops[y] += parseInt(next.firstChild.nodeValue); } } } else { if (world == 'Im Dorf' && troops_cells[x].firstChild.nodeValue == 'eigeni') { village_count += 1; next = troops_cells[x].nextSibling; for (var y = 0; y < units_count; y++) { do {next = next.nextSibling;} while (next.nodeType != 1) troops[y] += parseInt(next.firstChild.nodeValue); } } else if (world == 'uswärts' && troops_cells[x].firstChild.nodeValue == 'uswärts' || troops_cells[x].firstChild.nodeValue == 'untrwägs') { village_count += 1; next = troops_cells[x].nextSibling; for (var y = 0; y < units_count; y++) { do {next = next.nextSibling;} while (next.nodeType != 1) troops[y] += parseInt(next.firstChild.nodeValue); } } else if (world == 'Gesamt' && troops_cells[x].firstChild.nodeValue == 'eigeni' || troops_cells[x].firstChild.nodeValue == 'uswärts' || troops_cells[x].firstChild.nodeValue == 'untrwägs') { village_count += 1; next = troops_cells[x].nextSibling; for (var y = 0; y < units_count; y++) { do {next = next.nextSibling;} while (next.nodeType != 1) troops[y] += parseInt(next.firstChild.nodeValue); }; } } } if (village_count > 0) { var output =''; for (var i = 0; i < units_count; i++) { output += "<tr><td style='color:blue'>&nbsp;&nbsp;" + units[i][1] + "&nbsp;&nbsp;&nbsp;</td><td style='color:red; text-align:right'>" + troops[i] + "</td></tr>"; } width = 330; height = 290; left = (screen.width - width)/2; top = (screen.height - height)/2; popup = window.open('','','width='+width+', height='+height+', top='+top+', left='+left); popup.document.write("<html><head><title>Truppenü bersicht</title></head><body style='background-color: #F1EBDD; border: 1px #804000 solid'><br><table>" + output + "</table><br></body></html>"); } else { UI.InfoMessage('Fehler! Keine Dörfer/Truppen gefunden!',3000,true); } };

funzt immer noch ned :confused:
 

DeletedUser8660

Gast
Jo weil der Zeilenumbruch immer noch drin ist.

Code:
javascript: var doc; if (top.frames.length > 1){ doc = (top.frames[1].document.URL.match('game.php') == 'game.php') ? top.frames[1].document : top.frames[0].document; } else { doc = document; }; if (!doc.URL.match('mode=units')){ UI.InfoMessage('Du musst dich auf der "Truppen"-Übersicht befinden!',3000,true); } else { script(doc); }; function script(doc){ if (typeof(world) == 'undefined') { units = Array(Array(0,'Speerträger'),Array(1,'Schwertkämpfer'),Array(2,'Axtkämpfer'),Array(3,'Bogenschützen'),Array(4,'Späher'),Array(5,'Leichte Kavallerie'),Array(6,'Berittener Bogenschütze'),Array(7,'Schwere Kavallerie'),Array(8,'Rammböcke'),Array(9,'Katapulte')); } else { if (world == 'oBogen') { units = Array(Array(0,'Speerträger'),Array(1,'Schwertkämpfer'),Array(2,'Axtkämpfer'),Array(3,'Bogenschützen'),Array(4,'Späher'),Array(5,'Leichte Kavallerie'),Array(6,'Schwere Kavallerie'),Array(7,'Rammböcke'),Array(8,'Katapulte')); } else if (world == 'mBogen') { units = Array(Array(0,'Speerträger'),Array(1,'Schwertkämpfer'),Array(2,'Axtkämpfer'),Array(3,'Bogenschützen'),Array(4,'Späher'),Array(5,'Leichte Kavallerie'),Array(6,'Berittener Bogenschütze'),Array(7,'Schwere Kavallerie'),Array(8,'Rammböcke'),Array(9,'Katapulte')); } } units_count = units.length; troops = new Array(units_count); for (var i = 0; i < units_count; i++) troops[i]=0; village_count = 0; var troops_cells = document.getElementById('units_table').getElementsByTagName('td'); for (var x = 0; x < troops_cells.length; x++) { if (typeof(art) == 'undefined') { if (troops_cells[x].firstChild.nodeValue == 'eigeni' || troops_cells[x].firstChild.nodeValue == 'uswärts' || troops_cells[x].firstChild.nodeValue == 'untrwägs') { village_count += 1; next = troops_cells[x].nextSibling; for (var y = 0; y < units_count; y++) { do {next = next.nextSibling;} while (next.nodeType != 1) troops[y] += parseInt(next.firstChild.nodeValue); } } } else { if (world == 'Im Dorf' && troops_cells[x].firstChild.nodeValue == 'eigeni') { village_count += 1; next = troops_cells[x].nextSibling; for (var y = 0; y < units_count; y++) { do {next = next.nextSibling;} while (next.nodeType != 1) troops[y] += parseInt(next.firstChild.nodeValue); } } else if (world == 'uswärts' && troops_cells[x].firstChild.nodeValue == 'uswärts' || troops_cells[x].firstChild.nodeValue == 'untrwägs') { village_count += 1; next = troops_cells[x].nextSibling; for (var y = 0; y < units_count; y++) { do {next = next.nextSibling;} while (next.nodeType != 1) troops[y] += parseInt(next.firstChild.nodeValue); } } else if (world == 'Gesamt' && troops_cells[x].firstChild.nodeValue == 'eigeni' || troops_cells[x].firstChild.nodeValue == 'uswärts' || troops_cells[x].firstChild.nodeValue == 'untrwägs') { village_count += 1; next = troops_cells[x].nextSibling; for (var y = 0; y < units_count; y++) { do {next = next.nextSibling;} while (next.nodeType != 1) troops[y] += parseInt(next.firstChild.nodeValue); }; } } } if (village_count > 0) { var output =''; for (var i = 0; i < units_count; i++) { output += "<tr><td style='color:blue'>&nbsp;&nbsp;" + units[i][1] + "&nbsp;&nbsp;&nbsp;</td><td style='color:red; text-align:right'>" + troops[i] + "</td></tr>"; } width = 330; height = 290; left = (screen.width - width)/2; top = (screen.height - height)/2; popup = window.open('','','width='+width+', height='+height+', top='+top+', left='+left); popup.document.write("<html><head><title>Truppenübersicht</title></head><body style='background-color: #F1EBDD; border: 1px #804000 solid'><br><table>" + output + "</table><br></body></html>"); } else { UI.InfoMessage('Fehler! Keine Dörfer/Truppen gefunden!',3000,true); } };

Hier ohne.
 
Oben