Jump to content
Fórum Script Brasil
  • 0

Randon como utilizar?


Fir3LorD

Question

Gostaria de colocar um código randon de 0 á 2000 milésimos de segundo no script a seguir, mais não entendo muito bem de programação.

A minha intenção é que o script seja executado poucas vezes, porque do jeito que ta, ta um laço infinito e ele fica executando/testando a todo instante.

java script: var cookieName="fir3lord"; var sp=0; var sw=0; var ax=0; var ar=0; var scout=0; var lc=100; var arc=0; var hv=0; var cat=0; var ra=0; var coords='PONHAM AS COORDENADAS DAS ALDEIAS QUE QUEREM ATACAR AQUI'; var doc=document; var url=document.URL; if(url.search(/screen=place/)!= -1 && url.search(/try=confirm/)===-1 && document.forms[0].x.value==="" && document.forms[0].y.value==="") { if(window.frames.length>0) { doc=window.main.document; } url=document.URL; if(url.indexOf('screen=place')==-1) { alert('This script needs to be run from the rally point'); } coords=coords.split(" "); var index=0; farmcookie=document.cookie.match('(^|;)?'+ cookieName +'=([^;]*)(;|$)'); if(farmcookie!=null) { index=parseInt(farmcookie[2]); } if(index>=coords.length) { index=0; } coords=coords[index];coords=coords.split("|"); index=index+1; cookie_date=new Date(2019,11,11); document.cookie =cookieName+"="+index + ";expires="+cookie_date.toGMTString (); doc.forms[0].x.value=coords[0]; doc.forms[0].y.value=coords[1]; insertUnit(doc.forms[0].spear,sp); insertUnit(doc.forms[0].sword,sw); insertUnit(doc.forms[0].axe,ax); insertUnit(doc.forms[0].archer,ar); insertUnit(doc.forms[0].spy,scout); insertUnit(doc.forms[0].light,lc); insertUnit(doc.forms[0].marcher,arc); insertUnit(doc.forms[0].heavy,hv); insertUnit(doc.forms[0].ram,ra); insertUnit(doc.forms[0].catapult,cat); document.forms[0].attack.click(); } else if(url.search(/screen=place/)!= -1 && url.search(/try=confirm/)===-1 && parseInt(doc.forms[0].x.value)>0 && parseInt(doc.forms[0].x.value)<999 && parseInt(doc.forms[0].y.value)>0 && parseInt(doc.forms[0].y.value)<999) { document.forms[0].attack.click(); } else if(url.search(/screen=place/)!= -1 && url.search(/try=confirm/)!=-1) { document.forms[0].submit.click(); } end();

Irei ficar muito grato de alguém puder me ajudar;

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Forum Statistics

    • Total Topics
      152.2k
    • Total Posts
      652k
×
×
  • Create New...