Eggheads: Coding ban script

Anser Quraishi anser at cox.net
Fri Oct 8 22:40:37 CST 2004


Thank you =) You guys are really helpful!! :D

On Fri, 2004-10-08 at 21:24, Dariusz Kulinski wrote:

> Hello Anser,
> 
> Friday, October 8, 2004, 8:43:36 PM, you wrote:
> 
> >   How would you code a simple command, for instance if you type
> > -vb nick in channel and you want to bot to kickban the user with the
> > reason: You're infected with a virus, please join #vh for virus
> > removal.
> 
> > It'd really help, thanks 
> 
> From memory (not tested):
> 
> --- cut here ---
> namespace eval virus_kick {
> 
> variable Config
> 
> set Config(reason) "You're infected with a virus, please join #vh for virus removal"
> set Config(bantime) 60
> 
> bind pub o|o -vb [current namespace]::pub_vb
> proc pub_vb {unick uhost uhand chan text} {
>   set victim [lindex [split $text] 0]
> 
>   if {![onchan $victim $chan]} {
>     notice $unick "$victim is not on $chan"
>     return 0
>   }
> 
>   set victim_hand [nick2hand $victim  $chan]
>   if {[matchattr $victim_hand o|o $chan]} {
>     notice $unick "I cannot ban $victim ($victim_hand), he is privileged user"
>     return 0
>   }
> 
>   variable Config
> 
>   putkick $chan $victim $Config(reason)
>   newchanban $chan "*!$uhost" $uhand $Config(reason) $Config(bantime)
> 
>   return 1
> }
> 
> proc notice {nick msg} {
>   puthelp "PRIVMSG $nick :$msg"
> }
> 
> } ;# virus_kick
> --- cut here ---
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.eggheads.org/pipermail/eggheads/attachments/20041008/29b93ac2/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smiley-1.png
Type: image/png
Size: 798 bytes
Desc: not available
URL: <http://lists.eggheads.org/pipermail/eggheads/attachments/20041008/29b93ac2/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smiley-5.png
Type: image/png
Size: 796 bytes
Desc: not available
URL: <http://lists.eggheads.org/pipermail/eggheads/attachments/20041008/29b93ac2/attachment-0001.png>


More information about the Eggheads mailing list