Op Notice Window

By enexif on Jul 06, 2005

This is basically an opnotice window.
Wheny ou use /onotice and such it 'll bring up a chat like window where you it recieves and sends onotices... Popups (channel, status, and menubar) have the enable / disable command of it.

; Zach's oNotice Window
; Version 1.1
; 
; Version 1.0: Inital Release
; Version 1.1: Added Hilighting

alias winCreate {
  if (!$2) { return }
  window -ankeSl13 $1 
  updateOps $2 $1
}
alias updateOps {
  if (!$2) { return }
  if (!$window($2)) { .timer $+ $2 off } 

  if ($window($2)) { 
    .clear -l $2
    titlebar $2 [[ $+ $nick($1,0,o) $+ ]] @Ops

    var %i = $nick($1,0,o)
    while (%i) {
      .aline -l $2 @ $+ $nick($1,%i,o)
      dec %i
    }
  }
}
#zonotice on
on *:PART:#: {
  var %WinID = $+(@Ops,-,$chan)
  .timer 1 1 updateOps $chan %winID     
}
on *:QUIT: {
  var %WinID = $+(@Ops,-,$chan)
  .timer 1 1 updateOps $chan %winID     
}
on *:KICK:# {
  var %WinID = $+(@Ops,-,$chan)
  .timer 1 1 updateOps $chan %winID     
}
on *:OP:# {
  var %WinID = $+(@Ops,-,$chan)
  .timer 1 1 updateOps $chan %winID     
}
on *:DEOP:# { 
  var %WinID = $+(@Ops,-,$chan)
  .timer 1 1 updateOps $chan %winID     
}
on ^*:NOTICE:*:# {
  var %WinID = $+(@Ops,-,$chan)
  if ($left($target,1) == @) {
    if (!$window(%WinID)) { winCreate %WinID $chan }
    .aline %winID $timestamp < $+ $nick $+ > $$1- 
    window -g1 %winID
    haltdef
  }
}
on ^*:ACTION:*:# {
  var %WinID = $+(@Ops,-,$chan)
  if ($left($target,1) == @) {
    if (!$window(%WinID)) { winCreate %WinID $chan }
    window -g1 %winID
    .aline %winID $timestamp * $nick $$1-
    haltdef
  }
}

on *:CLOSE:@: {
  if (@Ops- isin $target) {
    .timer $+ $target off
  }
}

on *:INPUT:@Ops-*: { 
  if ($1 == /me) { 
    if ($me isop $gettok($target,2-,$asc(-))) { 
      .describe @ $+ $gettok($target,2-,$asc(-)) $$1- 
      .aline $target $timestamp * $me $$2-
      haltdef
      halt
    }
  }

  if ($left($1,1) != / || ($left($1,1) == / && $ctrlenter)) { 
    if ($me isop $gettok($target,2-,$asc(-))) { 
      .notice @ $+ $gettok($target,2-,$asc(-)) $$1- 
      .aline $target $timestamp < $+ $me $+ > $$1-
      haltdef
      halt
    }
  }
}
#znotice end

menu status,channel,menubar {
  $iif($group(#zonotice).status == on,$style(1),$style(0)) $+ Use Opnotice Window: $iif($group(#zonotice).status == on,.disable,.enable) #zonotice
}

menu @Ops-* {
  dclick: if ($mouse.lb == $true) { query $remove($sline($active,1),@) } 
  $iif(!$mouse.lb, &Clear): clear $active
  -
  $iif(!$mouse.lb, &Close): window -c $active
}

alias onotice { 
  var %WinID = $+(@Ops,-,$active)
  if ($group(#zonotice).status == on) { 
    if (!$window(%WinID)) { winCreate %WinID $chan }
    .notice @ $+ $gettok(%winID,2-,$asc(-)) $$1- 
    .aline %winID $timestamp < $+ $me $+ > $$1-
    halt
  }
  else {
    onotice $1-
  }
}

Comments

Sign in to comment.
ch1zra   -  Jul 12, 2005

heh.. just one thing. I would do it this way :

on ^*:NOTICE:*:# {
  var %WinID = $+(@Ops,-,$chan)
  if ($left($target,1) == @) {
    window -g1 %WinID
    if (!$window(%WinID)) { winCreate %WinID $chan }
    .aline %winID $timestamp < $+ $nick $+ > $$1-
    haltdef
  }
}
on ^*:text:*:# {
  var %WinID = $+(@Ops,-,$chan)
  if ($left($target,1) == @) {
    window -g1 %WinID
    if (!$window(%WinID)) { winCreate %WinID $chan }
    .aline %winID $timestamp * $nick $$1-
    haltdef
  }
}

cause I don\'t quite get the meaning of the On action, and there\'s also no highlighting on new msg. juct my 2 :]

 Respond  
ch1zra   -  Jul 12, 2005

I like this :)
had few similar things before, but none of them worked nice... this seems to be ok. good work :)

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.