Project

General

Profile

[script] Random Nick Color message » Random Nick Color message v0.2.ini

script v0.2 - Mr. BS, 03/15/2014 11:35 PM

 
1
; http://dev.adiirc.com/boards/5/topics/163
2
; outputs same nick random color for the message
3
; v0.2 by pereba
4

    
5
; Changelog:
6
;
7
;  v0.2:
8
;    - support for any identifier for message nick/emote config: $pnick,$status,$user.
9
;    - added an experimental basic znc buffer playback support. Please don't complain for my newbish implementation, I'm glad it is working fine.
10
;      ps: only compatible with timestamp enabled in znc options (on by default).
11
;
12
;  v0.1: 
13
;    - initial release.
14

    
15
on 1:START: {
16
  UserConf
17
}
18

    
19
on 1:LOAD: {
20
  UserConf
21
}
22

    
23
on 1:UNLOAD: {
24
  unset %RColor.*
25
}
26

    
27
alias -l UserConf {
28
  set %RColor.nickConfig $strip($readini(config.ini, Messages, prefixuser),c)
29
  set %RColor.actionConfig $strip($readini(config.ini, Messages, prefixemote),c)
30
  set %RColor.Enabled 1
31
  set %RColor.Timestamp.Enabled 1
32
  set %RColor.Action.Enabled 1
33
}
34
if (%Rcolor.enableprefixcolor) { return $replacex($nickFormated,+,$chr(3) $+ 8,%,$chr(3) $+ 4,@,$chr(3) $+ 6),!,$chr(3) $+ 11,&,$chr(3) $+ 13,~,$chr(3) $+ 12) }
35
;channel
36
on ^*:TEXT:*:#: {
37
  if ($nick == ***) && ($1- == Buffer Playback...) {
38
    set -e %RColor.znc.playback. [ $+ [ $cid ] $+ . $+ [ $chan ] ] 1
39
    echo $EchoMode # $nickFormated $1-
40
    halt
41
  }
42
  if ($znc.playback == 1) && ($nick != ***) {
43
    echo $TheColor -rlmbf # $iif(%RColor.Timestamp.Enabled == 1,$1) $nickFormated $2-
44
  }
45
  if ($nick == ***) && ($1- == Playback Complete.) {
46
    unset %RColor.znc.playback. [ $+ [ $cid ] $+ . $+ [ $chan ] ]
47
    echo $EchoMode # $nickFormated $1-
48
    halt
49
  }
50
  if ($znc.playback != 1) {
51
    echo $TheColor $EchoMode # $nickFormated $1-
52
  }
53
  halt
54
}
55

    
56
;action
57
on ^*:ACTION:*:#: {
58
  if ($nick == ***) && ($1- == Buffer Playback...) {
59
    set -e %RColor.znc.playback. [ $+ [ $cid ] $+ . $+ [ $chan ] ] 1
60
    echo $EchoMode # $nickFormated $1-
61
    halt
62
  }
63
  if ($znc.playback == 1) && ($nick != ***) {
64
    if (%RColor.Action.Enabled == 1) {
65
      echo $TheColor -rlmbf # $iif(%RColor.Timestamp.Enabled == 1,$1) $actionFormated $2-
66
      halt
67
    }
68
  }
69
  if ($nick == ***) && ($1- == Playback Complete.) {
70
    unset %RColor.znc.playback. [ $+ [ $cid ] $+ . $+ [ $chan ] ]
71
    return
72
  }
73
  if ($znc.playback != 1) && (%RColor.Action.Enabled == 1) {
74
      echo $TheColor $EchoMode # $actionFormated $1-
75
      halt
76
  }
77
}
78

    
79
alias -l TheColor {
80
  if ($nick(#,$nick).color > 0) {
81
    return $nick(#,$nick).color
82
  }
83
}
84

    
85
alias -l EchoMode {
86
  if (%RColor.Timestamp.Enabled == 1) {
87
    return -trlmbf
88
  }
89
  return -rlmbf
90
}
91

    
92
alias actionFormated return $replace(%RColor.actionConfig,$!pnick,$iif($nick == ***,***,$nick($chan,$nick).pnick),$!status,$left($nick(#,$nick,a,r).pnick,1),$!nick,$nick)
93
alias nickFormated return $replace(%RColor.nickConfig,$!pnick,$iif($nick == ***,***,$nick($chan,$nick).pnick),$!status,$left($nick(#,$nick,a,r).pnick,1),$!nick,$nick)
94
alias -l znc.playback { return %RColor.znc.playback. [ $+ [ $cid ] $+ . $+ [ $chan ] ] }
95

    
96
menu menubar {
97
  -
98
  $iif(%RColor.Enabled == 1, $style(1),) 🎨 RColor Messages
99
  .$iif(%RColor.Enabled == 1, Disable, Enable) : $iif(%RColor.Enabled == 1, unset %RColor.Enabled, set %RColor.Enabled 1)
100
  .$iif(%RColor.Timestamp.Enabled == 1, $style(1),) Use timestamp : $iif(%RColor.Timestamp.Enabled == 1, unset %RColor.Timestamp.Enabled, set %RColor.Timestamp.Enabled 1)
101
  .$iif(%RColor.Action.Enabled == 1, $style(1),) Apply for action : $iif(%RColor.Action.Enabled == 1, unset %RColor.Action.Enabled, set %RColor.Action.Enabled 1)
102
  -
103
}
(3-3/6)