How to restart or continue the script

5

I've used imacro on these bug sites, and the process works perfectly. but it is not 100%. I need a code to put at the end of the script process that makes it look up the word on the site, if I find it start the process again, otherwise, wait 3600 seconds.

When it fails, it says: "Incorrect captcha entered" that would be by imacro:

TAG POS=1 TYPE=P ATTR=ID:free_play_error

And when you hit: "You win"

TAG POS=1 TYPE=DIV ATTR=ID:free_play_result

The end of the script follows:

TAB CLOSE
TAB T=1
TAG POS=1 TYPE=INPUT:TEXT ATTR=NAME:adcopy_response CONTENT={{!EXTRACT}}
WAIT SECONDS=1
TAG POS=1 TYPE=INPUT:SUBMIT ATTR=*
TAG POS=19 TYPE=A ATTR=TXT:×
wait seconds=3600

Basically here it closes the Tab, glues the captcha in the right place and gives play, however sometimes the captcha comes wrong. Hence I would need a function so that he can distinguish whether the process worked or not. If it worked, wait for the 3600 seconds, if not, start the script from the beginning.

    
asked by anonymous 21.09.2016 / 23:56

1 answer

0

As described on the iMacros website, it does not allow the use of conditionals, by the way it was developed.

  

The iMacros language itself is designed as a descriptive language (similar to HTML) and does not contain conditional statements.    iMacros FAQ

The easiest way to get around this problem is to create a program in another language and call smaller, more specific macros for each moment of your application.

Here is the example used by them:

ReturnCode = iim1.iimPlay ("YourMacro1")
 if ReturnCode = 1 then
  'Do something
  MsgBox "OK!"
 else
   'Do something else
   ReturnCode = iim1.iimPlay ("YourMacro2")
 end if 

Some of the languages you can use are:   VBS , VB , VBA , VB.NET , Perl , Java , Foxpro , C , C++ , C# , ASP , ASP.NET , PHP , while , FOR among others.

When you have the program calling the macros and performing the activity correctly, just include a repeat loop such as LOOP , %code% , and %code% .

    
20.01.2017 / 19:20