iMacros randomly stops in a loop - imacros

I'm facing a problem that my imacro script just doesn't continue looping and freezes after a couple of loops, did anyone of you already face such problem?
Here's my script:
SET !TIMEOUT_PAGE 1
SET !TIMEOUT_STEP 1
SET !ERRORIGNORE YES
SET !ERRORCONTINUE YES
SET !LOADCHECK YES
URL GOTO=http://web.stagram.com/tag/fun/
TAG POS=1 TYPE=IMG ATTR=SRC:http://cdn.stagram.com/img/like.png
WAIT SECONDS=8
TAG POS=2 TYPE=IMG ATTR=SRC:http://cdn.stagram.com/img/like.png
WAIT SECONDS=8
TAG POS=3 TYPE=IMG ATTR=SRC:http://cdn.stagram.com/img/like.png
WAIT SECONDS=8
TAG POS=4 TYPE=IMG ATTR=SRC:http://cdn.stagram.com/img/like.png
WAIT SECONDS=8
TAG POS=5 TYPE=IMG ATTR=SRC:http://cdn.stagram.com/img/like.png
WAIT SECONDS=8
TAG POS=6 TYPE=IMG ATTR=SRC:http://cdn.stagram.com/img/like.png
WAIT SECONDS=8
TAG POS=7 TYPE=IMG ATTR=SRC:http://cdn.stagram.com/img/like.png
WAIT SECONDS=8
SET !TIMEOUT_STEP 6

u miss this line of code
SET !LOOP 1

Related

extract and use a countdown with imacro

iMacros for CR v10.1.1, 'Free', CR90/91, macOS
basically am trying to automate a process as efficient as possible
this is the inefficient version
SET !ERRORIGNORE YES
WAIT SECONDS=6
TAG POS=1 TYPE=A ATTR=TXT:FNA
WAIT SECONDS=2
SET !TIMEOUT_STEP 1
TAG POS=3 TYPE=A ATTR=TXT:FNS
WAIT SECONDS=60
updated version
VERSION BUILD=1011 RECORDER=CR
URL GOTO=192.168.1.1
SET !ERRORIGNORE YES
WAIT SECONDS=5
SET !TIMEOUT_STEP 9999
TAG POS=1 TYPE=SPAN ATTR=TXT:0:00:**
WAIT SECONDS=65
URL GOTO=192.168.1.1
WAIT SECONDS=8
SET !TIMEOUT_STEP 0
TAG POS=1 TYPE=A ATTR=TXT:FN1
WAIT SECONDS=2
TAG POS=3 TYPE=A ATTR=TXT:FN2
WAIT SECONDS=1000
and basically loop it , but the window that this code is doing its job is limited cause of a countdown but that time is given in the same page the code is executed
this is an exemple of the time
TAG POS=1 TYPE=SPAN ATTR=TXT:1:22:05
if possible i wanna know how to extract the time and use it in a wait command
THANKS

Why can not download the captcha using the following code

