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.

getting error in banmask and Mode Unban delayed

Help for those learning Tcl or writing their own scripts.
Post Reply
s
sk-4
Halfop
Posts: 51
Joined: Sat Oct 06, 2007 6:37 am

getting error in banmask and Mode Unban delayed

Post by sk-4 »

hi guys iam new to this section i have this script i took from one of the webside ,i cant remeber where it from..the error i getting from this script is it giving error in banmask ex.Bot sets mode: +b **????@*..i would like it to ban like this *!*@85.96.72.59 or sk3!*@*

2.and the +MR taking time to unban the mode and soemtime it not unbanning the mode if bot got excess flood

hope somebody can help to repair the script,cause iam totaly 0% in tcl knowledge :-D

##################################################################################
# Advancec Join Food Protection Tools #
# #
# #
##################################################################################
# For 1.6.10 and above. #
# Consecutive Join Flood #
# Consecutive Alphanumeric Nick Flood #
# Consecutive Unresolved Host Flood #
# Consecutive Identd Length Flood #
# Fast Join Parts #
# Bad Nick/Identd #
##################################################################################
# Enable Join Flood Protection, In your partyline #
# .chanset #channel +/-joinpro #
# Enable Bad Nick/Identd Protection, In your partyline #
# .chanset #channel +/-badnickident #
##################################################################################
# Version 2.0 #
# Fixed modelock #
# Added newchanban for filterkicks in consecutive join flood #
##################################################################################

setudef flag joinpro
setudef flag badnickident

# Consecutive Join Flood x(times):y(secs) ----- (Host match)
# Since it does a consecutive check, it's fine if you chk for at least 2 times in 1 sec.
# EXAMPLE: set jf 2:3
set jf 3:4

# Consecutive Alphanumeric Drone Flood x:y
# EXAMPLE: set df 2:3
set df 3:5

# Consecutive Unresolved Host Flood x:y
# EXAMPLE: set uh 3:2
set uh 3:5

# Consecutive Identd Length Flood x:y
# EXAMPLE: set idf 2:3
set idf 3:4

# Set Fast Join Parts in number of seconds here.
# EXAMPLE: set fjp 2
set fjp 5

# Set Banmsk here
# 0: *!user@full.host.net
# 1: *!*user@full.host.net
# 2: *!*@full.host.net
# 3: *!*user@*.host.net
# 4: *!*@*.host.net
# 5: nick!user@full.host.net
# 6: nick!*user@full.host.net
# 7: nick!*@full.host.net
# 8: nick!*user@*.host.net
# 9: nick!*@*.host.net
# EXAMPLE: set jfb 2
set jfb 2

# Current channel Mode Lock is +MR, Unset Mode Lock in number of mins here
# EXAMPLE: set unmode 2
set unmode 1

########################### SET BAD NICK HERE ##########################
set bad_names {
"bitch"
"blowjob"
"cock"
"[censored]"
"dick"
"[censored]"
"f?u?c?k"
"panties"
"penis"
"pussy"
"slut"
"whore"
"b0obs"
"bo0bs"
"boobs"
}

# Set unban time in "seconds" for bad nick/ident here. (300sec = 5mins)
# EXAMPLE: set unbani 300
set unbani 120

