Project

General

Profile

[script] Hide all idle channels and querys (no new message color) v0.4

Added by Mr. Pereba over 1 year ago

Changelog

  • v0.4
    - Now each window has its own timeout based on global one!
    - When Status Window get focus, all windows in this network are unhiden, turning easy to return to some previous channel.
    - Minor fixes and overall improvements (liar, just more code hard to understand).
  • v0.3.1
    - Increased default timeout to 120 seconds.
    - Added hotkey F3 to force unhide all windows.
    - Some typo and minor code fixes.
  • v0.3
    - Changed /window -h parameter to -wN to help avoid stuck windows, a known .Net mdi bug.
    - Added event On Active to make window visible in *bars again, example if you send /join #channel.
  • v0.2
    - Fixed some bugs, like hiding active window when called by a timer.
    - Added menu to toggle auto mode.
    - Moved menu from channel to menubar.
    - Changed manual unhide windows parameter to -u to be more compliant to standard commands flags.
  • v0.1.2
    - Now it check if window is hidden prior to restore to avoid scrollbar flickering.
  • v0.1.1
    - Exclude windows with unread highlights.
    - Added channel menu for a convenient toggle.
  • v0.1
    - Initial release

Script

; http://dev.adiirc.com/boards/5/topics/475
; v0.4 by pereba

; Hide all idle channels and querys (no new message color):
;  /hidle

; Force unhide all windows if need:
;  /hidle -u

; Lets hide inactive windows after xx seconds on AdiIRC startup?!
on *:START: {
  .timerhidle 0 1 hidle
}

; Global timeout
alias -l timeout {
  return 120
}

; Restore windows on unloading script
on *:UNLOAD: hidle -u

alias F3 {
  hidle -u
}

alias hidle {
  scon -a dohidle $1
}

alias -l dohidle {
  var %w $window(*,0), %wtype, %wname, %wid, %wcolor, %widle

  while (%w) {
    %wtype = $istok(channel query,$window(*,%w).type,32)
    %wname = $window(*,%w)
    %wid = $window(*,%w).wid
    %wcolor = $istok(message highlight,$window(*,%w).sbcolor,32)
    %widle = $($+(%,hidle_,%wid),2)

    if (%wtype) && ($activewid != %wid) {

      if (%widle != 0) dec %hidle_ $+ %wid

      if (u isin $1) {
        window -w3 %wname
        set -e %hidle_ $+ %wid $timeout()
      }
      if (!%wcolor) && (!%widle) {
        window -w0 %wname
        set -e %hidle_ $+ %wid $timeout()
      }

    }

    dec %w
  }
}

; Unhide on focus
on *:ACTIVE:*: {
  var %lwid = $lactivewid

  if ($window(@ $+ %lwid).type isin channel querry) && (%lwid != $wid) set -e %hidle_ $+ %lwid 120  
  if (!$window($active).tbstate) && ($window($active).type isin channel querry) window -w3 $active
  if ($window($active).type == status) && (%lwid != $wid) .timer -m 1 1 dohidle -u

}

; Unhide on activity
on *:TEXT:*:#,?: {
  var %w = @ $+ $wid
  if (!$window(%w).tbstate) window -w3 %w
}

menu menubar {
  -
  Idle Windows
  .Hide no new message windows: hidle
  .Force unhide all: hidle -u
  .-
  .Auto hide control $chr(9) $iif($timer(Hidle),On,Off):toggle
}

alias -l toggle {
  if ($timer(hidle)) {
    scon -a hidle -u
    .timerhidle off
  }
  else {
    .timerhidle 0 1 hidle
  }
}

I highly recommend to use together to my version of HideWindow script, it is an excellent complementary companion.

mIRC compatible ✔


Replies (4)

RE: [script] Hide all idle channels and querys (no new message color) v0.2 - Added by Mr. Pereba 2 months ago

New release.

  • v0.2
    - Fixed some bugs, like hiding active window when called by a timer.
    - Added menu to toggle auto mode. (still being enabled on startup, prefix On Start event by a semicolon (comment) to disable it)
    - Moved menu from channel to menubar.
    - Changed manual unhide windows parameter to -u to be more compliant to standard commands flags.

RE: [script] Hide all idle channels and querys (no new message color) v0.3 - Added by Mr. Pereba 2 months ago

Rushed a new release.

  • v0.3
    - Changed /window -h parameter to -wN to help avoid stuck windows, a known .Net mdi bug.
    - Added event On Active to make window visible in *bars again, example if you send /join #channel.

What more it need? Unhide windows only on highlight? Buttons for quick toggle? Exclusion list? Be free to post your suggestion, because the current features set is almost enough for me!

RE: [script] Hide all idle channels and querys (no new message color) v0.3.1 - Added by Mr. Pereba 2 months ago

Rushed a new release².

v0.3.1
- Increased default timeout to 120 seconds.
- Added hotkey F3 to force unhide all windows.
- Some typo and minor code fixes.

RE: [script] Hide all idle channels and querys (no new message color) v0.4 - Added by Mr. Pereba 2 months ago

More one release of my new fav script.

  • v0.4
    - Now each window has its own timeout based on global one! No more hiding a channel in "random" intervals. \o/
    - When Status Window get focus, all windows in this network are unhiden, turning easy to return to some previous channel.
    - Minor fixes and overall improvements.
    (1-4/4)