Suche im Forum:
Suchen


Autor Nachricht
Beitrag26.05.2009 um 05:43 (UTC)    
Titel: Simulation wird nicht berechnet.

Morgen leute.

Hab ein Simulation " Tools " für www.ogame.de . Damit die leute über Verteidigung berechnen Können. Aber der tut es nicht. Könnt ihr mal die CODE Anschauen?

Zitat:
<div id="test">&nbsp;</div>
VerteidigungsberechnungMetall:<input onload="javascript: deffrechne();" onkeyup="javascript: deffrechne();" value="" name="metall" />Kristall:<input onload="javascript: deffrechne();" onkeyup="javascript:deffrechne();" value="" name="kristall" />Deuterium:<input onload="javascript: deffrechne();" onkeyup="javascript: deffrechne();" value="" name="deuterium" /><input type="submit" value="Berechnen" name="berechnen" /><input type="submit" value="L&ouml;schen" name="loeschen" />
<table class="zeil">
<tbody>
<tr class="odd">
<td>Raketetwerfer:&nbsp;&nbsp;&nbsp;</td>
<td style="font-weight: bold; text-align: right;">
<div id="rak">0</div>
</td>
<td>Leichter Laser:&nbsp;&nbsp;&nbsp;</td>
<td style="font-weight: bold; text-align: right;">
<div id="llaser">0</div>
</td>
</tr>
<tr class="even">
<td>Schwerer Laser:&nbsp;&nbsp;&nbsp;</td>
<td style="font-weight: bold; text-align: right;">
<div id="slaser">0</div>
</td>
<td>Gau&szlig;kanone:&nbsp;&nbsp;&nbsp;</td>
<td style="font-weight: bold; text-align: right;">
<div id="gauss">0</div>
</td>
</tr>
<tr class="odd">
<td>Ionengesch&uuml;tz:&nbsp;&nbsp;&nbsp;</td>
<td style="font-weight: bold; text-align: right;">
<div id="ionen">0</div>
</td>
<td>Plasmawerfer:&nbsp;&nbsp;&nbsp;</td>
<td style="font-weight: bold; text-align: right;">
<div id="plasma">0</div>
</td>
</tr>
<tr class="even">
<td>Abfangrakete:&nbsp;&nbsp;&nbsp;</td>
<td style="font-weight: bold; text-align: right;">
<div id="abfangrak">0</div>
</td>
<td>Interplanetarrakete:&nbsp;&nbsp;&nbsp;</td>
<td style="font-weight: bold; text-align: right;">
<div id="interrak">0</div>
</td>
</tr>
</tbody>
</table>


Ich würde mich sehr freuen, wenn da sich jmd kümmern würde.

Mfg
Beitrag26.05.2009 um 05:46 (UTC)    
Titel:

Ähm ja - da fehlt doch die Hälfte! Wo ist das dazugehörige Javascript? Wink
Beitrag26.05.2009 um 06:04 (UTC)    
Titel:

Ich werde es dann am abend mal gucken. Muss nämlich jetzt Arbeiten.

BITTE TREAD NICHT SCHLIESSEN!!!!

Mfg
Beitrag26.05.2009 um 07:35 (UTC)    
Titel:

Noch offene Fragen schließen wir nicht Wink
Aber ich verschiebe mal zum Thema:

JavaScript
Beitrag26.05.2009 um 18:03 (UTC)    
Titel:

Simulation wird aber diesmal bei anderen nicht berechnet und wird net gelinkt. Stimmt da was nicht?

