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.

Badword script is kicking owner

Help for those learning Tcl or writing their own scripts.
Post Reply
s
samkan
Voice
Posts: 2
Joined: Fri Feb 19, 2016 10:51 am

Badword script is kicking owner

Post by samkan »

Hallo together. I have a problem and I dont know how to fix it.

I get a tcl script for badwords from my friend on irc a lot of years ago. I am using the script for 5 years, but the bot is kicking me. I setup +protectfriends in egg.conf, but the bot still ban+kick me. Is the problem maybe in the badwords.tcl? Can you help me to add a line to say the bot he have to check first if the user has +fo flag?

Here is the tcl script:

Code: Select all

set badwords {
.
.
.
.
.
.
.
.
.
}

bind pubm - "*" pubm:badword


proc pubm:badword {nick uhost hand chan text} {
 global badwords
  if {[botisop $chan] && ![isbotnick $nick]} {
   foreach badword $badwords {
    if {[string match -nocase $badword $text]} {
      putquick "MODE $chan +b *!*@[lindex [split $uhost @] 1]"
      putquick "KICK $chan $nick :swearing!"
      timer 20 [list putquick "MODE $chan -b *!*@[lindex [split $uhost @] 1]"]
      }
    }
  }
} 


putlog "Badword loaded"
I hope you can help me. Thank you very much.
User avatar
SpiKe^^
Owner
Posts: 831
Joined: Fri May 12, 2006 10:20 pm
Location: Tennessee, USA
Contact:

Post by SpiKe^^ »

Test this....

Code: Select all

set badwords {
.
.
.
.
.
.
.
.
.
}

bind pubm - "*" pubm:badword


proc pubm:badword {nick uhost hand chan text} {
  global badwords

  if {[matchattr $hand "fo"]} { return 0 }

  if {[botisop $chan] && ![isbotnick $nick]} {
   foreach badword $badwords {
    if {[string match -nocase $badword $text]} {
      putquick "MODE $chan +b *!*@[lindex [split $uhost @] 1]"
      putquick "KICK $chan $nick :swearing!"
      timer 20 [list putquick "MODE $chan -b *!*@[lindex [split $uhost @] 1]"]

      break

    }
   }
  }

  return 0

} 


putlog "Badword loaded"

SpiKe^^

Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
.
s
samkan
Voice
Posts: 2
Joined: Fri Feb 19, 2016 10:51 am

Post by samkan »

Yes, it works. But now the bot is only banning users, without kicking them :S
User avatar
SpiKe^^
Owner
Posts: 831
Joined: Fri May 12, 2006 10:20 pm
Location: Tennessee, USA
Contact:

Post by SpiKe^^ »

Sorry, nothing has been changed in that part of the code.
SpiKe^^

Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
.
Post Reply