# March 3, 2014
# http://forum.egghelp.org/viewtopic.php?t=19637
# Example: .chanset #channel +female
# will cause bot to kick and ban *!Male@* , upon joining #channel
# Example: .chanset #channel +male
# will cause bot to kick and ban *!Female@* , upon joining #channel
# Note: Ban will expire after 60 minutes, and bot will remove the ban.
# Examine the script, and feel free to change ban time to whatever you like.
# Note: You should edit the ban messages.
# Reference: http://www.eggheads.org/support/egghtml/1.6.21/tcl-commands.html
# bind join
# setudef
# newchanban
# can all be found there. :)
# More reference : http://www.tcl.tk/man/tcl8.5/TclCmd/contents.htm
setudef flag female
setudef flag male
bind join - "* *" ban_by_gender
proc ban_by_gender {nick uhost handle chan} {
global botnick
if {[channel get $chan female]} {
set user [string tolower [lindex [split $uhost @] 0] ]
if {$user == "male"} {
newchanban $chan [maskhost $nick!$uhost 2] $botnick "Edit this comment" 60
}
}
if {[channel get $chan male]} {
set user [string tolower [lindex [split $uhost @] 0] ]
if {$user == "female"} {
newchanban $chan [maskhost $nick!$uhost 2] $botnick "Edit this comment" 60
}
}
}
I've chosen a different path by having a simple gender flag cos having two channel modes (female and male) can screw things up. By default it's disabled (set to 0), so set it to 1 for Female or 2 for Male.