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

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

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

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

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

    
15
; Global timeout
16
alias -l timeout {
17
  return 120
18
}
19

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

    
23
alias F3 {
24
  hidle -u
25
}
26

    
27
alias hidle {
28
  scon -a dohidle $1
29
}
30

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

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

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

    
43
      if (%widle != 0) dec %hidle_ $+ %wid
44
      
45
      if (u isin $1) {
46
        window -w3 %wname
47
        set -e %hidle_ $+ %wid $timeout()
48
      }
49
      if (!%wcolor) && (!%widle) {
50
        window -w0 %wname
51
        set -e %hidle_ $+ %wid $timeout()
52
      }
53
      
54
    }
55
    
56
    dec %w
57
  }
58
}
59

    
60
; Unhide on focus
61
on *:ACTIVE:*: {
62
  var %lwid = $lactivewid
63
  
64
  if ($window(@ $+ %lwid).type isin channel querry) && (%lwid != $wid) set -e %hidle_ $+ %lwid 120  
65
  if (!$window($active).tbstate) && ($window($active).type isin channel querry) window -w3 $active
66
  if ($window($active).type == status) && (%lwid != $wid) .timer -m 1 1 dohidle -u
67
  
68
}
69

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

    
76
menu menubar {
77
  -
78
  Idle Windows
79
  .Hide no new message windows: hidle
80
  .Force unhide all: hidle -u
81
  .-
82
  .Auto hide control $chr(9) $iif($timer(Hidle),On,Off):toggle
83
}
84

    
85
alias -l toggle {
86
  if ($timer(hidle)) {
87
    scon -a hidle -u
88
    .timerhidle off
89
  }
90
  else {
91
    .timerhidle 0 1 hidle
92
  }
93
}
(7-7/11)