1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

[HELP please] iMacros/JavaScript - Got code, How do I use?!

Discussion in 'HTML & JavaScript' started by ardley216, Mar 30, 2012.

  1. ardley216

    ardley216 Elite Member

    Joined:
    Mar 28, 2008
    Messages:
    2,391
    Likes Received:
    2,356
    Occupation:
    Finding easy keywords
    Location:
    1,500,000,000 Keywords Re
    Home Page:
    Hi :)

    Well my problem is that I have a bot with iMacros built in JavaScript (I suck at it :) ), and I want to solve the captcha manually, using a prompt or pause script. BUT the captcha only shows up sometimes. So I need some help coding this in.

    The part of the JS iMacro I need help with is here:

    Code:
    macro="CODE: \n";
    	   // macro+="TAB T=1 \n";
    	    macro+="TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:/inbox/new/* ATTR=ID:message[subject] CONTENT=hello\n";
    		macro+="TAG POS=1 TYPE=TEXTAREA FORM=ACTION:/inbox/new/* ATTR=ID:message[body] CONTENT="+message.replace(/ /g,"<SP>")+"\n";
    		//macro="";
    		macro+="TAG POS=1 TYPE=INPUT:SUBMIT FORM=ACTION:/inbox/new/* ATTR=NAME:commit&&VALUE:Send<SP>Message\n";
    		macro+="WAIT SECONDS=0.7\n";
    		macro+="TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:/inbox/new/* ATTR=ID:recaptcha_response_field CONTENT=[capthca here]\n";
    		 retcode = iimPlay(macro);
    		
           if (retcode < 0)               // an error has occured
           {
              errtext = iimGetLastError();
              alert("Error 3: "+retcode+":     "+errtext);
    		  //alert(macro);
              stop=true;
           }
    I don't know how or where to put it in... I have done as much research as I can on this, I have the right bits of code, but how to put them in, I have no idea!!

    (it's taken from here http://forum.iopus.com/viewtopic.php?f=11&t=10600 )


    Code:
    function captcha(UrInput, Input2, AndSoOn) {
    var captcha;
    
    captcha =  "CODE:";
    captcha +=  "SET !ERRORIGNORE YES" + "\n"; 
    captcha +=  "TAG POS=1 TYPE=* ATTR=TXT:captcha_url" + "\n"; 
    captcha +=  "WAIT SECONDS=1" + "\n"; 
    captcha +=  "TAG POS=1 TYPE=* ATTR=TXT:*captcha_txt* EXTRACT=TXT" + "\n"; 
    
    iimPlay(captcha);
    var captcha = iimGetLastExtract();
    
    if (captcha != "#EANF#")
    
       {
       iimPlay("MyMacroForCaptcha")
       captcha = "#EANF#";
       }
    "to check if there is a captcha
    If found something like this, with .iim"

    Code:
    SET !ERRORIGNORE YES
    TAG POS=1 TYPE=IMG ATTR=SRC:*captcha_img_or_whateverURL*

    How can I fit this code into my code?!?!
     
  2. ardley216

    ardley216 Elite Member

    Joined:
    Mar 28, 2008
    Messages:
    2,391
    Likes Received:
    2,356
    Occupation:
    Finding easy keywords
    Location:
    1,500,000,000 Keywords Re
    Home Page:
    And I don't want it to extract the image, I need it done manually.
     
  3. ardley216

    ardley216 Elite Member

    Joined:
    Mar 28, 2008
    Messages:
    2,391
    Likes Received:
    2,356
    Occupation:
    Finding easy keywords
    Location:
    1,500,000,000 Keywords Re
    Home Page:
    I think I got the code:

    Code:
    	   macro="CODE: \n";
    	   // macro+="TAB T=1 \n";
    	    macro+="TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:/inbox/new/* ATTR=ID:message[subject] CONTENT=hello\n";
    		macro+="TAG POS=1 TYPE=TEXTAREA FORM=ACTION:/inbox/new/* ATTR=ID:message[body] CONTENT="+message.replace(/ /g,"<SP>")+"\n";
    		//macro="";
    		macro+="WAIT SECONDS=0.7\n";
    		retcode=iimPlay(macro);
    		
    		if (retcode < 0)               // an error has occured
           {
    		 macro="CODE: \n";
    		macro+="TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:/inbox/new/* ATTR=ID:recaptcha_response_field CONTENT=\n";
    		PAUSE += "PAUSE\n" 
    		 iimPlay(PAUSE)
    	    }
    		macro="CODE: \n";
    		macro+="TAG POS=1 TYPE=INPUT:SUBMIT FORM=ACTION:/inbox/new/* ATTR=NAME:commit&&VALUE:Send<SP>Message\n";
    		 retcode = iimPlay(macro);
    		
           if (retcode < 0)               // an error has occured
           {
              errtext = iimGetLastError();
              alert("Error 3: "+retcode+":     "+errtext);
    		  //alert(macro);
              stop=true;
           }
    Although after banging my head over it for 3 hours.. The website I was trying to spam has a sending limit per day FFS!! So if anyone can verify if this code will work, I'd be happy. :)
     
    Last edited: Mar 30, 2012
  4. Franam

    Franam Newbie

    Joined:
    Mar 24, 2011
    Messages:
    38
    Likes Received:
    5
    a lilmit per day ? try pxoxies, change/create new account (if you have to be loggued), clear cache... there is always a solution ^^

    Do you really need to use JS ? why do not use regular imacro script with a Prompt ?
     
  5. ardley216

    ardley216 Elite Member

    Joined:
    Mar 28, 2008
    Messages:
    2,391
    Likes Received:
    2,356
    Occupation:
    Finding easy keywords
    Location:
    1,500,000,000 Keywords Re
    Home Page:
    thanks for the help.. i manged to figure it out :)