egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Count triggers in a channel

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
ipone
Voice


Joined: 20 Mar 2006
Posts: 13

PostPosted: Fri Jul 30, 2010 10:23 pm    Post subject: Count triggers in a channel Reply with quote

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
View user's profile Send private message
willyw
Revered One


Joined: 15 Jan 2009
Posts: 1175

PostPosted: Sat Jul 31, 2010 12:33 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber