| View previous topic :: View next topic |
| Author |
Message |
silverboy Halfop
Joined: 11 Feb 2006 Posts: 55
|
Posted: Mon Apr 30, 2007 4:15 am Post subject: ban bot via x |
|
|
could anyone pls get me a tcl which can suspend the username if the bot gets banned via UNDERNET Channel service bot " X "
when the bot get banned via X it shud /msg x suspend #chan username 5 d _________________ proxyz..proxyz...i see everywher... O_o |
|
| Back to top |
|
 |
DarkRaptor Voice

Joined: 15 Apr 2006 Posts: 36 Location: Trois-Rivières, Qc
|
Posted: Mon Apr 30, 2007 2:08 pm Post subject: |
|
|
Try this:
| Code: |
bind KICK - * CService:kick:by:X:revenge
proc CService:kick:by:X:revenge { nick host hand chan target reason } {
global botnick
if {[nick2hand $nick] == "X" && $target == $botnick} {
set temp1 [lindex [split [lindex [split $reason] 0] "("] 1]
set username [lindex [split [lindex [split $temp1] 0] ")"] 0]
putquick "PRIVMSG X :SUSPEND $chan $username 5 D"
}
}
|
Note: X must be in bot's userlist. _________________ DarkRaptor @ irc.undernet.org |
|
| Back to top |
|
 |
silverboy Halfop
Joined: 11 Feb 2006 Posts: 55
|
Posted: Tue May 01, 2007 12:02 am Post subject: |
|
|
wow... this one is nice, cud yu pls add /msg x unban $chan bot and /msg x invite chan $bot _________________ proxyz..proxyz...i see everywher... O_o |
|
| Back to top |
|
 |
DarkRaptor Voice