########################### STOP EDITING #########################
bind join -|- * joinflood
proc joinflood {n u h c} {
global jfchans jf ipf cipf df drf cdrf uh urhf curhf idf idlf cidf jfb unmode bad_names unbani floodmr
set c [string tolower $c]
if {[lsearch -exact [channel info $c] +joinpro] == -1} {return 0}
if {(![botisop $c]) || ([matchattr $h of|of])} {return 0}
if {![info exists ipf($c)]} { set ipf($c) "" }
if {![info exists floodmr($c)]} { set floodmr($c) 0 }
set ip [lindex [split $u @] 1]
if {$ip == $ipf($c)} {
incr cipf($c)
utimer [lindex [split $jf :] 1] [list cipf:dec $c]
if {$cipf($c) >= [lindex [split $jf :] 0]} {
set jban [hostmask $n!$u $jfb]
if {$floodmr($c) == "0"} {
putquick "MODE $c +MRb-k $jban 4Consecutive.Join.Flood" -next
set floodmr($c) 1
timer $unmode [list unlock $c]
newchanban $c $jban "" "4Join 12flood 3Detected 4• 14HEY..Listen Flooder,There Is Two Ways,Stay In Peace Or Leave Us In Peace " 5
} else {
newchanban $c $jban "" "4Mass Join 12flood 3Detected 4• 14I Know U Like To Flood In the Channel,and I Like To Kick Flooder Like U Out From the Channel :-D " 5
}
return 0
}
} else {
set ipf($c) $ip
set cipf($c) 1
utimer [lindex [split $jf :] 1] [list cipf:dec $c]
}
set dr [regexp -nocase {^[a-z]{3,}[0-9]{1,}$} $n]
if {$dr == 0 || [string match "Guest?????" "$n"]} {
set cdrf($c) 0
} else {
if {![info exists drf($c)]} { set drf($c) "" }
if {$dr == $drf($c)} {
incr cdrf($c)
utimer [lindex [split $df :] 1] [list cdrf:dec $c]
if {$cdrf($c) >= [lindex [split $df :] 0]} {
if {$floodmr($c) == "0"} {
putquick "MODE $c +M-k alphanumeric.nick.flood" -next
timer $unmode [list unlock $c]
set floodmr($c) 1
return 0
}
}
} else {
set drf($c) $dr
set cdrf($c) 1
utimer [lindex [split $df :] 1] [list cdrf:dec $c]
}
}
scan $u %\[^@\]@%s ident host
set urh [string match "~*" "$ident"]
if {$urh == 0 || [string match "Guest?????" "$n"]} {
set curhf($c) 0
} else {
if {![info exists urhf($c)]} { set urhf($c) "" }
if {$urh == $urhf($c)} {
incr curhf($c)
utimer [lindex [split $df :] 1] [list curhf:dec $c]
if {$curhf($c) >= [lindex [split $uh :] 0]} {
if {$floodmr($c) == "0"} {
putquick "MODE $c +MR-k Unresolved.host.flood" -next
timer $unmode [list unlock $c]
set floodmr($c) 1
return 0
}
}
} else {
set urhf($c) $urh
set curhf($c) 1
utimer [lindex [split $uh :] 1] [list curhf:dec $c]
}
}
set id [lindex [split $u @] 0]
set idl [string length $id]
if {![info exists idlf($c)]} { set idlf($c) "" }
if {$idl == $idlf($c)} {
incr cidf($c)
utimer [lindex [split $idf :] 1] [list cidf:dec $c]
if {$cidf($c) >= [lindex [split $idf :] 0]} {
regsub -all -- {.} $id ? ident
if {$floodmr($c) == "0"} {
putquick "MODE $c +MRb-k *!$ident@* Consecutive.identd.length.flood" -next
utimer 60 [list unban $c *!$ident@*]
timer $unmode [list unlock $c]
set floodmr($c) 1
return 0
} else {
putquick "MODE $c +Mb *!$ident@*" -next
return 0
}
}
} else {
set idlf($c) $idl
set cidf($c) 1
utimer [lindex [split $idf :] 1] [list cidf:dec $c]
}
if {[lsearch -exact [channel info $c] +badnickident] == -1} {return 0}
foreach bn $bad_names {
if {[string match -nocase "*$bn*" "$n"]} {
putquick "MODE $c +b *$bn*!*@*" -next
putquick "KICK $c $n : 4Offensive 12Ident 3Detected 4•14 According to my Database this ident is Bad kindly Change it and Connect Back to Server "
utimer $unbani [list unban $c *$bn*!*@*]
return 0
}
}
foreach bi $bad_names {
if {[string match -nocase "*$bi*" "$id"]} {
putquick "MODE $c +b *!*$bi*@*" -next
putquick "KICK $c $n : 4Offensive 12Ident 3Detected 4•14 According to my Database Ur ident is Bad kindly Change it and ReConnect Back to Server "
utimer $unbani [list unban $c *!*$bi*@*]
return 0
}
}
}
############ FAST JOIN/PART ##################
bind part - * banpart
proc banpart {n u h c a} {
global fjp jfb
set c [string tolower $c]
if {[lsearch -exact [channel info $c] +joinpro] == -1} {return 0}
if {(![botisop $c]) || ([matchattr $h o]) || ([matchattr $h f])} {return 0}
if {[getchanjoin $n $c] >= [expr {[clock seconds] -$fjp}]} {
set ban [hostmask $n!$u $jfb]
putquick "MODE $c +b $ban" -next
}
}
########### PROC hostmask ################
proc hostmask [list name
  • ] {
    if {[scan $name {%[^!]!%[^@]@%s} nick user host]!=3} {
    error "Usage: hostmask <nick!user@host> \[type\]"
    }
    if [string match {[3489]} $type] {
    if [string match {*[0-9]} $host] {
    set host [join [lrange [split $host .] 0 2] .].*
    } elseif {[string match *.*.* $host]} {
    set host *.[join [lrange [split $host .] end-1 end] .]
    }
    }
    if [string match {[1368]} $type] {
    set user *[string trimleft $user ~]
    } elseif {[string match {[2479]} $type]} {
    set user *
    }
    if [string match {[01234]} $type] {
    set nick *
    }
    set name $nick!$user@$host
    }
    ########## PROC *:DEC ###############
    proc cipf:dec {c} {
    global cipf
    incr cipf($c) -1
    if {$cipf($c) < 0} {set cipf($c) 0}
    return 0
    }
    proc cdrf:dec {c} {
    global cdrf
    incr cdrf($c) -1
    if {$cdrf($c) < 0} {set cdrf($c) 0}
    return 0
    }
    proc curhf:dec {c} {
    global curhf
    incr curhf($c) -1
    if {$curhf($c) < 0} {set curhf($c) 0}
    return 0
    }
    proc cidf:dec {c} {
    global cidf
    incr cidf($c) -1
    if {$cidf($c) < 0} {set cidf($c) 0}
    return 0
    }
    ########## PROC UNBAN #############
    proc unban {c m} {
    putserv "MODE $c -b $m"
    }
    ########## PROC UNLOCK ##############
    proc unlock {chan} {
    global floodmr
    set cmode [getchanmode $chan]
    set floodmr($chan) 0
    if {[string match "*R*M*" "$cmode"]} {putserv "MODE $chan -MR" ; return 0}
    if {[string match "*M*" "$cmode"]} {putserv "MODE $chan -M" ; return 0}
    if {[string match "*R*" "$cmode"]} {putserv "MODE $chan -R" ; return 0}
    return 0
    }
    ##################### REHASH/RESTART ########################
    foreach t [utimers] {
    if {[lindex $t 1] == "cipf:dec"} {killutimer [lindex $t end]}
    if {[lindex $t 1] == "cdrf:dec"} {killutimer [lindex $t end]}
    if {[lindex $t 1] == "curhf:dec"} {killutimer [lindex $t end]}
    if {[lindex $t 1] == "cidf:dec"} {killutimer [lindex $t end]}
    if {[lindex $t 1] == "unban"} {killutimer [lindex $t end]}
    }
    foreach t [timers] {
    if {[lindex $t 1] == "unlock"} {killtimer [lindex $t end]}
    }
    set chans [channels]
    set chans [split [string tolower $chans]]
    foreach c $chans {
    set cipf($c) 0
    set ipf($c) ""

    set drf($c) ""
    set cdrf($c) 0

    set urhf($c) ""
    set curhf($c) 0

    set idlf($c) ""
    set cidf($c) 0

    set floodmr($c) 0
    }


    ##################################
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

Posting code within tags makes it easier to read; so please fix.

Secondly, if you bothered to read you'd see what to do to select a hostmask:
# Set Banmsk here
# 0: *!user@full.host.net
# 1: *!*user@full.host.net
# 2: *!*@full.host.net
# 3: *!*user@*.host.net
# 4: *!*@*.host.net
# 5: nick!user@full.host.net
# 6: nick!*user@full.host.net
# 7: nick!*@full.host.net
# 8: nick!*user@*.host.net
# 9: nick!*@*.host.net
# EXAMPLE: set jfb 2
set jfb 2
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
s
sk-4
Halfop
Posts: 51
Joined: Sat Oct 06, 2007 6:37 am

Post by sk-4 »

i tried to use the banmask but it showing ban in format ???
*!*??????@*

it show only for ident ban

putquick "MODE $c +MRb-k *!$ident@* Consecutive.identd.length.flood" -nex

can it be changed to +b *!*nick@* rather then using +b
*!*????@*
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Fix the title of your topic to the script's name. This belongs into the Script releases & support forum.
Post Reply