I was just trying to donwload the captcha from one website everything with educational purposes. But when i use the ONDOWNLOAD command, the captcha image never is in the tmp FOLDER.
So what im doing WRONG. I tried using Disabling error notifications, but still never the image is downloaded into the folder.
URL GOTO=https://www.coinpayments.net/index.php?ref=fe31773be1c8558db56c7b9f3063ae08
TAG POS=1 TYPE=A ATTR=TXT:Sign<SP>Up
TAG POS=2 TYPE=DIV ATTR=TXT:Create<SP>New<SP>Account<SP>Please<SP>make<SP>it<SP>at<SP>le*
'SEARCH SOURCE=REGEXP:\\b[A-Z0-9._%+-]+#[A-Z0-9.-]+\\.[A-Z]{2,4}\\b EXTRACT=$1
TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:register ATTR=NAME:username CONTENT=examplethenomtest
TAG POS=1 TYPE=INPUT:EMAIL FORM=ACTION:register ATTR=NAME:email1 CONTENT={{!EXTRACT}}
TAG POS=1 TYPE=INPUT:EMAIL FORM=ACTION:register ATTR=NAME:email2 CONTENT={{!EXTRACT}}
SET !ENCRYPTION NO
TAG POS=1 TYPE=INPUT:PASSWORD FORM=ACTION:register ATTR=NAME:pass1 CONTENT=k1k1k1k1
TAG POS=1 TYPE=INPUT:PASSWORD FORM=ACTION:register ATTR=NAME:pass2 CONTENT=k1k1k1k1
TAG POS=1 TYPE=INPUT:CHECKBOX FORM=ACTION:register ATTR=ID:checkbox CONTENT=YES
TAG POS=2 TYPE=INPUT:CHECKBOX FORM=ACTION:register ATTR=ID:checkbox CONTENT=YES
SET url https://www.coinpayments.net/index.php?ref=fe31773be1c8558db56c7b9f3063ae08
SET apikey apikey
SET path C:\tmp\
SET file freeditcoin.jpg
SET tw 5
TAB OPEN
'TAB T=1
PROXY ADDRESS=0.0.0.0:0
'TAB CLOSEALLOTHERS
SET !TIMEOUT_PAGE 10
'URL GOTO={{url}}
SET !ENCRYPTION NO
SET !VAR1 EVAL("var randomNumber=Math.floor(Math.random()*10 + 1); randomNumber;")
Wait Seconds={{!Var1}}
FILEDELETE NAME={{path}}{{file}}
ONDOWNLOAD FOLDER={{path}} FILE={{file}}
TAG POS=1 TYPE=IMG ATTR=ID:captcha
WAIT SECONDS=11
SET !VAR1 EVAL("var randomNumber=Math.floor(Math.random()*10 + 1); randomNumber;")
Wait Seconds={{!Var1}}
WAIT SECONDS=6
TAG POS=1 TYPE=DIV ATTR=ID:captcha CONTENT=EVENT:SAVE_ELEMENT_SCREENSHOT
WAIT SECONDS=6
I checked the code you gave here is the list of issues.
The line having ONDOWNLOAD should be immediately followed by download of the captcha, so it should be give as follows.
SET !VAR1 EVAL("var randomNumber=Math.floor(Math.random()*10 + 1); randomNumber;")
Wait Seconds={{!Var1}}
ONDOWNLOAD FOLDER={{path}} FILE={{file}}
TAG POS=1 TYPE=IMG ATTR=ID:captcha CONTENT=EVENT:SAVE_ELEMENT_SCREENSHOT
Also notice that in the above code, the last line you were giving the type attribute as IMG instead of DIV.
Regarding the variable path, please give some other folder other than the C Drive which may be the root of your computer, try giving some path like C:\Users\asdf\Desktop. Using such a path, I can see that the image is getting downloaded!
SET path D:\
Below is the complete code, please let me know if your issues is resolved completely!
URL GOTO=https://www.coinpayments.net/index.php?ref=fe31773be1c8558db56c7b9f3063ae08
TAG POS=1 TYPE=A ATTR=TXT:Sign<SP>Up
TAG POS=2 TYPE=DIV ATTR=TXT:Create<SP>New<SP>Account<SP>Please<SP>make<SP>it<SP>at<SP>le*
'SEARCH SOURCE=REGEXP:\\b[A-Z0-9._%+-]+#[A-Z0-9.-]+\\.[A-Z]{2,4}\\b EXTRACT=$1
TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:register ATTR=NAME:username CONTENT=examplethenomtest
TAG POS=1 TYPE=INPUT:EMAIL FORM=ACTION:register ATTR=NAME:email1 CONTENT={{!EXTRACT}}
TAG POS=1 TYPE=INPUT:EMAIL FORM=ACTION:register ATTR=NAME:email2 CONTENT={{!EXTRACT}}
SET !ENCRYPTION NO
TAG POS=1 TYPE=INPUT:PASSWORD FORM=ACTION:register ATTR=NAME:pass1 CONTENT=k1k1k1k1
TAG POS=1 TYPE=INPUT:PASSWORD FORM=ACTION:register ATTR=NAME:pass2 CONTENT=k1k1k1k1
TAG POS=1 TYPE=INPUT:CHECKBOX FORM=ACTION:register ATTR=ID:checkbox CONTENT=YES
TAG POS=2 TYPE=INPUT:CHECKBOX FORM=ACTION:register ATTR=ID:checkbox CONTENT=YES
SET url https://www.coinpayments.net/index.php?ref=fe31773be1c8558db56c7b9f3063ae08
SET apikey apikey
SET path D:\
SET file freeditcoin.jpg
SET tw 5
TAB OPEN
'TAB T=1
PROXY ADDRESS=0.0.0.0:0
'TAB CLOSEALLOTHERS
SET !TIMEOUT_PAGE 10
'URL GOTO={{url}}
SET !ENCRYPTION NO
SET !VAR1 EVAL("var randomNumber=Math.floor(Math.random()*10 + 1); randomNumber;")
Wait Seconds={{!Var1}}
ONDOWNLOAD FOLDER={{path}} FILE={{file}}
TAG POS=1 TYPE=IMG ATTR=ID:captcha CONTENT=EVENT:SAVE_ELEMENT_SCREENSHOT

