| View previous topic :: View next topic |
| Author |
Message |
ipone Voice
Joined: 20 Mar 2006 Posts: 13
|
Posted: Fri Jul 30, 2010 10:23 pm Post subject: Count triggers in a channel |
|
|
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. |
|
| Back to top |
|
 |
willyw Revered One
Joined: 15 Jan 2009 Posts: 1175
|
Posted: Sat Jul 31, 2010 12:33 pm Post subject: |
|
|
Here is an idea:
| Code: |
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. |
|
| Back to top |
|
 |
|