Greasy Fork is available in English.

Facebook AutoPoke

Poke your friends autonomously!

< Feedback on Facebook AutoPoke

Review: Good - script works

§
Posted: 31.10.2019

Some minor tweaks

Thanks for this silly script.

I tweaked mine to add a few things to make this script awesomer (moved user-adjustable stuff to a top section, added random delay feature, moved the pokeclass to a variable to adapting to FB changes easier)


// begin user-adjustable stuff

var execinterval = 2999; // run every almost-3-seconds (don't make this too low or Chrome ignores you) var randdelaymin = 1; // random delay min (added to the execinterval) var randdelaymax = 10000; // random delay max (added to the exec_interval)

// end adjusting things

function randomInt(min, max) { // min and max inclusive return Math.floor(Math.random() * (max - min + 1) + min); }

function tryPoke(){ var pokeclass = "42ft _4jy0 _4jy3 _4jy1 selected _51sy"; // make this a variable in case they change it (plus everything else is easier to read now) if(document.getElementsByClassName(pokeclass).length > 1) { var i; setTimeout(function(){ // delay the running for(i = 1; i < document.getElementsByClassName(pokeclass).length; ++i) { // find the div items if(document.getElementsByClassName(pokeclass)[i].parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.className == "") { document.getElementsByClassName(pokeclass)[i].click(); } } }, randomInt(randdelaymin,randdelay_max)); // delay a random amount (as set before) } }

setInterval(tryPoke, exec_interval); // run every almost-3-seconds

§
Posted: 10.11.2019

Haha yes, very good changes indeed! I did this in the late hours of the night one night when I was bored, making spaghetti code was the only thing I was capable of hehe.

I appreciate this post and hope your contributions will entice other people to play around with my scripts and through the power of the community, improve them for everyone else!

Thanks again boinger! Cheers.

Post reply

Sign in to post a reply.