| View previous topic :: View next topic |
| Author |
Message |
flexboy Voice
Joined: 04 Feb 2007 Posts: 8
|
Posted: Mon Feb 12, 2007 8:56 am Post subject: enforcebans help |
|
|
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 |
|
 |
user

Joined: 18 Mar 2003 Posts: 1452 Location: Norway
|
Posted: Mon Feb 12, 2007 9:49 am Post subject: Re: enforcebans help |
|
|
| 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 |
|
 |
metroid Owner
Joined: 16 Jun 2004 Posts: 771
|
Posted: Mon Feb 12, 2007 1:28 pm Post subject: |
|
|
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 |
|
 |
user

Joined: 18 Mar 2003 Posts: 1452 Location: Norway
|
Posted: Mon Feb 12, 2007 4:07 pm Post subject: |
|
|
| 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
And I think even fewer ircds have case sensitive bans...  _________________ Have you ever read "The Manual"? |
|
| Back to top |
|
 |
flexboy Voice
Joined: 04 Feb 2007 Posts: 8
|
Posted: Mon Feb 12, 2007 9:41 pm Post subject: |
|
|
| 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 |
|
 |
|