Imacros, how to random click

Discussion in 'General Programming Chat' started by Designer1, Sep 18, 2016.

  1. Designer1

    Designer1 Regular Member

    Joined:
    Oct 19, 2012
    Messages:
    314
    Likes Received:
    49
    Let's say that I want a macro that would randomly click or not click on facebook sign up button (it's just an example).

    I've adapted this, but it's not working.


    Code:
    VERSION BUILD=9030808 RECORDER=FX
    TAB T=1
    TAB CLOSEALLOTHERS
    SET !ERRORIGNORE NO
    
    SET u_0_i "signup"
    SET u_0_i EVAL("(Math.floor(2*Math.random()) == 0) ? 'No such button!' : '{{u_0_i}}';")
    SET !TIMEOUT_STEP 0
    URL GOTO=https://www.facebook.com/
    TAG POS=1 TYPE=BUTTON FORM=ID:reg ATTR=ID:{{u_0_i}}
    SET !TIMEOUT_STEP 6
    
    Can someone please explain me how to properly do this?
    thanks in advance for any input.
     
  2. Designer1

    Designer1 Regular Member

    Joined:
    Oct 19, 2012
    Messages:
    314
    Likes Received:
    49
    solved, sixth line, signup instead of u_0_i