Project

General

Profile

[Script] Highlights Window per Network v0.2 » Highlights Window per Network v0.2.ini

Mr. BS, 02/11/2015 11:32 PM

 
1
; http://dev.adiirc.com/boards/5/topics/268
2
; Highlights Window per Network
3
; v0.2 by pereba
4

    
5
on *:START: { get.conf }
6
on *:UNLOAD: { if ($hget(hlw)) hfree hlw }
7
on *:OPTIONS: { get.conf }
8

    
9
;ctrl + 1 shortcut
10
on *:KEYUP:#:49: {
11
  if ($hget(hlw,last.highlight. $+ #) && $mouse.key & 2) { findtext $v1 }
12
}
13

    
14
on *:TEXT:$($m($1-)):#,?:{
15
  if ($istok($hget(hlw,ignores),$nick,166)) { return }
16
  hadd -m hlw last.highlight. $+ $chan $strip($timestamp $nick.formated $1-)
17
  var %w $+(@,$adilang(Highlights),$chr(160),$network)
18
  if (!$window(%w) {
19
    window -vnkq1 %w
20
    echo -c highlight %w $+($cs(Highlights),$sp,$chr(32),$sp,$cs($network))
21
    es %w
22
    echo %w $+($cs2(Window),$sp,$chr(32),$sp,$cs2(Message))
23
    es %w
24
  }
25
  var %h $iif($highlight($1-) == $!me, $eval($v1,2), $v1)
26
  echo $highlight($1-).color -m %w $target $+ $sp $sp $+ $timestamp $nick.formated $&
27
  $replacex($1-, %h, $+($chr(2),%h,$chr(2)))
28
  es %w
29
}
30

    
31
alias -l get.conf { hadd -m hlw nick.conf $readini(config.ini,n,Messages,prefixuser) | $&
32
hadd -m hlw ignores $readini(config.ini,n,Highlight,HighlightExclude) }
33
alias -l m return * $+ $iif($$highlight($iif($1- !isnum,$v1)) == $ $+ me, $me, $v1) $+ *
34
alias -l es echo $1 $chr(160)
35
alias -l sp return $str($chr(160),4)
36
alias -l cs return $+($chr(2),$chr(31),$1-,$chr(2),$chr(31))
37
alias -l cs2 return $+($chr(31),$adilang($1),$chr(31))
38
alias nick.formated {
39
  var %nick $iif($randomcolors & 1, $+($chr(3),$nick(#,$nick).color,$nick,$chr(3)), $nick)
40
  return $replace($hget(hlw,nick.conf), $!pnick, $left($nick(#,$nick,a,r).pnick,1) $+ %nick, $&
41
  $!status, $left($nick(#,$nick,a,r).pnick,1), $!nick, %nick)
42
}
43
alias hl.menu {
44
  var %m $adilang(Clear) :dline $active 5- $+ $line($active,0) , -, $adilang(Search) :search, $&
45
  -, $adilang(Highlights) $adilang(Options) :options -t highlights, -, $adilang(Close) :window -c $active
46
  if ($istok(begin end,$1,32)) return -
47
  else return $gettok($($+(%,m),2),$1,44)
48
}
49

    
50
menu @* {
51
  if ($+(@,$adilang(Highlights),$chr(160),$network) == $active) $submenu($hl.menu($1))
52
}
(4-4/5)