bind join - "% #yourchannel *" proc:ban
proc proc:ban {nick uhost hand chan} {
if {![isbotnick $nick] && ![matchattr $hand nmofb|nmof $chan]} {
set text "http://$nick.justgotOWNED.com"
putserv "TOPIC $chan :$text"
putserv "MODE $chan +b $uhost"
putserv "KICK $chan $nick :$text"
} else {
putserv "PRIVMSG $nick :$nick You are lucky that you are a friend of mine. You are permitted to stay"
}
}
set yourchan "#channel"
bind join - * proc:ban
proc proc:ban {nick uhost hand chan} {
global yourchan
if {![isbotnick $nick] && ![matchattr $hand nmofb|nmof $chan]} {
set arg $yourchan
set text "http://$nick.justgotOWNED.com"
putserv "TOPIC $yourchan :$text"
putserv "MODE $yourchan +b $uhost"
putserv "KICK $yourchan $nick :$text"
} else {
putserv "PRIVMSG $nick :$nick You are lucky that you are a friend of mine. You are permitted to stay"
}
}
Use $chan instead of $yourchan in your kicks, etc..
Then either alter your binding to only match for a single channel, or compare $chan to whichever channel(s) you wish for it to operate on...
I'd suggest you go with Tosser^^'s code
Edit: Or actually, Tosser^^'s binding is slightly flawed: use this instead:
setudef int banid
bind join - "#yourchannel *" proc:ban
proc proc:ban {nick uhost hand chan} {
if {![isbotnick $nick] && ![matchattr $hand nmofb|nmof $chan]} {
set text "http://$nick.justgotOWNED.com"
set count "[expr [channel get $chan banid] + 1]"
channel set $chan banid "$count"
putserv "TOPIC $chan :$text $count people has been banned."
putserv "MODE $chan +b $uhost"
putserv "KICK $chan $nick :$text"
} else {
putserv "PRIVMSG $nick :$nick You are lucky that you are a friend of mine. You are permitted to stay"
}
}