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.
Help for those learning Tcl or writing their own scripts.
samkan
Voice
Posts: 2 Joined: Fri Feb 19, 2016 10:51 am
Post
by samkan » Fri Feb 19, 2016 10:57 am
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.
SpiKe^^
Owner
Posts: 831 Joined: Fri May 12, 2006 10:20 pm
Location: Tennessee, USA
Contact:
Post
by SpiKe^^ » Fri Feb 19, 2016 1:08 pm
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"
samkan
Voice
Posts: 2 Joined: Fri Feb 19, 2016 10:51 am
Post
by samkan » Fri Feb 19, 2016 4:18 pm
Yes, it works. But now the bot is only banning users, without kicking them :S
SpiKe^^
Owner
Posts: 831 Joined: Fri May 12, 2006 10:20 pm
Location: Tennessee, USA
Contact:
Post
by SpiKe^^ » Fri Feb 19, 2016 6:52 pm
Sorry, nothing has been changed in that part of the code.