Joined: 15 Apr 2006 Posts: 36 Location: Trois-Rivières, Qc
|
Posted: Tue May 01, 2007 12:40 am Post subject: |
|
|
| Code: |
bind KICK - * CService:kick:by:X:revenge
proc CService:kick:by:X:revenge { nick host hand chan target reason } {
global botnick
if {[nick2hand $nick] == "X" && $target == $botnick} {
set temp1 [lindex [split [lindex [split $reason] 0] "("] 1]
set username [lindex [split [lindex [split $temp1] 0] ")"] 0]
putserv "PRIVMSG X :SUSPEND $chan $username 5 D"
putserv "PRIVMSG X :UNBAN $chan $botnick"
puthelp "PRIVMSG X :INVITE $chan"
}
}
|
EDIT: Changed putquick to putserv to prevent flooding _________________ DarkRaptor @ irc.undernet.org |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Tue May 01, 2007 7:07 am Post subject: |
|
|
Tips: You can use just $hand instead of [nick2hand $nick] and [isbotnick $target] instead of $target == $botnick (so you won't need $botnick anymore). _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
Nor7on Op

Joined: 03 Mar 2007 Posts: 185 Location: Spain - Barcelona
|
Posted: Sun Mar 16, 2008 6:15 am Post subject: |
|
|
how make this:
if an user (+o or +m) as kicked for other user, the eggdrop suspend the username kicker.
sorry for the baaaaaaaaaaaaad english lol.
Thanks  |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Sun Mar 16, 2008 7:06 am Post subject: |
|
|
Try
| Code: | bind KICK - * CService:kick:by:X:revenge
proc CService:kick:by:X:revenge { nick host hand chan target reason } {
global botnick
if {$hand == "X" && ([isbotnick $target] || [matchattr [nick2hand $target $chan] mo|mo $chan])} {
set temp1 [lindex [split [lindex [split $reason] 0] "("] 1]
set username [lindex [split [lindex [split $temp1] 0] ")"] 0]
putserv "PRIVMSG X :SUSPEND $chan $username 5 D"
putserv "PRIVMSG X :UNBAN $chan $botnick"
puthelp "PRIVMSG X :INVITE $chan"
}
} |
_________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
Nor7on Op

Joined: 03 Mar 2007 Posts: 185 Location: Spain - Barcelona
|
Posted: Sun Mar 16, 2008 9:44 am Post subject: |
|
|
hi.
the code don't work, don't send nothing.
so, sorry but this code work, but just when kicked the eggdrop.
| Code: |
setudef flag xkick
bind kick * * xstuff:kick
proc xstuff:kick {nick hand text chan vict reas} {
set unicks [lindex $text 0]
if {![isbotnick $vict] || [matchattr [nick2hand $unicks $chan] b $chan]} return
if {[channel get $chan xkick] && $nick == "X"} {
set kicker [string trim [lindex [split $reas] 0] {()}]
putserv "PRIVMSG X :SUSPEND $chan $kicker 4d 100"
}
}
putlog "SUSPEND USERS LOADED"
|
this code work only when kick the eggdrop, but don't work when kick other bot.
i change the flag b to flag o|o but don't work too.
so something wrong ?
 |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Sun Mar 16, 2008 3:07 pm Post subject: |
|
|
o|o means global or channel-specific +o user-flag and not +o channel mode (op). You need to add the users you wish to protect as +o users in your Eggdrop's userlist. _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
Nor7on Op

Joined: 03 Mar 2007 Posts: 185 Location: Spain - Barcelona
|
Posted: Sun Mar 16, 2008 3:13 pm Post subject: |
|
|
yeah.
i tested with a user (flag o) but don't work. |
|
| Back to top |
|
 |
Nor7on Op

Joined: 03 Mar 2007 Posts: 185 Location: Spain - Barcelona
|
Posted: Sun Mar 16, 2008 6:41 pm Post subject: |
|
|
i modif this.
| Code: |
setudef flag xkick
bind kick * * xstuff:kick
proc xstuff:kick {nick hand text chan vict reas} {
set unicks [lindex $text 0]
set users [nick2hand $unicks $chan]
if {![isbotnick $vict] || [matchattr $users o|o $chan]} return
if {[channel get $chan xkick] && $nick == "X"} {
set kicker [string trim [lindex [split $reas] 0] {()}]
putserv "PRIVMSG X :SUSPEND $chan $kicker 4d 100"
}
}
putlog "SUSPEND USERS LOADED"
|
but too don't work, only work when kick the eggdrop.
Any suggestion?
 |
|
| Back to top |
|
 |
speechles Revered One

Joined: 26 Aug 2006 Posts: 1398 Location: emerald triangle, california (coastal redwoods)
|
Posted: Sun Mar 16, 2008 8:35 pm Post subject: |
|
|
| Code: | | if {![isbotnick $vict]... |
isbotnick only checks the eggdrop's nickname, not any other bots, just that single bot. To check for any bot simply check if the user has the bot flag (b) then you know it's a bot and part of the botnet.
| Code: | setudef flag xkick
bind kick - * xstuff:kick
proc xstuff:kick {nick host hand chan target reason} {
if {[channel get $chan xkick] && $nick == "X"} {
set kicker [string trim [lindex [split $reason] 0] {()}]
if {[matchattr [nick2hand $target $chan] b|b $chan] && [matchattr [nick2hand $kicker $chan] mo|mo $chan]} {
putserv "PRIVMSG X :SUSPEND $chan $kicker 4d 100"
putserv "PRIVMSG X :UNBAN $chan $target"
if {[isbotnick $target]} {
puthelp "PRIVMSG X :INVITE $chan"
} else {
puthelp "INVITE $target $chan"
}
}
}
}
putlog "xstuff armed and ready for revenge." |
What this does is watch all kicks made by X. If it was a bot (even an unopped bot in the bots userlist) and the person requesting it to be kicked has +o or +m, they get suspended. Afterwards bot unbans the bot banned by the user. If the bot itself was banned, it will have X invite it back, otherwise the bot itself will invite back the banned bot. |
|
| Back to top |
|
 |
Nor7on Op

Joined: 03 Mar 2007 Posts: 185 Location: Spain - Barcelona
|
Posted: Mon Mar 17, 2008 6:25 am Post subject: |
|
|
Thanks speechles Sir_Fz.
work now.
i modif something and that work perfect, suspend de user and put flag +d-o in channel
thanks.
 |
|
| Back to top |
|
 |
Nor7on Op

Joined: 03 Mar 2007 Posts: 185 Location: Spain - Barcelona
|
Posted: Wed Mar 19, 2008 4:04 pm Post subject: |
|
|
a little question.
how add this in the code?
| Code: | | chattr $kickusers |+d-o $chan |
where $kickusers is the HAND of $kicker.
how add this?  |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Wed Mar 19, 2008 4:34 pm Post subject: |
|
|
| Code: | | chattr [nick2hand $kicker $chan] |+d-o $chan |
_________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
|