| View previous topic :: View next topic |
| Author |
Message |
Danik Halfop
Joined: 15 Jun 2008 Posts: 49 Location: Moldova
|
Posted: Thu Aug 21, 2008 12:43 pm Post subject: mask ban |
|
|
when I set !ban <nick> .. the eggdrop ban's the user in this way *!*~Tester@*.moldtelecom.md
does anybody know what do i need to change so the eggdrop will ban only the MASK ?
| Code: | proc pub_lol_ban {nick host hand chan arg} {
set arg [charfilter $arg]
global lol botnick
if {![check $hand $nick $host]} {
if {$lol(silent) == 1 || [checksilent $hand]} {return 0}
puthelp "NOTICE $nick :You need to be identified to use this function. Type .identhelp in the partyline for more info. : \002/msg $botnick id <password>\002 or \002/msg $botnick silent <password>\002 to no more receive this warning."
return 0
}
if {[llength $arg] < 1} {
puthelp "NOTICE $nick :\002Usage:\002 [string trim $lol(cmdchar)]ban <nick|mask> \[time\] \[reason\]"
return 0
}
set who [lindex $arg 0]
set ti [lindex $arg 1]
if {[number $ti]} {
set reason [lrange $arg 2 end]
} {
set ti ""
set reason [lrange $arg 1 end]
}
if {$reason == ""} {set reason "requested by $hand"}
if {[string first "*" $who] != -1 || [string first "?" $who] != -1} {
if {$reason == "requested by $hand"} {set reason "MaskBan: $who"}
set who [strlwr $who]
set bancount 0
set flags "-$lol(no_ban_flags)&-$lol(no_ban_flags)"
if {$lol(no_ban_flags) == ""} {
set list [strlwr [chanlist $chan]]
} {
set list [strlwr [chanlist $chan $flags]]
}
foreach chanuser $list {
set banmask ""
if {[string match [strlwr $who] [strlwr $chanuser]] && $chanuser != [strlwr $botnick] && $chanuser != [strlwr $nick] && ![isop $chanuser $chan] && ![isvoice $chanuser $chan]} {
incr bancount
set ipmask [lindex [split [maskhost $chanuser![getchanhost $chanuser $chan]] "@"] 1]
set userm [lindex [split [getchanhost $chanuser $chan] "@"] 0]
set banmask *!*$userm@$ipmask
set x "X"
putmsg $x "ban $chan $banmask ($nick) $reason"
newchanban $chan $banmask $nick $reason
if {[botisop $chan]} {
putserv "MODE $chan +b $banmask"
putserv "KICK $chan $chanuser :$nick: $reason"
}
}
}
if {$bancount == 0} {
puthelp "NOTICE $nick :Sorry but no one matches this mask."
}
} {
if {![onchan $who $chan]} {
puthelp "NOTICE $nick :Sorry, but I don't see $who in $chan."
return 0
}
if {[strlwr $who] == [strlwr $botnick]} {
puthelp "NOTICE $nick :Yeah right, like I'm going to let you ban ME!"
return 0
}
if {[nick2hand $who $chan] != "*"} {
if {$hand != [nick2hand $who $chan]} {
if {[matchattr [nick2hand $who $chan] o|o $chan] && ![matchattr $hand o|o $chan]} {
puthelp "NOTICE $nick :Sorry, you must be an operator to ban an operator."
return 0
}
if {([matchattr [nick2hand $who $chan] m|m $chan] || [matchattr [nick2hand $who $chan] b]) && ![matchattr $hand m|m $chan]} {
puthelp "NOTICE $nick :Sorry, you must be a master to ban a master or a bot."
return 0
}
}
}
set ipmask [lindex [split [maskhost $who![getchanhost $who $chan]] "@"] 1]
set userm [lindex [split [getchanhost $who $chan] "@"] 0]
set banmask *!*@$ipmask
set x "X"
putmsg $x "ban $chan $banmask ($nick) :$reason"
if {[botisop $chan]} {
if {[isop $who $chan]} {pushmode $chan -o $who}
putserv "MODE $chan +b $banmask"
putserv "KICK $chan $who :$reason"
}
switch $ti {
""
{
newchanban $chan $banmask $nick $reason
puthelp "NOTICE $nick :New mask added: $banmask"
}
0
{
newchanban $chan $banmask $nick $reason $ti
puthelp "NOTICE $nick :New mask added permanently: $banmask"
}
default
{
newchanban $chan $banmask $nick $reason $ti
puthelp "NOTICE $nick :New mask added for $ti minutes: $banmask"
}
}
}
return 0
} |
|
|
| Back to top |
|
 |
Nor7on Op

