帧ID不断变化,imacros脚本无法正常工作

时间:2016-02-29 10:27:22

标签: javascript imacros

VERSION BUILD=8961227 RECORDER=FX
SET !ERRORIGNORE YES
SET !TIMEOUT_STEP 0
SET !TIMEOUT_PAGE 1
TAB T=1
wait seconds = 6
CLICK X=16 Y=99
FRAME F=1
EVENT TYPE=CLICK SELECTOR="#ctr1>DIV:nth-of-type(2)>A:nth-of-type(2)" BUTTON=0
FRAME F=2
EVENT TYPE=CLICK SELECTOR="#ctr1>DIV:nth-of-type(2)>A:nth-of-type(2)" BUTTON=0
FRAME F=3
EVENT TYPE=CLICK SELECTOR="#ctr1>DIV:nth-of-type(2)>A:nth-of-type(2)" BUTTON=0
FRAME F=4
EVENT TYPE=CLICK SELECTOR="#ctr1>DIV:nth-of-type(2)>A:nth-of-type(2)" BUTTON=0
FRAME F=5
EVENT TYPE=CLICK SELECTOR="#ctr1>DIV:nth-of-type(2)>A:nth-of-type(2)" BUTTON=0
FRAME F=6
EVENT TYPE=CLICK SELECTOR="#ctr1>DIV:nth-of-type(2)>A:nth-of-type(2)" BUTTON=0
FRAME F=7
EVENT TYPE=CLICK SELECTOR="#ctr1>DIV:nth-of-type(2)>A:nth-of-type(2)" BUTTON=0
FRAME F=8
EVENT TYPE=CLICK SELECTOR="#ctr1>DIV:nth-of-type(2)>A:nth-of-type(2)" BUTTON=0
FRAME F=9
EVENT TYPE=CLICK SELECTOR="#ctr1>DIV:nth-of-type(2)>A:nth-of-type(2)" BUTTON=0
FRAME F=10
EVENT TYPE=CLICK SELECTOR="#ctr1>DIV:nth-of-type(2)>A:nth-of-type(2)" BUTTON=0

帧ID不断变化,有时甚至高达74。

我尝试使用java代码找出帧ID,但作为一名新手,我无法在我的代码中实现它。

任何人都可以为我创建一个js文件,其中包含frame id finder的循环以及我的其余imacros吗?

由于

1 个答案:

答案 0 :(得分:1)

以下是先前的命令:

iimPlayCode(
    "TAB T=1" + "\n" +
    "WAIT SECONDS=6" + "\n" +
    "CLICK X=16 Y=99" + "\n"
);

要查找框架并单击其中的第一个链接,您可以尝试以下内容:

for (i = 1; ; i++) {
    var ret = iimPlayCode(
        "SET !TIMEOUT_STEP 0" + "\n" +
        "FRAME F=" + i + "\n" +
        'EVENT TYPE=CLICK SELECTOR="#ctr1>DIV:nth-of-type(2)>A:nth-of-type(2)" BUTTON=0' + "\n"
    );
    if (ret == 1)
        break;
}