You are here: DEVPPL Forum Programming JavaScript Forum
NOTIFICATIONS
54.115
MEMBERS
15.697
TOPICS
62.285
POSTS
  562
FLASH GAMES
7.740
TUTORIALS
 

Login

E-mail:
Password:

Loop in EVAL in Imacros for Firefox

0

Loading

Loop in EVAL in Imacros for Firefox

Postby Youngcoderiam » Wed Nov 30, 2011 10:01 pm

Dear all,
I'm new with JavaScript, so can please help me with this macro?
I need to reload URL (in this case refresh same page) until I don't have word beginning with capitalized A, B or C.
I can't find the way to create loop inside EVAL.
Can somebody help me please?
Thank you!

Code: Select all
VERSION BUILD=7401110 RECORDER=FX
TAB T=1
URL GOTO=http://watchout4snakes.com/CreativityTools/RandomWord/RandomWord.aspx
SET !EXTRACT_TEST_POPUP NO
TAG POS=1 TYPE=SPAN ATTR=ID:tmpl_main_lblWord EXTRACT=TXT
SET !VAR1 EVAL("var re = /^[A || B || C]/gi; var str = \"{{!EXTRACT}}\"; while(str.search(re) == -1) {URL GOTO=http://watchout4snakes.com/CreativityTools/RandomWord/RandomWord.aspx}")
PROMPT {{!EXTRACT}}
Youngcoderiam
 
Reputation: 0
Posts: 2
Joined: Wed Nov 30, 2011 9:54 pm
Highscores: 0
Arcade winning challenges: 0

Loop in EVAL in Imacros for Firefox - Sponsored results

Sponsored results

Login to get rid of ads

 

0

Loading

Re: Loop in EVAL in Imacros for Firefox

Postby Youngcoderiam » Thu Dec 01, 2011 9:54 pm

With this part of code I need help, where {{!EXTRACT}} is extracted word (variable) from page. So, while {{!EXTRACT}} is not word that starts with uppercase letter A, B or C, I need to go again and again on the same URL (in this case to refresh same page):

Code: Select all
var re = /^[A || B || C]/gi;
var str = \"{{!EXTRACT}}\";
while(str.search(re) == -1)
{
go to this URL
}


Thank you!
Youngcoderiam
 
Reputation: 0
Posts: 2
Joined: Wed Nov 30, 2011 9:54 pm
Highscores: 0
Arcade winning challenges: 0
^ Back to Top