Here is my update to the original (and the cleanest imo) version of ths script as per the need of the created sub-thread.
Read here
It doesnt have a resetpokecount. I dont see the use. If you want you could be "not lazy" and go and reset the count to 1 or just delete the count file
if messenger is closed/script is disabled
Download 'Advanced Poking' Script