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

Help Needed with iMacros Wait Time Variable in Firefox

Discussion in 'Other Scripting Languages' started by Plus44, Mar 18, 2015.

  1. Plus44

    Plus44 Power Member

    Joined:
    Dec 14, 2014
    Messages:
    644
    Likes Received:
    245
    Gender:
    Male
    Location:
    US
    This has a wait time of 1-10 seconds. Completely random every time.

    Code:
    SET !VAR1 EVAL("var randomNumber=Math.floor(Math.random()*10 + 1); randomNumber;") 
    WAIT SECONDS={{!VAR1}}
    
    How do I set this to be whatever random wait time variable I want?

    15-30 seconds is preferred, but when I change the script to

    Code:
    SET !VAR1 EVAL("var randomNumber=Math.floor(Math.random()*[COLOR=#00ff00]30 + 15[/COLOR]); randomNumber;") 
    WAIT SECONDS={{!VAR1}}
    
    it does not work at all.
     
    Last edited: Mar 18, 2015
  2. Plus44

    Plus44 Power Member

    Joined:
    Dec 14, 2014
    Messages:
    644
    Likes Received:
    245
    Gender:
    Male
    Location:
    US
    Firefox version 36.0.1
    iMacros 8.8.9
     
  3. nirose

    nirose Senior Member

    Joined:
    Oct 24, 2008
    Messages:
    1,007
    Likes Received:
    440
    Location:
    somake.us
    Here you go

    Code:
    SET !VAR1 EVAL("var min = 15; var max = 30; var randomNumber = Math.floor(Math.random() * (max - min + 1)) + min; randomNumber;")
    WAIT SECONDS={{!VAR1}}
    
    494
     
    • Thanks Thanks x 1
  4. Plus44

    Plus44 Power Member

    Joined:
    Dec 14, 2014
    Messages:
    644
    Likes Received:
    245
    Gender:
    Male
    Location:
    US
    PROBLEM SOLVED

    nirose, thank you man. BHW came to the rescue once again. Answered my question 100%
     
  5. vincent122

    vincent122 Newbie

    Joined:
    Apr 16, 2014
    Messages:
    49
    Likes Received:
    3
    thank you very much for this. gonna update all my codes now