;IRcap8 8a729c83faba31c56de24ce95d9d6f15
;Ventana emergente de avisos 1.0

#cartel.notice off
on 1:NOTICE:*:*: if ($ulevel != 69) && ($1 != DCC) { if (%spam.usa == on) && ($nospam($1-)) return | $cartelito($nick notice:,$strip($1-)) }
#cartel.notice end

#cartel.notify on
on 1:NOTIFY: $cartelito($nick,$mg(notify) ( $+ $nnet $+ ))
#cartel.notify end

#cartel.unotify on
on 1:UNOTIFY: $cartelito($nick,$mg(unotify) ( $+ $nnet $+ ))
#cartel.unotify end

#cartel.con on
on 1:CONNECT: $cartelito($mg(car-con),$server)
#cartel.con end

#cartel.descon on
on 1:DISCONNECT: $cartelito($mg(car-dcon),$server)
#cartel.descon end

#cartel.query off
on 1:open:?:*: $cartelito($nick $m(46) $+ :,$strip($1-))
ctcp 1:DCC chat: $cartelito($nick,$m(48))
#cartel.query end

#cartel.cuac off
on 1:signal:cuac: $cartelito($mg(car-cuac,$1),$2 $+ : $3-)
#cartel.cuac end

#cartel.op off
on 1:OP:#: if $opnick == $me { $cartelito(OP,$mg(op,$nick,$chan)) }
#cartel.op end

#cartel.deop off
on 1:DEOP:#: if $opnick == $me { $cartelito(DeOP,$mg(deop,$nick,$chan)) }
#cartel.deop end

#cartel.ban off
on 1:BAN:#: if ($banmask iswm $address($me,5)) { $cartelito(BAN,$mg(ban,$nick,$chan,$banmask)) }
#cartel.ban end

#cartel.kick off
on 1:KICK:#:  if $knick == $me { $cartelito(KICK,$mg(kick,$nick,$chan,$1-)) }
#cartel.kick end

#cartel.invite off
on 1:INVITE:#: $cartelito($nick invite:,$chan)
#cartel.invite end

#cartel.send off
ctcp 1:DCC send: $cartelito($mg(car-send,$nick),$nopath($filename))
#cartel.send end

#cartel.ctcp off
ctcp 1:*: if ($1 != DCC) $cartelito(CTCP $nick $+ :,$1-)
#cartel.ctcp end

#cartel.filercv off
on 1:FILERCVD:*: $cartelito($mg(car-rcvd,$nick),$nopath($filename))
#cartel.filercv end

#cartel.filesent off
on 1:FILESENT:*: $cartelito($mg(car-sent,$nick),$nopath($filename))
#cartel.filesent end

#cartel.flood off
on 1:signal:flood: .timer 1 1 cartelito $mg(car-flod) $2 ( $+ $3 $+ )
#cartel.flood end

on 1:START: $cartelito(IRcap %ircapv,$mg(arrqe,%arranques,%farranque)) | if (!%cartel.m) { %cartel.m = 5- 2º pl. & Sistray }


alias CARTELITO {
  if ($away) && (%cartel.aw == on) return
  var %a = $left(%cartel.m,1)
  if (%a == 2) goto muestra
  if (%a isin 4 5) && ($appstate == tray)  goto muestra
  if (!$appactive) && (%a == 3) && ($appstate != tray) goto muestra
  if (!$appactive) && (%a isin 3 5) goto muestra
  return

  :muestra
  var %x = $calc($window(-1).w - $window(@tttip).w - 10)
  if ($1) {
    %cartel = $window(-1).h
    var %t1 = $wrap($replace($1,_,$chr(32)),tahoma,11,300,1) , %t2 = $wrap($strip($2-),tahoma,11,300,1) | if $wrap($strip($2-),tahoma,11,300,0) > 1 { %t2 = %t2 ... }
    var %an = $width(%t1,tahoma,11,1), %an2 = $width(%t2,tahoma,11) | if %an2 > %an { %an = %an2 } | inc %an 20
    .timerTTTIP off | window -c @tttip |  window -pkdoihn +dL @tttip %x %cartel %an 50
    drawrect -rnf @tttip $rgb(80,105,233) 1 0 0 %an 50 | drawrect -rnfd @tttip $rgb(255,216,77) 1 1 1 $calc(%an -2) 48 6 6
    drawtext -rno @tttip $rgb(248,248,55) tahoma 11 $calc((%an / 2) - ($width(%t1,tahoma,11,1) / 2) + 1) 11 %t1
    drawtext -rno @tttip $rgb(0,0,0) tahoma 11 $calc((%an / 2) - ($width(%t1,tahoma,11,1) / 2)) 10 %t1
    drawtext -rn @tttip $rgb(248,248,55) tahoma 11 $calc((%an / 2) - ($width(%t2,tahoma,11) / 2) + 1) 27 %t2
    drawtext -rn @tttip 0 tahoma 11 $calc((%an / 2) - ($width(%t2,tahoma,11) / 2)) 26 %t2
    %cartelfunde = 10  | .timerTTTIP off
    drawline @tttip | window -o @tttip %x %cartel | .timerCARTELI -mi 1 100 .timerTTTIP -mio 100 0 cartelito
    return 
  }
  if (%cartel < $calc($window(-1).h - 80)) { unset %cartel | .timerTTTIP -oi 1 2 tttipfunde ini | return }
  dec %cartel 4 | window @tttip %x %cartel | setlayer %cartelfunde @tttip | inc %cartelfunde 12
}

;EOF
