1

Found this site the other day. You click on a DIV (button) and it increments getting you points.

http://clickingbad.nullism.com/

I thought to myself I'll just inject jQuery and write a loop to click for me use the Chrome developer console and run code similar to the following:

for (var i=0;i<10;i++)
{ 
    $('#make_btn').click();
}

However it doesn't seem to be working like I'd think. It will at like it increments the first hit, but past that nothing. Also you'll see when you acutally use your mouse to click, it floats the points given. Programatically clicking does not. What's going on here?

1
  • Site is using ajax to update the data on server. If it is not encrypted per click, you could just send the same ajax yourself. Commented Oct 25, 2013 at 15:12

3 Answers 3

1

You can use setInterval() and use trigger('click')

setInterval(function () {
    $('#make_btn').trigger('click')
}, 1);
Sign up to request clarification or add additional context in comments.

Comments

0

what using either the trigger() method:

Execute all handlers and behaviors attached to the matched elements for the given event type.

for (var i=0;i<10;i++)
{ 
    $('#make_btn').trigger('click');
}

or use triggerHandler() method

Execute all handlers attached to an element for an event.

for (var i=0;i<10;i++)
{ 
    $('#make_btn').triggerHandler('click');
}

Comments

0

Simply the original function manipulate some event property that a simple trigger('click') do not pass.

Try this

var e = jQuery.Event("click");
e.pageX = e.pageY = 140;
for (var i=0;i<100;i++)
{ 
    setTimeout(function() {$('#make_btn').trigger(e)},100*i);
}

setTimeout for a nice effect and in order to prevent this check by site developer(from page source)

this.do_make_click = function() { 
        var nw = (new Date).getTime();
        if((nw - last_click) < 70) { 
            return false;
        }
        //...
}

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.