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.

ban bot via x

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
s
silverboy
Halfop
Posts: 55
Joined: Sat Feb 11, 2006 5:44 am
Contact:

ban bot via x

Post by silverboy »

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
User avatar
DarkRaptor
Voice
Posts: 36
Joined: Sat Apr 15, 2006 2:39 am
Location: Trois-Rivières, Qc

Post by DarkRaptor »

Try this:

Code: Select all

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
s
silverboy
Halfop
Posts: 55
Joined: Sat Feb 11, 2006 5:44 am
Contact:

Post by silverboy »

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
User avatar
DarkRaptor
Voice
Posts: 36
Joined: Sat Apr 15, 2006 2:39 am
Location: Trois-Rivières, Qc

Post by DarkRaptor »

Code: Select all

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
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Tips: You can use just $hand instead of [nick2hand $nick] and [isbotnick $target] instead of $target == $botnick (so you won't need $botnick anymore).
User avatar
Nor7on
Op
Posts: 185
Joined: Sat Mar 03, 2007 8:05 am
Location: Spain - Barcelona
Contact:

Post by Nor7on »

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 :wink:
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Try

Code: Select all

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"
 }
}
User avatar
Nor7on
Op
Posts: 185
Joined: Sat Mar 03, 2007 8:05 am
Location: Spain - Barcelona
Contact:

Post by Nor7on »

hi.

the code don't work, don't send nothing.

so, sorry but this code work, but just when kicked the eggdrop.

Code: Select all

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 ?

:wink:
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

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.
User avatar
Nor7on
Op
Posts: 185
Joined: Sat Mar 03, 2007 8:05 am
Location: Spain - Barcelona
Contact:

Post by Nor7on »

yeah.

i tested with a user (flag o) but don't work.
User avatar
Nor7on
Op
Posts: 185
Joined: Sat Mar 03, 2007 8:05 am
Location: Spain - Barcelona
Contact:

Post by Nor7on »

i modif this.

Code: Select all

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?

:?
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

Code: Select all

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: Select all

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.
User avatar
Nor7on
Op
Posts: 185
Joined: Sat Mar 03, 2007 8:05 am
Location: Spain - Barcelona
Contact:

Post by Nor7on »

Thanks speechles Sir_Fz.

work now.

i modif something and that work perfect, suspend de user and put flag +d-o in channel ;)

thanks. :)

:wink:
User avatar
Nor7on
Op
Posts: 185
Joined: Sat Mar 03, 2007 8:05 am
Location: Spain - Barcelona
Contact:

Post by Nor7on »

a little question.

how add this in the code?

Code: Select all

chattr $kickusers |+d-o $chan
where $kickusers is the HAND of $kicker.

how add this? :o
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Code: Select all

chattr [nick2hand $kicker $chan] |+d-o $chan
Post Reply