How do I use if statements to check the content of the page, then perform an action based on the if statement? Here are the possible outcomes when it comes to clicking:
Picture 1
https://i.stack.imgur.com/bpqy5.png
Picture 2
https://i.stack.imgur.com/1T1un.png
Picture 3
https://i.stack.imgur.com/XQoPA.jpg
So here's my mainline logic:
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
If the images are not clear then feel free to comment and I'll try my best to upload more clear images.
So right now I tried to build the code but it doesn't seem to work.
Map.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")
}
map1.iim
TAG POS=1 TYPE=INPUT:IMAGE FORM=ACTION:/map.php?Map=11 ATTR=NAME:Find
It's giving me this error:
[Exception... "Component returned failure code: 0x80520001 (NS_ERROR_FILE_UNRECOGNIZED_PATH) [nsILocalFile.initWithPath]" nsresult: "0x80520001 (NS_ERROR_FILE_UNRECOGNIZED_PATH)" location: "JS frame :: resource://imacros/utils.js :: :: line 192" data: no], line: 188 (Error code: 991)
Using Expert Complete HTML Code I found out that if I encounter [Picture 3] has the following code:
TAG POS=1 TYPE=H2 ATTR=*
TAG POS=2 TYPE=P ATTR=CLASS:center