1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Random wait with imacros for firefox

Discussion in 'Other Scripting Languages' started by gelbervogel, Oct 18, 2013.

  1. gelbervogel

    gelbervogel Newbie

    Joined:
    Oct 18, 2013
    Messages:
    2
    Likes Received:
    0
    Hello,
    sorry my english is terrible !

    Code:
    1105 RECORDER=FX
    SET !ERRORIGNORE YES
    SET !VAR1 EVAL("var randomNumber1=Math.floor(Math.random()*0.5 + 0.1); randomNumber1;")
    SET !VAR2 EVAL("var randomNumber2=Math.floor(Math.random()*5 + 2); randomNumber2;")
    SET !VAR3 EVAL("var randomNumber3=Math.floor(Math.random()*50 + 90); randomNumber3;")
    TAB T=1
    WAIT SECONDS={{!VAR2}}
    URL GOTO=meineseite/
    CLICK X=92 Y=969
    WAIT SECONDS={{!VAR2}}
    CLICK X=512 Y=305
    WAIT SECONDS={{!VAR1}}
    CLICK X=512 Y=305
    WAIT SECONDS={{!VAR1}}
    CLICK X=512 Y=305
    WAIT SECONDS={{!VAR1}}
    CLICK X=512 Y=305
    WAIT SECONDS={{!VAR3}}
    TAB CLOSEALLOTHERS
    

    i want have to make 3 different random waits in my macro.

    VAR1 shoult wait between 0.1 and 0.5 seconds
    VAR2 shoult wait between 2 and 5 seconds
    VAR3 shoult wait between 90 and 140 seconds

    VAR3 works.

    VAR2 makes everytime 5 seconds.

    VAR1 i think, here ist no wait.


    Please can you help me ? Whith information do you need more ?


    gelbervogel
     
    Last edited: Oct 18, 2013
  2. gelbervogel

    gelbervogel Newbie

    Joined:
    Oct 18, 2013
    Messages:
    2
    Likes Received:
    0
    i think i found the mistakes :)

    is this correct like this ?

    Code:
    1105 RECORDER=FX
    SET !ERRORIGNORE YES
    TAB T=1
    SET !VAR2 EVAL("var randomNumber2=Math.random()*5 + 2; randomNumber2;")
    WAIT SECONDS={{!VAR2}}
    URL GOTO=meineseite/
    CLICK X=92 Y=969
    SET !VAR2 EVAL("var randomNumber2=Math.random()*5 + 2; randomNumber2;")
    WAIT SECONDS={{!VAR2}}
    CLICK X=512 Y=305
    SET !VAR1 EVAL("var randomNumber1=Math.random()*0.5 + 0.1; randomNumber1;")
    WAIT SECONDS={{!VAR1}}
    CLICK X=512 Y=305
    SET !VAR1 EVAL("var randomNumber1=Math.random()*0.5 + 0.1; randomNumber1;")
    WAIT SECONDS={{!VAR1}}
    CLICK X=512 Y=305
    SET !VAR1 EVAL("var randomNumber1=Math.random()*0.5 + 0.1; randomNumber1;")
    WAIT SECONDS={{!VAR1}}
    CLICK X=512 Y=305
    i think i found the mistakes :-)
    
    is this correct like this ?
    
    [CODE]
    1105 RECORDER=FX
    SET !ERRORIGNORE YES
    TAB T=1
    SET !VAR2 EVAL("var randomNumber2=Math.random()*5 + 2; randomNumber2;")
    WAIT SECONDS={{!VAR2}}
    URL GOTO=meineseite/
    CLICK X=92 Y=969
    SET !VAR2 EVAL("var randomNumber2=Math.random()*5 + 2; randomNumber2;")
    WAIT SECONDS={{!VAR2}}
    CLICK X=512 Y=305
    SET !VAR1 EVAL("var randomNumber1=Math.random()*0.5 + 0.1; randomNumber1;")
    WAIT SECONDS={{!VAR1}}
    CLICK X=512 Y=305
    SET !VAR1 EVAL("var randomNumber1=Math.random()*0.5 + 0.1; randomNumber1;")
    WAIT SECONDS={{!VAR1}}
    CLICK X=512 Y=305
    SET !VAR1 EVAL("var randomNumber1=Math.random()*0.5 + 0.1; randomNumber1;")
    WAIT SECONDS={{!VAR1}}
    CLICK X=512 Y=305
    SET !VAR3 EVAL("var randoWAIT SECONDS={{!VAR3}}
    WAIT SECONDS={{!VAR3}}
    TAB CLOSEALLOTHERS