This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Count triggers in a channel

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
i
ipone
Voice
Posts: 13
Joined: Mon Mar 20, 2006 7:00 am

Count triggers in a channel

Post by ipone »

I have been looking around on the forum, and also the tcl-Archive to try to find what im looking for, but no sucess.

I would like to have a small script that counts a specific trigger in a channel.

So lets say it like this

<ME> !help
<SOMEOTHERDUDE> !help
<ME> !count
<BOT> The trigger !help have been used for 412 times.

Dont know if this is a small or big script. i will try my luck to find it.

Regards.
w
willyw
Revered One
Posts: 1203
Joined: Thu Jan 15, 2009 12:55 am

Post by willyw »

Here is an idea:

Code: Select all

bind pub - "!count" hit_counter

proc hit_counter { nick uhost handle chan text }  {
	putserv "privmsg $chan :!help has been used [lindex [binds !help] 0 3 ] times. "

}
But, I wonder if it is possible that you might have "!help" as a trigger in some other channel, doing something else. Because - if you do, the above might produce results that you do not expect.
We might need to make it more selective.

Experiment with it, and see what you get.
I hope this helps.

Perhaps someone else will post with refinements.
Post Reply