that code will only work for the left mouse click hence "mouse event left - up & down."
i'm not sure what your having trouble with, getting it to click? if this is the case your almost there.
create a timer and add this the the timer:
mouse_event(mouseeventf_leftdown, 0, 0, 0, 0)...