| View previous topic :: View next topic |
| Author |
Message |
samhain Halfop
Joined: 03 Jan 2007 Posts: 77
|
Posted: Sat Aug 21, 2010 4:27 pm Post subject: Remove username on massban |
|
|
Hi I need a simple tcl if a user bans *!*@* from X username I mean mass ban which is popular on undernet
/msg X ban #channel *!*@*
then the bot should remove that username immidiately from the channel. |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Sun Aug 22, 2010 2:01 pm Post subject: |
|
|
Since it can't detect who placed the ban unless the bot is kicked by X, the next piece of code will do just that: when kicked tough X it will tell it to remove the user from it's channel user list.
| Code: |
bind kick * * my:kick
proc my:kick {nick uhost hand chan vict reas} {
if {![isbotnick $vict] || $nick != "X"} return
set kicker [string trim [lindex [split $reas] 0] {()}]
putquick "PRIVMSG X :REMOVE $chan $kicker" -next
}
|
_________________ Once the game is over, the king and the pawn go back in the same box. |
|
| Back to top |
|
 |
|