You want the click events to be user-initiated (for security, obviously). You'll need to simulate the clicks at the OS level. On Windows (also security), I like AutoIt for this task.
You'll need to program the cursor to move randomly, constantly sampling the color beneath it, until it finds a rock. Then submitting many sequential clicks becomes trivial:
// from http://www.autoitscript.com/autoit3/docs/functions/MouseClick.htm
// MouseClick ( "button" [, x, y [, clicks = 1 [, speed = 10]]] )
MouseClick ("left", x, y, 50, 10)
Enjoy. Run the script in the console of your browser's developer tool and move the mouse cursor on the rock...
var elem = $('#uc-rockcanvas');
var x, y;
elem.mousemove(function (e) {
x = e.pageX, y = e.pageY;
});
var trigger = function () {
elem.trigger(jQuery.Event("mousedown", {
pageX: x,
pageY: y
}));
}
setInterval(trigger, 10);