Támogatás keresése

Kerülje el a támogatási csalásokat. Sosem kérjük arra, hogy hívjon fel egy telefonszámot vagy osszon meg személyes információkat. Jelentse a gyanús tevékenységeket a „Visszaélés bejelentése” lehetőséggel.

Learn More

A témacsoportot lezárták és archiválták. Tegyen fel új kérdést, ha segítségre van szüksége.

running a script i get TypeError:eleForm is NUll

more options

this is the script, which is used for tribalwars and works great on Opera, but having issue in question when trying to use it

here is the script

javascript:var config={victim:'miscellaneous',trainSize:1,units:{spear:0,sword:0,axe:0,spy:1,light:0,marcher:0,heavy:0,ram:0,catapult:1},cookieID:'fake'};var targets='586|422 584|422 584|423 585|420 580|473 581|473 565|473 566|469 563|475 562|478 585|419 582|424 586|428 586|429 590|428 590|429 590|426 592|427 592|428 592|429 591|432 593|434 592|434 591|434 590|434 583|435 583|436 567|452 567|448 564|448 576|424 574|422 573|422 603|425 602|423 603|422 599|426 601|437 600|436 582|436 582|439 583|438 584|437 586|436 586|435 589|435 589|436 587|437 588|438 589|438 589|437 590|435 591|435 591|437 592|438 593|438 594|438 594|436 595|436 572|462 573|462 573|460 572|458 574|457 565|459 568|459 565|462 571|449 594|440 589|440 589|444 587|440 585|440 583|445 588|446 589|447 598|434 573|433 577|433 578|433 578|434 581|434 579|436 578|435 577|435 576|435 568|436 568|443 569|442 580|440 581|440 581|441 580|442 577|449 575|450 574|449';if(targets.replace(/^\s\s*/,'').replace(/\s\s*$/,'')===''){throw('There are no Targets');}var coords=targets.split(' ');function escapeStr(text){var specials=['/','.',',','~','`','@','#','%','-','_','*','+','?','|','
,'=',':','!','^','<','>','(',')','[',']','{','}','\\'];var sRE=new RegExp('(\\'+specials.join('|\\')+')','g');return text.replace(sRE,'\\$1');}function zeroPad(number,length){var n=number.toString();while(n.length<length){n='0'+n;}return n;}function fnWriteCookie(index){var cookie_date=new Date(2099,11,11);document.cookie=vWorld+'</nowiki></pre>+config.victim+'</nowiki></pre>+config.cookieID+'='+(index+1)+';expires='+cookie_date.toGMTString();}function fnAssignUnits(index,isManualReset){if((index<0)||(index>=coords.length)){index=0;if(document.fakeSequence==1){alert('cycle restarted');}}document.getElementById('fake_combo').selectedIndex=index;var villa=coords[index].split('|');if(!isManualReset&&(document.fakeSequence<config.trainSize)){document.fakeSequence++;}else{document.fakeSequence=(isManualReset?2:1);fnWriteCookie(isManualReset?index-1:index);}var eleForm=document.getElementById('units_form');eleForm.x.value=villa[0];eleForm.y.value=villa[1];var count;for(var unit in config.units){if(config.units.hasOwnProperty(unit)){if(typeof(eleForm[unit])!='undefined'){count=parseInt(eleForm[unit].nextSibling.nextSibling.innerHTML.match(/\d+/),10);eleForm[unit].value=Math.min(config.units[unit],count);}}}}try{if(typeof(document.fakeSequence)=='undefined'){document.fakeSequence=1;}var scrape,vScreen=(scrape=document.URL.match(/\&screen=(\w+)/i))?scrape[1]:null;var vWorld=(scrape=document.URL.match(/\/\/(\w+)\./i))?scrape[1]:null;var village=document.getElementsByTagName('title')[0].innerHTML.match(/\(\d+\|\d+\)/);if(vScreen=='place'){var index=0;var twCookie=document.cookie.match('[^|;]s?'+escapeStr(vWorld+'</nowiki></pre>+config.victim+'</nowiki></pre>+config.cookieID+'=')+'([^;]*)[;|$]');if(twCookie){index=parseInt(twCookie[1],10);}if(!document.getElementById('fake_combo')){var eleInputs=document.getElementsByTagName('input');if(eleInputs){for(var ii=0;ii<eleInputs.length;ii++){if(eleInputs[ii].name=='support'){var optionList=<em>;for(var jj=0;jj<coords.length;jj++){optionList+='<option>'+zeroPad(jj+1,4)+':'+coords[jj]+'</option>';}eleInputs[ii].parentNode.parentNode.innerHTML+='<TD rowspan="2"><div id="fakes"><table class="main"><tr><td id="fake-content-value"><span style="font-weight:bold">Current Target:</span><select id="fake_combo" name="fake_combo" size="1" onchange="fnAssignUnits(this.selectedIndex,true);">'+optionList+'</select><span style="font-weight:100;font-style:italic;text-decoration:none;font-size:x-small;"><a href="http://www.crosstrigger.com" target="_blank"> by dalesmckay</a></TD>';break;}}}}fnAssignUnits(index,false);}else{throw('Run from the Rally point');}void(0);}catch(objErr){alert(objErr);}</nowiki></pre>
this is the script, which is used for tribalwars and works great on Opera, but having issue in question when trying to use it here is the script <pre><nowiki>javascript:var config={victim:'miscellaneous',trainSize:1,units:{spear:0,sword:0,axe:0,spy:1,light:0,marcher:0,heavy:0,ram:0,catapult:1},cookieID:'fake'};var targets='586|422 584|422 584|423 585|420 580|473 581|473 565|473 566|469 563|475 562|478 585|419 582|424 586|428 586|429 590|428 590|429 590|426 592|427 592|428 592|429 591|432 593|434 592|434 591|434 590|434 583|435 583|436 567|452 567|448 564|448 576|424 574|422 573|422 603|425 602|423 603|422 599|426 601|437 600|436 582|436 582|439 583|438 584|437 586|436 586|435 589|435 589|436 587|437 588|438 589|438 589|437 590|435 591|435 591|437 592|438 593|438 594|438 594|436 595|436 572|462 573|462 573|460 572|458 574|457 565|459 568|459 565|462 571|449 594|440 589|440 589|444 587|440 585|440 583|445 588|446 589|447 598|434 573|433 577|433 578|433 578|434 581|434 579|436 578|435 577|435 576|435 568|436 568|443 569|442 580|440 581|440 581|441 580|442 577|449 575|450 574|449';if(targets.replace(/^\s\s*/,'').replace(/\s\s*$/,'')===''){throw('There are no Targets');}var coords=targets.split(' ');function escapeStr(text){var specials=['/','.',',','~','`','@','#','%','-','_','*','+','?','|','</nowiki></pre>,'=',':','!','^','<','>','(',')','[',']','{','}','\\'];var sRE=new RegExp('(\\'+specials.join('|\\')+')','g');return text.replace(sRE,'\\$1');}function zeroPad(number,length){var n=number.toString();while(n.length<length){n='0'+n;}return n;}function fnWriteCookie(index){var cookie_date=new Date(2099,11,11);document.cookie=vWorld+'</nowiki></pre>+config.victim+'</nowiki></pre>+config.cookieID+'='+(index+1)+';expires='+cookie_date.toGMTString();}function fnAssignUnits(index,isManualReset){if((index<0)||(index>=coords.length)){index=0;if(document.fakeSequence==1){alert('cycle restarted');}}document.getElementById('fake_combo').selectedIndex=index;var villa=coords[index].split('|');if(!isManualReset&&(document.fakeSequence<config.trainSize)){document.fakeSequence++;}else{document.fakeSequence=(isManualReset?2:1);fnWriteCookie(isManualReset?index-1:index);}var eleForm=document.getElementById('units_form');eleForm.x.value=villa[0];eleForm.y.value=villa[1];var count;for(var unit in config.units){if(config.units.hasOwnProperty(unit)){if(typeof(eleForm[unit])!='undefined'){count=parseInt(eleForm[unit].nextSibling.nextSibling.innerHTML.match(/\d+/),10);eleForm[unit].value=Math.min(config.units[unit],count);}}}}try{if(typeof(document.fakeSequence)=='undefined'){document.fakeSequence=1;}var scrape,vScreen=(scrape=document.URL.match(/\&screen=(\w+)/i))?scrape[1]:null;var vWorld=(scrape=document.URL.match(/\/\/(\w+)\./i))?scrape[1]:null;var village=document.getElementsByTagName('title')[0].innerHTML.match(/\(\d+\|\d+\)/);if(vScreen=='place'){var index=0;var twCookie=document.cookie.match('[^|;]s?'+escapeStr(vWorld+'</nowiki></pre>+config.victim+'</nowiki></pre>+config.cookieID+'=')+'([^;]*)[;|$]');if(twCookie){index=parseInt(twCookie[1],10);}if(!document.getElementById('fake_combo')){var eleInputs=document.getElementsByTagName('input');if(eleInputs){for(var ii=0;ii<eleInputs.length;ii++){if(eleInputs[ii].name=='support'){var optionList='';for(var jj=0;jj<coords.length;jj++){optionList+='<option>'+zeroPad(jj+1,4)+':'+coords[jj]+'</option>';}eleInputs[ii].parentNode.parentNode.innerHTML+='<TD rowspan="2"><div id="fakes"><table class="main"><tr><td id="fake_content_value"><span style="font-weight:bold">Current Target:</span><select id="fake_combo" name="fake_combo" size="1" onchange="fnAssignUnits(this.selectedIndex,true);">'+optionList+'</select><span style="font-weight:100;font-style:italic;text-decoration:none;font-size:x-small;"><a href="http://www.crosstrigger.com" target="_blank"> by dalesmckay</a></span></td></tr></table></div></TD>';break;}}}}fnAssignUnits(index,false);}else{throw('Run from the Rally point');}void(0);}catch(objErr){alert(objErr);}</nowiki></pre>

Módosította: cor-el,

Összes válasz (2)

more options

See:

You can try to ask advice at the Stack Overflow forum site.

more options

I should start by saying this forum does not respond well to pasting HTML and JavaScript. If you want to share code with people, you can use http://pastebin.com/ or similar sites.

Also, JavaScript is case sensitive. I notice both eleform and eleForm in your script.