如何使用 if 语句检查页面内容,然后根据 if 语句执行操作?以下是点击时可能出现的结果:
图片1
http://i.imgur.com/V9rnrVS.png
图二
http://i.imgur.com/eeYhfXU.png
图三
http://i.imgur.com/W6Tjd8l.jpg
所以这是我的主线逻辑:
I will keep on clicking the box on the page [picture 1]
if it encounters [picture 2] click the box (i have the code for that)
else if it encounters [picture 3] refresh the page
else keep on clicking the box
如果图像不清晰,请随时发表评论,我会尽力上传更清晰的图像。
所以现在我尝试构建代码,但它似乎不起作用。
地图.js
var test;
test ="CODE:";
test +="SET !ERRORIGNORE YES "+"\n";
test +="URL GOTO=http://tppcrpg.net/map.php?Map=11 "+"\n";
for (var i = 1; i < 10 ; i++)
{
iimSet("n",i)
iimPlay(test)
iimPlay("map1.iim")
}
地图1.iim
TAG POS=1 TYPE=INPUT:IMAGE FORM=ACTION:/map.php?Map=11 ATTR=NAME:Find
它给了我这个错误:
[异常...“组件返回失败代码:0x80520001(NS_ERROR_FILE_UNRECOGNIZED_PATH)[nsILocalFile.initWithPath]”nsresult:“0x80520001(NS_ERROR_FILE_UNRECOGNIZED_PATH)”位置:“JS框架::resource://imacros/utils.js:::line 192" 数据:无],行:188(错误代码:991)
使用Expert Complete HTML Code我发现如果我遇到[图3]有以下代码:
TAG POS=1 TYPE=H2 ATTR=*
TAG POS=2 TYPE=P ATTR=CLASS:center