Project

General

Profile

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

Mr. BS, 01/23/2017 04:33 PM

 
; 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
}
}
(7-7/11)