All pastes #29587 Raw Edit

Anonymous

public text v1 · immutable
#29587 ·published 2005-11-20 14:43 UTC
rendered paste body
 if { $gen(dotcnt) == [expr $gen(dotmax) - 1] } { set gen(dotcnt) 0 }
 if { ([regexp -all {\-} $rls-$grp] > 1 || [regexp -all {_} $rls-$grp] > 1) && [string match -nocase $cmd "!addpre"] } { set gen(dots-$gen(dotcnt)) $rls-$grp }
 incr gen(dotcnt)
 if { [regexp -all {\-} $rls-$grp] < 2  && [string match -nocase $cmd "!addpre"] } {
  set i 0
  while { $i < $gen(dotmax) } {
   if { [gen:dotcheck $rls-$grp $gen(dots-$i)] == 0 } {
    putquick "$header Dashes and underscores replaced with dots, should be: $gen(dots-$gen(dotcnt))\002"
    gen:log 0 "\0037ALERT:\0037 $chan : $nick -> $rls-$grp should be $gen(dots-$gen(dotcnt))"
    return 0
   }
   incr i
  }
 }

proc gen:dotcheck {newrls oldrls} {
 global gen
 set split [string last "-" $oldrls]
 set oldrls [string map {"-" "." "_" "."} $oldrls]
 set oldrls [regsub {[\.]{2,}} $oldrls "."]
 set oldrls [string replace $oldrls $split $split "-"]
 if { [string match -nocase $newrls $oldrls] } { return 0 } else { return 1 }
}