Joined: 03 Mar 2007 Posts: 185 Location: Spain - Barcelona
|
Posted: Thu Aug 21, 2008 12:52 pm Post subject: |
|
|
Hi.
u should read the config lol.
| Code: | # BAN TYPE : HOW DO YOU WANT TO BAN THE USER ? DEFAULT 1
# 0 - *!*user@*.domain
# 1 - *!*@host.domain
set lol(bantype) 1
|
if not, try it.
| Code: | proc pub_lol_ban {nick host hand chan arg} {
set arg [charfilter $arg]
global lol botnick
if {![check $hand $nick $host]} {
if {$lol(silent) == 1 || [checksilent $hand]} {return 0}
puthelp "NOTICE $nick :You need to be identified to use this function. Type .identhelp in the partyline for more info. : \002/msg $botnick id <password>\002 or \002/msg $botnick silent <password>\002 to no more receive this warning."
return 0
}
if {[llength $arg] < 1} {
puthelp "NOTICE $nick :\002Usage:\002 [string trim $lol(cmdchar)]ban <nick|mask> \[time\] \[reason\]"
return 0
}
set who [lindex $arg 0]
set ti [lindex $arg 1]
if {[number $ti]} {
set reason [lrange $arg 2 end]
} {
set ti ""
set reason [lrange $arg 1 end]
}
if {$reason == ""} {set reason "requested by $hand"}
if {[string first "*" $who] != -1 || [string first "?" $who] != -1} {
if {$reason == "requested by $hand"} {set reason "MaskBan: $who"}
set who [strlwr $who]
set bancount 0
set flags "-$lol(no_ban_flags)&-$lol(no_ban_flags)"
if {$lol(no_ban_flags) == ""} {
set list [strlwr [chanlist $chan]]
} {
set list [strlwr [chanlist $chan $flags]]
}
foreach chanuser $list {
set banmask ""
if {[string match [strlwr $who] [strlwr $chanuser]] && $chanuser != [strlwr $botnick] && $chanuser != [strlwr $nick] && ![isop $chanuser $chan] && ![isvoice $chanuser $chan]} {
incr bancount
set ipmask [lindex [split [maskhost $chanuser![getchanhost $chanuser $chan]] "@"] 1]
set userm [lindex [split [getchanhost $chanuser $chan] "@"] 0]
set banmask *!*@[lindex [split [getchanhost $chanuser $chan] @] 1]
set x "X"
putmsg $x "ban $chan $banmask ($nick) $reason"
newchanban $chan $banmask $nick $reason
if {[botisop $chan]} {
putserv "MODE $chan +b $banmask"
putserv "KICK $chan $chanuser :$nick: $reason"
}
}
}
if {$bancount == 0} {
puthelp "NOTICE $nick :Sorry but no one matches this mask."
}
} {
if {![onchan $who $chan]} {
puthelp "NOTICE $nick :Sorry, but I don't see $who in $chan."
return 0
}
if {[strlwr $who] == [strlwr $botnick]} {
puthelp "NOTICE $nick :Yeah right, like I'm going to let you ban ME!"
return 0
}
if {[nick2hand $who $chan] != "*"} {
if {$hand != [nick2hand $who $chan]} {
if {[matchattr [nick2hand $who $chan] o|o $chan] && ![matchattr $hand o|o $chan]} {
puthelp "NOTICE $nick :Sorry, you must be an operator to ban an operator."
return 0
}
if {([matchattr [nick2hand $who $chan] m|m $chan] || [matchattr [nick2hand $who $chan] b]) && ![matchattr $hand m|m $chan]} {
puthelp "NOTICE $nick :Sorry, you must be a master to ban a master or a bot."
return 0
}
}
}
set ipmask [lindex [split [maskhost $who![getchanhost $who $chan]] "@"] 1]
set userm [lindex [split [getchanhost $who $chan] "@"] 0]
set banmask *!*@[lindex [split [getchanhost $who $chan] @] 1]
set x "X"
putmsg $x "ban $chan $banmask ($nick) :$reason"
if {[botisop $chan]} {
if {[isop $who $chan]} {pushmode $chan -o $who}
putserv "MODE $chan +b $banmask"
putserv "KICK $chan $who :$reason"
}
switch $ti {
""
{
newchanban $chan $banmask $nick $reason
puthelp "NOTICE $nick :New mask added: $banmask"
}
0
{
newchanban $chan $banmask $nick $reason $ti
puthelp "NOTICE $nick :New mask added permanently: $banmask"
}
default
{
newchanban $chan $banmask $nick $reason $ti
puthelp "NOTICE $nick :New mask added for $ti minutes: $banmask"
}
}
}
return 0
} |
|
|
| Back to top |
|
 |
Danik Halfop
Joined: 15 Jun 2008 Posts: 49 Location: Moldova
|
Posted: Thu Aug 21, 2008 1:32 pm Post subject: |
|
|
Thx .. it works now
| Code: | | set banmask *!*@[lindex [split [getchanhost $who $chan] @] 1] |
THX Nor7on |
|
| Back to top |
|
 |
|