hi everyone :) English isn't my first language so please Excuse any mistakes :)
i'm using iMacros v9.0.3 on Firefox 53.0.3 (64 bit) in Windows 8 x64
I'm attempting imacros to check the text exists if exists then run rest of the script else go to the particular URL
Here is the block of my code:
var n1 = prompt("Enter Number Of Clicks You Want: ");
iimPlay('CODE:'+'SET !TIMEOUT_PAGE 100'+'\nURL GOTO=http://ift.tt/2tkdahC');
iimPlay('CODE:'+'wait seconds=1');
iimPlay('CODE:'+'SET !TIMEOUT_PAGE 100'+'\nURL GOTO=http://ift.tt/2uhQ2xw');
for(var P = 1; P <= n1; P++)
{
iimDisplay("Current RT account is: "+P)
iimPlay('CODE:'+'SET !TIMEOUT_STEP 0'+'\nTAG POS=1 TYPE=h2 ATTR=class:center_title&&TXT:Instagram<sp>Likes CONTENT=EVENT:MOUSEOVER');
iimPlay('CODE:'+'wait seconds=2');
iimPlay('CODE:'+'SET !TIMEOUT_STEP 0'+'\nTAG POS=1 TYPE=div ATTR=class:btn3&&TXT:Like');
iimPlay('CODE:'+'SET !TIMEOUT_STEP 20'+'\nTAG POS=1 TYPE=a ATTR=class:_1b8in<sp>_soakw<sp>coreSpriteDesktopNavLogoAndWordmark&&href:/&&TXT:Instagram CONTENT=EVENT:MOUSEOVER');
iimPlay('CODE:'+'wait seconds=6');
iimPlay('CODE:'+'SET !TIMEOUT_STEP 0'+'\nTAG POS=1 TYPE=span ATTR=class:_soakw<sp>coreSpriteHeartOpen&&TXT:Like');
iimPlay('CODE:'+'wait seconds=9');
iimPlay('CODE:'+'\nEVENT TYPE=KEYPRESS SELECTOR=* CHAR="1" MODIFIERS="ctrl"');
iimPlay('CODE:'+'TAB CLOSEALLOTHERS');
iimPlay('CODE:'+'wait seconds=5');
if (P % 5 == 0 && P!=0) {
iimPlay('CODE:'+'REFRESH');
}
}
My code is working fine but unfortunately, sometimes Tab 2 closed instead of Tab 1, so the script ends up with fails
i don't have a great knowledge in javascript/programming so i refer Google and tried some of them but none seems to work :(
Here is the code that I'm trying:
var n1 = prompt("Enter Number Of Clicks You Want: ");
var answer=iimGetLastExtract();
iimPlay('CODE:'+'SET !TIMEOUT_PAGE 100'+'\nURL GOTO=http://ift.tt/2tkdahC');
iimPlay('CODE:'+'wait seconds=1');
iimPlay('CODE:'+'SET !TIMEOUT_PAGE 100'+'\nURL GOTO=http://ift.tt/2uhQ2xw');
for(var P = 1; P <= n1; P++)
{
iimDisplay("Current RT account is: "+P)
iimPlay('CODE:'+'SET !TIMEOUT_STEP 0'+'\nTAG POS=1 TYPE=h2 ATTR=class:center_title&&TXT:Instagram<sp>Likes EXTRACT=TXT');
if(answer=="Instagram Likes"){
iimPlay('CODE:'+'wait seconds=2');
iimPlay('CODE:'+'SET !TIMEOUT_STEP 0'+'\nTAG POS=1 TYPE=div ATTR=class:btn3&&TXT:Like');
iimPlay('CODE:'+'SET !TIMEOUT_STEP 20'+'\nTAG POS=1 TYPE=a ATTR=class:_1b8in<sp>_soakw<sp>coreSpriteDesktopNavLogoAndWordmark&&href:/&&TXT:Instagram CONTENT=EVENT:MOUSEOVER');
iimPlay('CODE:'+'wait seconds=6');
iimPlay('CODE:'+'SET !TIMEOUT_STEP 0'+'\nTAG POS=1 TYPE=span ATTR=class:_soakw<sp>coreSpriteHeartOpen&&TXT:Like');
iimPlay('CODE:'+'wait seconds=9');
iimPlay('CODE:'+'\nEVENT TYPE=KEYPRESS SELECTOR=* CHAR="1" MODIFIERS="ctrl"');
iimPlay('CODE:'+'TAB CLOSEALLOTHERS');
iimPlay('CODE:'+'wait seconds=5');
if (P % 5 == 0 && P!=0) {
iimPlay('CODE:'+'REFRESH');
}
} else {iimPlay('CODE:'+'SET !TIMEOUT_PAGE 100'+'\nURL GOTO=http://ift.tt/2uhQ2xw');}
}
So, whats wrong in this code, and how can I fix it? Please help.. all suggestions are welcomed and greatly appreciated and thanks in advanced
Aucun commentaire:
Enregistrer un commentaire