Zitat:
<!-- = = = = = site content = = = = = --> <script type="text/javascript">
var data = Array(
Array(1, 60, 15, -1, -1, 1.5),
Array(2, 48, 24, -1, -1, 1.6),
Array(3, 225, 75, -1, -1, 1.5),
Array(4, 75, 30, -1, -1, 1.5),
Array(5, 900, 360, 180, -1, 1.Cool,
Array(6, 400, 120, 200, -1, -1),
Array(7, 1000000, 500000, 100000, -1, -1),
Array(8, 400, 200, 100, -1, -1),
Array(9, 2000, -1, -1, -1, -1),
Array(10, 2000, 1000, -1, -1, -1),
Array(11, 2000, 2000, -1, -1, -1),
Array(12, 200, 400, 200, -1, -1),
Array(13, -1, 50000, 100000, 1000, -1),
Array(14, 20000, 40000, 0, -1, -1),
Array(15, 20000, 20000, 1000, -1, -1),
Array(16, 20000, 40000, 20000, -1, -1),
Array(17, 20000, 40000, 20000, -1, -1),
Array(18, 2000000, 4000000, 2000000, -1, -1),
Array(51, 400, 120, 200, -1, -1),
Array(52, 400, 200, 100, -1, -1),
Array(53, 2000, -1, -1, -1, -1),
Array(54, 2000, 1000, -1, -1, -1),
Array(55, 2000, 2000, -1, -1, -1),
Array(56, 20000, 40000, 0, -1, -1),
Array(210, -1, 2000, 500, -1, -1),
Array(301, 2000, -1, -1, -1, -1),
Array(302, 1500, 500, -1, -1, -1),
Array(303, 6000, 2000, -1, -1, -1),
Array(304, 20000, 15000, 2000, -1, -1),
Array(305, 2000, 6000, -1, -1, -1),
Array(306, 50000, 50000, 30000, -1, -1),
Array(307, 10000, 10000, -1, -1, -1),
Array(308, 50000, 50000, -1, -1, -1),
Array(309, 8000, -1, 2000, -1, -1),
Array(310, 12500, 2500, 10000, -1, -1)
);
function berechne(ii) {
ii++;ii--;
var Res = 0;

for (i = 0; i < data.length; i++) {
if (data[i][0] == ii) {
var Metall = data[i][1];
var Kristall = data[i][2];
var Deuterium = data[i][3];
var Faktor = data[i][5];
}
}

if (ii < 100) {
if (Faktor != 2) {
for (i = 0; i < document.getElementById('i'+ii).value; i++) {
Res = Res + Math.floor(Metall * Math.pow(Faktor, i)) + Math.floor(Kristall * Math.pow(Faktor, i)) + Math.floor(Deuterium * Math.pow(Faktor, i));
}
} else {
Res = -1 * (Metall + Kristall + Deuterium) * (1-Math.pow(2,document.getElementById('i'+ii).value));
}
} else {
Res = (Metall + Kristall + Deuterium) * document.getElementById('i'+ii).value;
}
document.getElementById('l'+ii).firstChild.nodeValue = Res/1000;

berechneresult();
}

function berechneresult() {
var ges = 0;
var tmp = 0;
for (i = 0; i < data.length; i++) {
tmp = document.getElementById('l'+data[i][0]).firstChild.nodeValue; tmp++; tmp--;
ges = ges + tmp;
}
document.getElementById('lres').firstChild.nodeValue = Math.round(ges*100)/100;
};

function reset() {
for (i = 0; i < data.length; i++) {
document.getElementById('i'+data[i][0]).value = '0';
document.getElementById('l'+data[i][0]).firstChild.nodeValue = '0';
}
document.getElementById('lres').firstChild.nodeValue = '0';
}

function div(a, b) {
return Math.floor(a / b);
}

function mod(a, b) {
return a - Math.floor(a / b) * b; // schon besser YEAH ^^
}

function chkint(id) {
sxx = '';
sx = id.value.toUpperCase();
for(i = 0; i < sx.length; i++) {
if(sx.charCodeAt(i) >= 48 && sx.charCodeAt(i) <= 57) {
sxx = sxx + sx.charAt(i);
}
}
if(id.value != sxx) {
id.value = sxx;
}
}

function chkval(id) {
if (id.value == '') id.value = '0';
}

function shwt(id) {
var ids = Array('pgeb', 'pdef', 'mgeb');
for (i = 0; i < ids.length; i++) {
document.getElementById(ids[i]).style.visibility = 'hidden';
document.getElementById(ids[i]).style.display = 'none';
}
document.getElementById(id).style.visibility = 'visible';
document.getElementById(id).style.display = 'block';
}

</script>
<div align="center"><a onclick="shwt('pgeb')" href="#">Geb&auml;ude(Planet)</a> - <a onclick="shwt('pdef')" href="#">Verteidigung(Planet)</a> - <a onclick="shwt('mgeb');" href="#">Geb&auml;ude(Mond)</a></div>
&nbsp;
<div align="center">&nbsp;</div>
<table cellspacing="1" cellpadding="1" border="1" align="center">
<tbody>
<tr>
<td colspan="3"><font class="blue">Planet - Geb&auml;ude</font></td>
</tr>
<tr>
<td style="width: 150px;">Metallmine:</td>
<td style="width: 100px;"><input type="text" onkeyup="chkint(this);berechne('1');" onblur="chkval(this)" style="width: 55px;" value="0" maxlength="2" id="i1" /></td>
<td><span id="l1">0</span> Punkte</td>
</tr>
<tr>
<td>Kristallmine:</td>
<td><input type="text" onkeyup="chkint(this);berechne('2');" onblur="chkval(this)" style="width: 55px;" value="0" maxlength="2" id="i2" /></td>
<td><span id="l2">0</span> Punkte</td>
</tr>
<tr>
<td>Deuteriumsynthetisierer:</td>
<td><input type="text" onkeyup="chkint(this);berechne('3');" onblur="chkval(this)" style="width: 55px;" value="0" maxlength="2" id="i3" /></td>
<td><span id="l3">0</span> Punkte</td>
</tr>
<tr>
<td>Solarkraftwerk:</td>
<td><input type="text" onkeyup="chkint(this);berechne('4');" onblur="chkval(this)" style="width: 55px;" value="0" maxlength="2" id="i4" /></td>
<td><span id="l4">0</span> Punkte</td>
</tr>
<tr>
<td>Fusionskraftwerk:</td>
<td><input type="text" onkeyup="chkint(this);berechne('5');" onblur="chkval(this)" style="width: 55px;" value="0" maxlength="2" id="i5" /></td>
<td><span id="l5">0</span> Punkte</td>
</tr>
<tr>
<td>Roboterfabrik:</td>
<td><input type="text" onkeyup="chkint(this);berechne('6');" onblur="chkval(this)" style="width: 55px;" value="0" maxlength="2" id="i6" /></td>
<td><span id="l6">0</span> Punkte</td>
</tr>
<tr>
<td>Nanitenfabrik:</td>
<td><input type="text" onkeyup="chkint(this);berechne('7');" onblur="chkval(this)" style="width: 55px;" value="0" maxlength="2" id="i7" /></td>
<td><span id="l7">0</span> Punkte</td>
</tr>
<tr>
<td>Raumschiffwerft:</td>
<td><input type="text" onkeyup="chkint(this);berechne('8');" onblur="chkval(this)" style="width: 55px;" value="0" maxlength="2" id="i8" /></td>
<td><span id="l8">0</span> Punkte</td>
</tr>
<tr>
<td>Metallspeicher:</td>
<td><input type="text" onkeyup="chkint(this);berechne('9');" onblur="chkval(this)" style="width: 55px;" value="0" maxlength="2" id="i9" /></td>
<td><span id="l9">0</span> Punkte</td>
</tr>
<tr>
<td>Kristallspeicher:</td>
<td><input type="text" onkeyup="chkint(this);berechne('10');" onblur="chkval(this)" style="width: 55px;" value="0" maxlength="2" id="i10" /></td>
<td><span id="l10">0</span> Punkte</td>
</tr>
<tr>
<td>Deuteriumtank:</td>
<td><input type="text" onkeyup="chkint(this);berechne('11');" onblur="chkval(this)" style="width: 55px;" value="0" maxlength="2" id="i11" /></td>
<td><span id="l11">0</span> Punkte</td>
</tr>
<tr>
<td>Forschungslabor:</td>
<td><input type="text" onkeyup="chkint(this);berechne('12');" onblur="chkval(this)" style="width: 55px;" value="0" maxlength="2" id="i12" /></td>
<td><span id="l12">0</span> Punkte</td>
</tr>
<tr>
<td>Terraformer:</td>
<td><input type="text" onkeyup="chkint(this);berechne('13');" onblur="chkval(this)" style="width: 55px;" value="0" maxlength="2" id="i13" /></td>
<td><span id="l13">0</span> Punkte</td>
</tr>
<tr align="left">
<td>Allianzdepot:</td>
<td><input type="text" onkeyup="chkint(this);berechne('14');" onblur="chkval(this)" style="width: 55px;" value="0" maxlength="2" id="i14" /></td>
<td><span id="l14">0</span> Punkte</td>
</tr>
<tr align="left">
<td>Raketensilo:</td>
<td><input type="text" onkeyup="chkint(this);berechne('15');" onblur="chkval(this)" style="width: 55px;" value="0" maxlength="2" id="i15" /></td>
<td><span id="l15">0</span> Punkte</td>
</tr>
<tr align="left">
<td><font style="font-size: 10px; color: rgb(153, 153, 153);">Zusatz:</font> Sateliten:</td>
<td><input type="text" onkeyup="chkint(this);berechne('210');" onblur="chkval(this)" style="width: 55px;" value="0" maxlength="6" id="i210" /></td>
<td><span id="l210">0</span> Punkte</td>
</tr>
</tbody>
</table>
<div align="center">&nbsp;</div>
&nbsp;
<div align="center">&nbsp;</div>
<div style="height: 375px; visibility: hidden; display: none; margin-top: 10px;" id="pdef">
<table cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<td colspan="3"><font class="blue">Planet - Verteidigung</font></td>
</tr>
<tr>
<td style="width: 150px;">Raketenwerfer:</td>
<td style="width: 100px;"><input type="text" onkeyup="chkint(this);berechne('301');" onblur="chkval(this)" style="width: 55px;" value="0" maxlength="6" id="i301" /></td>
<td><span id="l301">0</span> Punkte</td>
</tr>
<tr>
<td>Leichtes Lasergesch&uuml;tz:</td>
<td><input type="text" onkeyup="chkint(this);berechne('302');" onblur="chkval(this)" style="width: 55px;" value="0" maxlength="6" id="i302" /></td>
<td><span id="l302">0</span> Punkte</td>
</tr>
<tr>
<td>Schweres Lasergesch&uuml;tz:</td>
<td><input type="text" onkeyup="chkint(this);berechne('303');" onblur="chkval(this)" style="width: 55px;" value="0" maxlength="6" id="i303" /></td>
<td><span id="l303">0</span> Punkte</td>
</tr>
<tr>
<td>Gau&szlig;kanone:</td>
<td><input type="text" onkeyup="chkint(this);berechne('304');" onblur="chkval(this)" style="width: 55px;" value="0" maxlength="6" id="i304" /></td>
<td><span id="l304">0</span> Punkte</td>
</tr>
<tr>
<td>Ionengesch&uuml;tz:</td>
<td><input type="text" onkeyup="chkint(this);berechne('305');" onblur="chkval(this)" style="width: 55px;" value="0" maxlength="6" id="i305" /></td>
<td><span id="l305">0</span> Punkte</td>
</tr>
<tr>
<td>Plasmawerfer:</td>
<td><input type="text" onkeyup="chkint(this);berechne('306');" onblur="chkval(this)" style="width: 55px;" value="0" maxlength="6" id="i306" /></td>
<td><span id="l306">0</span> Punkte</td>
</tr>
<tr>
<td>Kleine Schildkuppel:</td>
<td><input type="text" onkeyup="chkint(this);berechne('307');" onblur="chkval(this)" style="width: 55px;" value="0" maxlength="6" id="i307" /></td>
<td><span id="l307">0</span> Punkte</td>
</tr>
<tr>
<td>Gro&szlig;e Schildkuppel:</td>
<td><input type="text" onkeyup="chkint(this);berechne('308');" onblur="chkval(this)" style="width: 55px;" value="0" maxlength="6" id="i308" /></td>
<td><span id="l308">0</span> Punkte</td>
</tr>
<tr>
<td>Abfang Rakete:</td>
<td><input type="text" onkeyup="chkint(this);berechne('309');" onblur="chkval(this)" style="width: 55px;" value="0" maxlength="6" id="i309" /></td>
<td><span id="l309">0</span> Punkte</td>
</tr>
<tr>
<td>Interplanetar Rakete:</td>
<td><input type="text" onkeyup="chkint(this);berechne('310');" onblur="chkval(this)" style="width: 55px;" value="0" maxlength="6" id="i310" /></td>
<td><span id="l310">0</span> Punkte</td>
</tr>
</tbody>
</table>
</div>
<div style="height: 375px; visibility: hidden; display: none; margin-top: 10px;" id="mgeb">
<table cellspacing="1" cellpadding="1" border="1">
<tbody>
<tr>
<td colspan="3"><font class="blue">Mond - Geb&auml;ude</font></td>
</tr>
<tr>
<td style="width: 150px;">Roboterfabrik:</td>
<td style="width: 100px;"><input type="text" onkeyup="chkint(this);berechne('51');" onblur="chkval(this)" style="width: 55px;" value="0" maxlength="2" id="i51" /></td>
<td><span id="l51">0</span> Punkte</td>
</tr>
<tr>
<td>Raumschiffwerft:</td>
<td><input type="text" onkeyup="chkint(this);berechne('52');" onblur="chkval(this)" style="width: 55px;" value="0" maxlength="2" id="i52" /></td>
<td><span id="l52">0</span> Punkte</td>
</tr>
<tr>
<td>Metallspeicher:</td>
<td><input type="text" onkeyup="chkint(this);berechne('53');" onblur="chkval(this)" style="width: 55px;" value="0" maxlength="2" id="i53" /></td>
<td><span id="l53">0</span> Punkte</td>
</tr>
<tr>
<td>Kristallspeicher:</td>
<td><input type="text" onkeyup="chkint(this);berechne('54');" onblur="chkval(this)" style="width: 55px;" value="0" maxlength="2" id="i54" /></td>
<td><span id="l54">0</span> Punkte</td>
</tr>
<tr>
<td>Deuteriumtank:</td>
<td><input type="text" onkeyup="chkint(this);berechne('55');" onblur="chkval(this)" style="width: 55px;" value="0" maxlength="2" id="i55" /></td>
<td><span id="l55">0</span> Punkte</td>
</tr>
<tr>
<td>Allianzdepot:</td>
<td><input type="text" onkeyup="chkint(this);berechne('56');" onblur="chkval(this)" style="width: 55px;" value="0" maxlength="2" id="i56" /></td>
<td><span id="l56">0</span> Punkte</td>
</tr>
<tr>
<td>Mondbasis:</td>
<td><input type="text" onkeyup="chkint(this);berechne('16');" onblur="chkval(this)" style="width: 55px;" value="0" maxlength="2" id="i16" /></td>
<td><span id="l16">0</span> Punkte</td>
</tr>
<tr>
<td>Sensorphalanx:</td>
<td><input type="text" onkeyup="chkint(this);berechne('17');" onblur="chkval(this)" style="width: 55px;" value="0" maxlength="2" id="i17" /></td>
<td><span id="l17">0</span> Punkte</td>
</tr>
<tr>
<td>Sprungtor:</td>
<td><input type="text" onkeyup="chkint(this);berechne('18');" onblur="chkval(this)" style="width: 55px;" value="0" maxlength="2" id="i18" /></td>
<td><span id="l18">0</span> Punkte</td>
</tr>
</tbody>
</table>
</div>
<br />
<br />
<div align="left">&nbsp;</div>
<table cellspacing="1" cellpadding="1" align="left" style="border-style: solid none none; border-color: rgb(102, 102, 102) -moz-use-text-color -moz-use-text-color; border-width: 1px 0px 0px; width: 325px;">
<tbody>
<tr>
<td align="center"><span id="lres">0</span> Punkte</td>
</tr>
</tbody>
</table>
<div align="left"><br />
<a onclick="reset()" href="#"><br />
Zur&uuml;cksetzen</a></div>
<!-- = = = = = site content end = = = = = -->


Bedank mich schon mal im voraus!!!
Beiträge der letzten Zeit anzeigen:   


Powered by phpBB © 2001, 2005 phpBB Group
Deutsche Übersetzung von phpBB.de