51 |
variable Timers |
variable Timers |
52 |
variable TimerIDCount 1 |
variable TimerIDCount 1 |
53 |
# Export all the commands that should be available to 3rd-party scripters: |
# Export all the commands that should be available to 3rd-party scripters: |
54 |
namespace export bind unbind binds timer utimer killtimer killutimer timers utimers |
namespace export bind unbind binds timer utimer killtimer killutimer timers utimers maskhost |
55 |
} |
} |
56 |
|
|
57 |
|
|
189 |
{default} { |
{default} { |
190 |
# FixMe: This is really simple right now, it needs fixing to allow &'s though. |
# FixMe: This is really simple right now, it needs fixing to allow &'s though. |
191 |
# I think it'll require a foreach [split $flags1 {}] { } |
# I think it'll require a foreach [split $flags1 {}] { } |
192 |
regexp [join [split $flags1 {}] {|}] $flags2 |
# regexp [join [split $flags1 {}] {|}] $flags2 |
193 |
|
foreach x [split $flags1 {}] { |
194 |
|
if {[string match "*$x*" $flags2]} { set found 1 } |
195 |
|
} |
196 |
|
return [info exists found] |
197 |
} |
} |
198 |
} |
} |
199 |
} |
} |
400 |
# This proc is from Papillon@EFNet |
# This proc is from Papillon@EFNet |
401 |
# (Papillon) -> I've enabeled this to apply to ipv6 hosts aswell, it does not mask them yet, but I'll look into it |
# (Papillon) -> I've enabeled this to apply to ipv6 hosts aswell, it does not mask them yet, but I'll look into it |
402 |
# Note: This is untested and unmodified. |
# Note: This is untested and unmodified. |
403 |
proc maskhost {x} { |
proc ::tcldrop::maskhost {x} { |
404 |
if {[string match "*\**" [lindex [split $x @] 1]]} { return $x } |
if {[string match "*\**" [lindex [split $x @] 1]]} { return $x } |
405 |
if {![regexp ".*@.*" $x]} { set x "*@${x}" } |
if {![regexp ".*@.*" $x]} { set x "*@${x}" } |
406 |
if {[set mask1 [lindex [split $x @] 0]] != {*}} { |
if {[set mask1 [lindex [split $x @] 0]] != {*}} { |
407 |
regsub "\~" $mask1 "" mask1 |
set mask1 [string trimleft $mask1 {~*!}] |
|
regsub {\*} $mask1 "" mask1 |
|
|
regsub "\!" $mask1 "" mask1 |
|
408 |
} |
} |
409 |
if {[regexp {@([0-9]+\.){3}[0-9]+} $x mask2]} { |
if {[regexp {@([0-9]+\.){3}[0-9]+} $x mask2]} { |
410 |
set mask2 [join "[lrange [split $mask2 \.] 0 end-1] *" \.] |
set mask2 [join "[lrange [split $mask2 \.] 0 end-1] *" \.] |
483 |
exit 0 |
exit 0 |
484 |
} |
} |
485 |
|
|
486 |
|
|
487 |
# Rehash, just like in Eggdrop, it (re)loads the config. |
# Rehash, just like in Eggdrop, it (re)loads the config. |
488 |
proc rehash {{type {}}} { |
proc rehash {{type {}}} { |
489 |
callevent prerehash |
callevent prerehash |