egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

enforcebans help

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
flexboy
Voice


Joined: 04 Feb 2007
Posts: 8

PostPosted: Mon Feb 12, 2007 8:56 am    Post subject: enforcebans help Reply with quote

Can some one help me with this it only kicks one user...


Code:

setudef flag enforceban
bind mode - "* +b" enforceban
set enforce(max) "8"

set  enforce(kick) {
  "[na(k)]"
  "[BX]"
  "..(cyp/k) "
  "[pv!k]"
}

set enforce(kmsg) {
  "No pussy for you!"
  "Go sit on a penis."
  "cock sucking bathroom queen."
  "too bad you won't see the hot titties now."
  "[censored] off."
  "buttslut."
  "go lick that big ass hairy mole between your pussy lips."
  "[censored] face cock master."
  "gutter whore"
}

proc enforceban {nick uhost hand chan mc ban} {
  global enforce
  if {[botisop $chan]} {
    if {![string match *+enforceban* [channel info $chan]]} {return 0}
    if {[botisop $chan]} {

      set ban [string map {"\\" "\\\\" "\[" "\\["} $ban]
      set reason [lindex $enforce(kick) [rand [llength $enforce(kick)]]]
      set reason2 [lindex $enforce(kmsg) [rand [llength $enforce(kmsg)]]]


      set list [list]
      foreach user [chanlist $chan] {
        if {[isbotnick $user]} {
          continue
        } elseif {[matchattr [nick2hand $user] f|f $chan]} { return }
        continue
        } elseif {[string match -nocase [string map {"\\" "\\\\" "\[" "\\["} $ban] $nick![getchanhost $nick $chan]} {
        lappend list $user
      }
    }

    if {[set llist [llength $list]] > $enforce(max)} {
      putserv "MODE $chan -ob $nick $ban"
      } else {
      for {set i 0;set temp [list];set j 0} {$i <= $llist} {incr i} {
        if {$j == 3 || $i == $llist} {
          if {$j > 0} {
            putserv "KICK $chan [join $temp ,] :$reason reason2"
            set temp [list]
            set j 0
          }
        }
        lappend temp [lindex $list $i]
        incr j
      }
    }
  }
}
Back to top
View user's profile Send private message
user
 


Joined: 18 Mar 2003
Posts: 1452
Location: Norway

PostPosted: Mon Feb 12, 2007 9:49 am    Post subject: Re: enforcebans help Reply with quote

flexboy wrote:
Can some one help me with this it only kicks one user...

It should give you an error (and kick NO users) - apply proper indentation and you'll see where your error is (the foreach)
_________________
Have you ever read "The Manual"?
Back to top
View user's profile Send private message
metroid
Owner


Joined: 16 Jun 2004
Posts: 771

PostPosted: Mon Feb 12, 2007 1:28 pm    Post subject: Reply with quote

Did you try to "enhance" the script by adding random crap?
My original version was different, and not alot of IRCd's actually support kicking 3 people at the same time (I think)

Code:
setudef flag enforcebans

set enforce(max)       8;
set enforce(reasons)   [list \
                       "Some kick message" \
                       "Another one!" \
                       "And yet another one!" \
                       ]

bind mode - "* +b" enforceban

proc enforceban {nick uhost hand chan mc ban} {
  global enforce
  if {[channel get $channel enforcebans] && [botisop $chan]} {
    set banmask [string map {"\\" "\\\\" "\[" "\\["} $ban]
    set reason [lindex $enforce(reasons) [rand [llength $enforce(reasons)]]]

    set list [list]
    foreach user [chanlist $chan] {
      if {[isbotnick $user] || [matchattr [nick2hand $user] f|f $chan]} {
        continue
      } elseif {[string match -nocase $banmask $user![getchanhost $user $chan]]} {
        lappend list $user
      }
    }

    if {[llength $list] > $enforce(max)} {
      putserv "MODE $chan -ob $nick $ban"
    } else {
      foreach user $list {
        putserv "KICK $chan $user :$reason"
      }
    }
  }
}
Back to top
View user's profile Send private message
user
 


Joined: 18 Mar 2003
Posts: 1452
Location: Norway

PostPosted: Mon Feb 12, 2007 4:07 pm    Post subject: Reply with quote

metroid wrote:
not alot of IRCd's actually support kicking 3 people at the same time (I think)

"putkick" and the conf variable "kick-method" exists for a reason - so you don't need to care about that in your scripts Smile
And I think even fewer ircds have case sensitive bans... Wink
_________________
Have you ever read "The Manual"?
Back to top
View user's profile Send private message
flexboy
Voice


Joined: 04 Feb 2007
Posts: 8

PostPosted: Mon Feb 12, 2007 9:41 pm    Post subject: Reply with quote

Ok i got that now, i want when people change there nick and the nick is in the banlist it will auto kick them.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber