[JavaScript] scripte zusammenfügen

Dieses Thema im Forum "Webentwicklung" wurde erstellt von Snoop87, 10. Februar 2009 .

Status des Themas:
Es sind keine weiteren Antworten möglich.
  1. 10. Februar 2009
    scripte zusammenfügen

    moin

    ich denke mal, es is nur eine noob frage, aber ich habe 0 ahnung von java.
    ich habe 2 java scripte (gehören zu einem browsergame) und würde sie gern zusammen haben.
    im mom. muss ich erst script #1 und danach script #2 bestätigen, ich hätte das aber gern automatisch, falls das möglich ist ?

    ich hoffe, das es jemand für mich erledigen kann, oder mir sagen kann, das es net möglich ist ^^

    lg
    snoop87


    script #1:

    javascript:Array.prototype.contains = function(obj) {var i, listed = false;for (i=0; i<this.length; i++) {if (this === obj) {listed = true;break;}}return listed;};function getGameDoc() {getdoc = window.document;if(! getdoc.URL.match('game\.php')) {for(var i=0; i<window.frames.length; i++) {if(window.frames.document.URL.match('game\.php')) {getdoc = window.frames.document;}}}return getdoc;};units = Array('axe','light','ram','catapult','priest');doc = getGameDoc();form = doc.units;inputs = form.getElementsByTagName('input');for (var i=0; i<inputs.length; i++) {if (inputs.type == 'text') {if (units.contains(inputs.name)) {next = inputs.nextSibling;do {next = next.nextSibling;} while (next.nodeType != 1);s = next.firstChild.nodeValue;insertUnit(form.elements[inputs.name], next.firstChild.nodeValue.replace(/\(/g, "").replace(/\)/g, ""));}}}document.forms.units.attack.click();


    script #2:

    javascript:function getGameDoc() {getdoc = window.document;if(! getdoc.URL.match('game\.php')) {for(var i=0; i<window.frames.length; i++) {if(window.frames.document.URL.match('game\.php')) {getdoc = window.frames.document;}}}return getdoc;};doc = getGameDoc();function main(doc){doc.getElementsByName('submit')[0].click();}if(!doc.URL.match('screen=place')) {alert('Du musst dich auf dem Platz befinden!');} else { main(doc);}
     
  2. 10. Februar 2009
    AW: [Frage] scripte zusammenfügen

    sorry, ach wenn es spam ist, aber das ließt sich keiner durch!!!
    änderne mal die formatierung und schiebe das mal in webentwicklung. denn JAVA != JAVASCRIPT
     
  3. 10. Februar 2009
    AW: [Frage] scripte zusammenfügen

    da du beim ersten n formular abschickst und die seite gewechselt wird isses leider ned möglich.

    aja, cheater!
     
  4. Video Script

    Videos zum Themenbereich

    * gefundene Videos auf YouTube, anhand der Überschrift.