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.

swproc error in tcl script

Old posts that have not been replied to for several years.
Locked
N
Nucleus
Voice
Posts: 34
Joined: Fri Jul 09, 2004 3:35 am

swproc error in tcl script

Post by Nucleus »

Code: Select all

bind pubm - "*badword1*" swproc
bind pubm - "*badword2*" swproc
bind pubm - "*badword3*" swproc
bind pubm - "*badword4*" swproc
 

set swdura 600
set swkick "Swearing"

######## CODE - DO NOT TOUCH ########


bind ctcp - ACTION ctcp:badword 

proc ctcp:badword {nick uhost hand chan keyword text} { 
 if {[string match -nocase *badword* $text] || [string match -nocase *badword* $text] || [string match -nocase *badword* $text] || [string match -nocase *badword* $text] || [string match -nocase *badword* $text] || [string match -nocase *badword* $text] || [string match -nocase *badword* $text] || [string match -nocase *badword* $text] || [string match -nocase *badword* $text] || [string match -nocase *badword* $text] || [string match -nocase *badword* $text]} { 
  swproc $nick $uhost $hand $chan $text 
 } 
}

putlog "=====>> Swearing Protection Loaded"

This script gives me this error in the partyline.

Code: Select all

[22:16] Tcl error [swproc]: invalid command name "swproc"
[22:23] Tcl error [swproc]: invalid command name "swproc"
[22:24] Tcl error [swproc]: invalid command name "swproc"
Whats wrong with it? How do i fix it?
r
r0t3n
Owner
Posts: 507
Joined: Tue May 31, 2005 6:56 pm
Location: UK

Post by r0t3n »

the proc 'swproc' does not exist maybe :D. And why so many string match -nocase's :D.
r0t3n @ #r0t3n @ Quakenet
N
Nucleus
Voice
Posts: 34
Joined: Fri Jul 09, 2004 3:35 am

Post by Nucleus »

i have no idea. Any suggestions on fixing it?
r
r0t3n
Owner
Posts: 507
Joined: Tue May 31, 2005 6:56 pm
Location: UK

Post by r0t3n »

Code: Select all

set badwords { 
"badword"
"badword1"
"badword2"
"badword3"
"etc"
}

 
bind pub - * pub:badword

proc pub:badword {nick host hand chan text} {
  if {![matchattr $hand nmo|nmof]} {
    if {[string match "*$badwords*" $text]} {
      set badword $text
      putserv "KICK $chan $nick $badword is a badword"
    }
  }
}
Try that. Set badwords to the badwords you want. If a badword is detected, the person is kicked from the channel.

Tell me what you want in it, kick and then ban the user. Just ask me :D.
r0t3n @ #r0t3n @ Quakenet
N
Nucleus
Voice
Posts: 34
Joined: Fri Jul 09, 2004 3:35 am

Post by Nucleus »

ban (channel ban) and then kick. Thanks
M
Merk0r
Voice
Posts: 3
Joined: Wed Jul 27, 2005 12:33 pm

Post by Merk0r »

That's all wrong.

Code: Select all

set badwords {
"badword"
"badword1"
"badword2"
"badword3"
"etc"
}

 
bind pubm - * pub:badword

proc pub:badword {nick host hand chan text} {
  global badwords
  if {![matchattr $hand nmo|nmof]} {
     foreach badword $badwords {
       if {[string match *$badword* $text]} {
         putserv "KICK $chan $nick :You are not allowed to say $badword"
         break
       }
     }
   }
 } 
D
Dizzle
Op
Posts: 109
Joined: Thu Apr 28, 2005 11:21 am
Contact:

Post by Dizzle »

Code: Select all

set banreason "Used a badword"

set badwords { 
"badword" 
"badword1" 
"badword2" 
"badword3" 
"etc" 
} 

  
bind pubm - * pub:badword 

proc pub:badword {nick host hand chan text} { 
  global badwords banreason
  if {![matchattr $hand nmo|nmof]} { 
     foreach badword $badwords { 
       if {[string match *$badword* $text]} { 
         putserv "KICK $chan $nick :You are not allowed to say $badword"
         set ban *!*[string tolower [string range $uhost [string first @ $uhost] end]] 
         newchanban $chan $ban BadWord $banreason 15 
       } 
     } 
   } 
 } 
That with a channelban, its ban like *!*@user.domain.com
What's this real life ppl keep talking about ??? And where can I download it ???
M
Merk0r
Voice
Posts: 3
Joined: Wed Jul 27, 2005 12:33 pm

Post by Merk0r »

Code: Select all

set banreason "Badword was detected in your text"
set bantime "15"

set badwords {
"badword"
"badword1"
"badword2"
"badword3"
"etc"
}

 
bind pubm - * pub:badword

proc pub:badword {nick host hand chan text} {
  global badwords banreason bantime
  if {![matchattr $hand nmo|nmof]} {
     foreach badword $badwords {
       if {[string match *$badword* $text]} {
         putserv "KICK $chan $nick :You are not allowed to say $badword"
         newchanban $chan *![string map ~ * $host] BadWord $banreason $bantime none
       }
     }
   }
 } 
Locked