iMacros EVENT mode is malfunctioning during KEYPRESS

I have an iMacros code that copies content from one blog and posts the article image and article body content to my Facebook Wall post. Here is the working code:
VERSION BUILD=844 RECORDER=CR
SET !EXTRACT_TEST_POPUP NO
SET URL http://www.marketwatch.com/story/too-early-to-tell-if-trump-bump-seen-in-jobs-numbers-economists-say-2017-03-10
URL GOTO={{URL}}
WAIT SECONDS=2
TAG POS=1 TYPE=IMG ATTR=CLASS:article-image<SP>MG EXTRACT=HREF
SET IMG {{!EXTRACT}}
SET !EXTRACT NULL
TAG POS=1 TYPE=DIV ATTR=ID:article-body EXTRACT=TXT
SET BODY EVAL("var s=\"{{!EXTRACT}}\"; s=s.split('More from this Website')[0]; s;")
SET !EXTRACT NULL
URL GOTO=www.facebook.com
WAIT SECONDS=2
TAG POS=1 TYPE=DIV ATTR=CLASS:composerAudienceWrapper<SP>stat_elem<SP>_ej0
WAIT SECONDS=2
EVENTS TYPE=KEYPRESS SELECTOR="DIV[CLASS='_1mf _1mj']" CHARS="{{IMG}}"
WAIT SECONDS=5
EVENTS TYPE=KEYPRESS SELECTOR="DIV[CLASS='_1mf _1mj']" KEYS="[8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8]"
WAIT SECONDS=2
EVENTS TYPE=KEYPRESS SELECTOR="DIV[CLASS='_1mf _1mj']" CHARS="{{BODY}}"
TAG POS=1 TYPE=BUTTON FORM=ID:u_0_15 ATTR=TXT:Post
WAIT SECONDS=2
At this line: EVENTS TYPE=KEYPRESS SELECTOR="DIV[CLASS='_1mf _1mj']" CHARS="{{IMG}}" , when the code pastes the image URL into Facebook, it does the work halfway and it starts to mis-function - meaning it starts clicking some randone buttons on my facebook wall (while this line of code is still executing)...
Is there a solution to this issue?
If you want to paste a large piece of text, try to do this via clipboard, for example:
SET !EXTRACT_TEST_POPUP NO
SET URL http://www.marketwatch.com/story/too-early-to-tell-if-trump-bump-seen-in-jobs-numbers-economists-say-2017-03-10
URL GOTO={{URL}}
WAIT SECONDS=2
TAG POS=1 TYPE=IMG ATTR=CLASS:article-image<SP>MG EXTRACT=HREF
SET IMG {{!EXTRACT}}
SET !EXTRACT NULL
TAG POS=1 TYPE=DIV ATTR=ID:article-body EXTRACT=TXT
SET BODY EVAL("var s=\"{{!EXTRACT}}\"; s=s.split('More from this Website')[0]; s;")
SET !EXTRACT NULL
URL GOTO=www.facebook.com
WAIT SECONDS=2
SET !CLIPBOARD {{IMG}}
TAG POS=1 TYPE=LABEL ATTR=TXT:"Choose a file to upload"
TAG POS=R1 TYPE=DIV ATTR=ID:* EXTRACT=HTM
SET id EVAL("'{{!EXTRACT}}'.match(/id="(.*?)"/)[1];")
EVENT TYPE=CLICK SELECTOR="#{{id}}>DIV>DIV>DIV:nth-of-type(2)>DIV>DIV>DIV>DIV>DIV:nth-of-type(2)>DIV>DIV>DIV>DIV" BUTTON=0
EVENT TYPE=KEYPRESS SELECTOR="#{{id}}>DIV>DIV>DIV:nth-of-type(2)>DIV>DIV>DIV>DIV>DIV:nth-of-type(2)>DIV" CHAR="v" MODIFIERS="ctrl"
' ...

