Pergunta

So right now my script is using iMacros to play it. The file name is called test.js

var m;
m ="CODE:";
m+="URL GOTO=http://tppcrpg.net/map.php?Map=11";

iimPlay(m);

for (var i = 0; i < 100; i++)
{
    var c;
    c = "CODE:";
    c+= "CLICK X=679 Y=459";

    iimPlay(c);

    var macro;

    macro ="CODE:";
    macro +="SET !ERRORIGNORE YES"+"\n";
    macro +="TAG POS=1 TYPE=HTML ATTR=TXT:* EXTRACT=TXT"+"\n";

    iimPlay(macro);

    if(iimGetLastExtract().search("Belong")!=-1)
    {
        alert("Found the text");        
    }
} 

What I'm trying to do here in this macro is go to a link and then keep on clicking a certain coordinate. Then if it finds the text Belong it will give me an alert box.


Now the problem is that if I click the normal Play button (not Play Loop) for iMacros it's not running smoothly after the 2nd iteration (which is clicking the coordinate).

It is able to go to the link and use the Click command but it will just keep fading afterwards and not do anything on the webpage.

Instead what's it doing is that it's running the script very fast but it's not doing any actions of macroing on the webpage.

There are no runtime errors and the loop will finish and the macro will stop, but it seems like it's not able to interact with the webpage anymore.

What am I doing wrong?

Foi útil?

Solução

Instead of search try to use indexOf . indexOf works better for searching something on web page.

And instead of coordinates try use HTML property of the place the macro is clicking. If the coordinates are something relevant to the process then it's better to use HTML property. Coordinates can be preciseness and miss the target.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top