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

Help with imacros

Discussion in 'Other Languages' started by aeglos, Mar 8, 2011.

  1. aeglos

    aeglos Newbie

    Joined:
    Jan 22, 2011
    Messages:
    2
    Likes Received:
    0
    (first of all, i think this post goes here...:rolleyes:)
    Hello! i just did a bot (very very noob, but its all i can do with my knowledge) on iMacros and I need, if the macro gives me an error, jump to back lines and do again the macro. This is the code (its from the beathbycaptcha api for imacros)

    Code:
    TAB OPEN
    TAB T=2
    TAB T=2
    
    URL GOTO=deathbycaptcha/logout '(i cant post with webpages)
    TAG POS=1 TYPE=INPUT ATTR=NAME:username CONTENT=****
    TAG POS=1 TYPE=INPUT ATTR=NAME:password CONTENT=****
    TAG POS=1 TYPE=BUTTON ATTR=TYPE:submit
    
    'This is for upload the captcha
    URL GOTO=deathbycaptcha/captcha '(again, the webpage)
    TAG POS=1 TYPE=INPUT ATTR=TYPE:file CONTENT=C:\Users\Aeglos\...\a.gif
    TAG POS=1 TYPE=INPUT ATTR=TYPE:submit
    
    'Now wait for solving the captcha (and here can start the error if the
    'captcha is not solved in 45 seconds or its wrong)
    WAIT SECONDS=45
    
    SET !EXTRACT_TEST_POPUP NO
    'Extract the result of the captcha, if its not solved, here is the first
    'step of the error
    TAG POS=1 TYPE=B ATTR=ID:captcha-text EXTRACT=TXT
    SET !VAR1 {{!EXTRACT}}
    
    'Go back to the form
    TAB T=1
    TAG POS=1 TYPE=INPUT:TEXT ATTR=ID:captcha CONTENT={{!VAR1}}
    
    'Send form
    TAG POS=1 TYPE=BUTTON ATTR=ID:register_form_submit_button
    
    'Close tab 2 (the deathbycaptcha one)
    TAB T=2
    TAB CLOSE
    
    'Wait for the form gives the error (or not) saying the captcha is not correct
    WAIT SECONDS=4
    
    'And here is the error, if the captcha is OK, it works, but if its incorrect, 
    'the macro cant do this step and it stops, and what i want is to enter any 
    'command or anything that says "if this error happens, then jump back to 
    'the first line (and hopefully the second time I upload the captcha it gives 
    'me the correct answer)
    TAB T=1
    URL GOTO=the web with finished form
    TAG POS=2 TYPE=SPAN ATTR=TXT:My<SP>account
    TAG POS=1 TYPE=A ATTR=TXT:Exit
    Is this possible? and i didn't say anything about report the bad captcha because i think is quite complicated, but I think it could be somethin like:

    (lines)
    1 extract captcha.gif
    2 upload captcha.gif
    3 extract the captcha answer
    4- ERROR bad captcha jump to line 10 (if not error, continue to 5)
    5
    6
    7- FINISH
    8 (empty)
    9(empty)
    10 Report as bad captcha and jump to line 1

    Is this possible?!?! and Thanks!! I have been looking on google and on wiki.imacros and i haven't found anything, also I'm not english and probably i have skipped some things.
     
  2. zelma143

    zelma143 Power Member

    Joined:
    Jun 25, 2010
    Messages:
    571
    Likes Received:
    37
    Occupation:
    PHP programmer,Bot maker,iMacro script maker
    hey it's all about just for decoding capacha???

    let me know on yah** if you need to get this solved... or on p-m
     
  3. aeglos

    aeglos Newbie

    Joined:
    Jan 22, 2011
    Messages:
    2
    Likes Received:
    0
    Its more complicated than just the captcha, the problem is the captcha yes, because im using deathbycaptcha (i like it btw) and sometimes (i know they are not perfect) they give me bad captcha, so i just want to report it as incorrect and resend it for re-solving, not re start again the macro, as is happening untill now
     
  4. GimmeMoney

    GimmeMoney Regular Member

    Joined:
    Apr 19, 2009
    Messages:
    401
    Likes Received:
    511
    You have to get the scripting edition if you want to use conditional statements such as if, then, and else.
     
  5. zelma143

    zelma143 Power Member

    Joined:
    Jun 25, 2010
    Messages:
    571
    Likes Received:
    37
    Occupation:
    PHP programmer,Bot maker,iMacro script maker
    you can use if condition there with js...

    anyway.. is there deathbycaptcha's api??

    that you can use direct...