IF and ELSE - IMACROS

TAG POS=1 TYPE=A ATTR=TXT:next
FRAME F=1
WAIT SECONDS=3
TAG POS=1 TYPE=A ATTR=TXT:Contact
FRAME F=0
WAIT SECONDS=7
How do I insert a condition in ATTR: Contact?
I would check if the open page has Contact link, Contact us link , Help link, etc.
If the page does not have any of the links go to the end
As a workaround you may try the !ERRORIGNORE variable. Something like this:
TAG POS=1 TYPE=A ATTR=TXT:next
FRAME F=1
WAIT SECONDS=3
SET !ERRORIGNORE YES
TAG POS=1 TYPE=A ATTR=TXT:Contact
SET !ERRORIGNORE NO
FRAME F=0
WAIT SECONDS=7

Imacros script stopped working all of a sudden

I have written this code earlier. Previously it was working fine. But suddenly one day iMacros stopped working without I changed anything....
it stops at line 19
TAG POS=1 TYPE=INPUT:SUBMIT FORM=ACTION:http://api.deathbycaptcha.com/decaptcher ATTR=VALUE:Send
Even when I set the IGNOREERROR YES
Please help
VERSION BUILD=8300326 RECORDER=FX
TAB T=1
SET !EXTRACT_TEST_POPUP NO
SET !ERRORIGNORE YES
SET !LOOP 1
URL GOTO=http://bootleggers.us/jail.php
ONDOWNLOAD FOLDER=/Users/dymphi/Desktop/ FILE=image.jpg WAIT=YES
TAG POS=1 TYPE=IMG ATTR=HREF:http://www.google.com/recaptcha/api/image* CONTENT=EVENT:SAVEITEM
TAB OPEN
TAB T=2
URL GOTO=api.deathbycaptcha.com/decaptcher?function=picture2&print_format=html
FRAME F=0
TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:http://api.deathbycaptcha.com/decaptcher ATTR=NAME:username CONTENT=dbcname
TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:http://api.deathbycaptcha.com/decaptcher ATTR=NAME:password CONTENT=dbcpassword
TAG POS=1 TYPE=INPUT:FILE FORM=ACTION:http://api.deathbycaptcha.com/decaptcher ATTR=NAME:pict CONTENT=/Users/dymphi/Desktop/image.jpg
TAG POS=1 TYPE=INPUT:SUBMIT FORM=ACTION:http://api.deathbycaptcha.com/decaptcher ATTR=VALUE:Send
TAG POS=6 TYPE=TD ATTR=* EXTRACT=TXT
SET !VAR1 {{!EXTRACT}}
TAB CLOSE
TAB T=1
FRAME F=0
TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:/jail.php ATTR=ID:recaptcha_response_field CONTENT={{!VAR1}}
TAG POS=1 TYPE=INPUT:SUBMIT FORM=ACTION:/jail.php ATTR=VALUE:Continueplaying!
URL GOTO=http://bootleggers.us/jail.php
TAG POS=1 TYPE=A ATTR=TXT:Bustout!
filedelete name=/Users/dymphi/Desktop/image.jpg
WAIT SECONDS=110
I'm also using deathbycaptcha for solving captcha and my code works fine, you should set a timeout before submitting:
URL GOTO=http://api.deathbycaptcha.com/decaptcher?function=picture2&print_format=html
TAG POS=1 TYPE=INPUT ATTR=NAME:username CONTENT=username
TAG POS=1 TYPE=INPUT ATTR=NAME:password CONTENT=pass
TAG POS=1 TYPE=INPUT ATTR=NAME:pict CONTENT=/Users/dymphi/Desktop/image.jpg
SET !TIMEOUT_STEP 30
TAG POS=1 TYPE=INPUT ATTR=TYPE:submit
TAG POS=6 TYPE=TD ATTR=* EXTRACT=TXT
TAB CLOSE
TAB T=1
SET !VAR1 {{!EXTRACT}}
I tested it even when the image doesn't exist, my version of iMacros is 8.3.0. Hope it will work.