alias lights {
  .cline $rand(2,16) $rand($nick,$nick) $rand(0,30)
}

#xmas off
on 1:input:*: {
  if ($active == Status Window) goto end
  if (/ == $left($1,1)) goto end 
  if (! == $left($1,1)) goto end  
  if (@ == $left($1,1)) goto end  
  else say $xmas($1-)
  halt
  :end
}
#xmas end

alias xmas {
  if ($1 == $null) { halt }
  unset %xmas.string
  unset %xmas.string2
  set %string.to.xmas $1-
  set %total.letters.to.xmas $len($1-)
  set %letter.to.xmas 0
  set %last.xmas.color green
  :xmas.loop
  inc %letter.to.xmas
  if ( [ $mid($1-,%letter.to.xmas,1) ] == $chr(32)) {
    if (%letter.to.xmas > 126) { set %xmas.string2 %xmas.string2 $+ chr(32) } |  else { set %xmas.string %xmas.string $+ chr(32) }
  }
  else {
    if (%last.xmas.color != red) {
      if (%letter.to.xmas > 126) { set %xmas.string2 %xmas.string2 $+  $+ %color.alterné.1 $+  $+ $mid($1-,%letter.to.xmas,1) } | else { set %xmas.string %xmas.string $+  $+ %color.alterné.1 $+  $+ $mid($1-,%letter.to.xmas,1) }
      set %last.xmas.color red
    }
    else   {
      if (%letter.to.xmas > 126) { set %xmas.string2 %xmas.string2 $+  $+ %color.alterné.2 $+  $+ $mid($1-,%letter.to.xmas,1) } | else { set %xmas.string %xmas.string $+  $+ %color.alterné.2 $+  $+ $mid($1-,%letter.to.xmas,1) }
      set %last.xmas.color green
    }
  }
  if (%letter.to.xmas != %total.letters.to.xmas) goto xmas.loop
  :end
  set %xmas.string $replace(%xmas.string,chr(32), $chr(32))
  if (%letter.to.xmas > 126) set %xmas.string2 $replace(%xmas.string2,chr(32), $chr(32))
  return %xmas.string %xmas.string2
}
