Project

General

Profile

[Script] Clock OSD v0.1

Added by Mr. BS over 9 years ago

A simple draggable clock over the screen. The clock will remains visible while AdiIRC has focus. To toggle the clock press F3 key, double click closes it. Position are saved to be restored on next start.

Screenshot

Script

; http://dev.adiirc.com/boards/5/topics/273
; Clock OS
; v0.1 by pereba

; press f3 to toggle the clock

alias f3 {
  if ($window(@clock)) { close.clock | return }
  clock
}

on *:START: $iif(%clockAuto,clock)
on *:UNLOAD: unset %clock*
on *:APPACTIVE: { $iif($window(@clock), $iif($appactive, window -a @clock, window -h @clock)) }

alias clock { myclock | $iif(%clockTrans,clockTrans.set $v1) | showmirc -s | .timerClock -m 0 1000 myclock }
alias myclock {
  $iif(!$window(@clock),window - $+ $iif(!%clockPos2,C) $+ fpdok0w0 +dL @clock $iif(%clockPos2, $gettok($v1,1,32) $gettok($v1,2,32), 0 0) 124 35)
  clear @clock | drawtext -on @clock 04 Arial 30 1 0 $time | drawpic @clock
} 
menu @clock {
  Transparency
  .$submenu($clockTrans.menu($1))
  -
  $iif(%clockAuto,$style(1)) Load on startup:$iif(%clockAuto,unset %clockAuto,set %clockAuto 1) | showmirc -s
  -
  Close:close.clock
}

alias clockTrans.menu {
  if ($1 == begin) return $iif(%clockTrans == 255, $style(1)) 0% (Opaque):clockTrans.set 255
  if ($1 == end) return $iif(%clockTrans == 1, $style(1)) 100% (invisible):clockTrans.set 1
  while ($1 <= 9) {
    return $iif(%clockTrans == $calc($+(.,$calc(10- $1)) *255), $style(1)) $calc($1 *10) $+ % :clockTrans.set $calc($+(.,$calc(10- $1)) *255)
  }
}

alias -l clockTrans.set {
  setlayer $1 @clock | set %clockTrans $1 | showmirc -s
}

alias -l close.clock { .timerClock off | window -c @clock }

; drag and drop window snippet by Sephiroth @ http://sephiroth.bounceme.net/board/viewtopic.php?t=104
menu @clock {
  dclick:close.clock
  sclick:!set -e %clockPos $mouse.x $mouse.y
  uclick:!set %clockPos2 $$window(@clock).x $$window(@clock).y
  mouse:{
    if (%clockPos && $mouse.key & 1) {
      !window $active $&
        $calc($mouse.dx - $gettok(%clockPos,1,32)) $&
        $calc($mouse.dy - $gettok(%clockPos,2,32)) $&
        $window($active).w $window($active).h
    }
  }
}

mIRC compatible.