; For mIRC 7.48 and newer.
; 15/04/2017 - mIRC v7.48
; ...
; 18.Added CAP support for away-notify...
; https://ircv3.net/specs/extensions/away-notify-3.1
; Not designed for multiple networks because the script only uses nicks.
; NOTE: Currently set to use grey ( ctrl+k 14 ) because xchat/hexchat uses that.
; Any nicks the address book ( /abook -l ) with this colour will be deleted
; when this script is loaded / unloaded or client connects / disconnects.
; If you don't like that colour, you can change it to something else below.
; Anything using the colour you pick will be deleted.
on *:start:{
.cnick on
; Change this for a different colour.
set %away-nick-colour 14
away-nick-delete
}
on *:unload:{
away-nick-delete
unset %away-nick-colour
}
on *:connect:{
away-nick-delete
}
on *:disconnect:{
away-nick-delete
}
; User set or unset /away, change the nick.
raw away:*:{
if ($1 != $null) {
.cnick $nick %away-nick-colour
}
if ($1 == $null) {
.cnick -r $nick
}
}
; /who #channel
raw 352:*: {
if (G isin $7) {
.cnick $6 %away-nick-colour
}
}
on *:join:#:{
if ($nick == $me) {
who $chan
}
}
on *:nick:{
; Delete old nick, add new one if they are /away.
if ($cnick($nick)) {
.cnick -r $nick
.cnick $newnick %away-nick-colour
}
}
on *:quit:{
.cnick -r $nick
}
on *:part:#:{
; Delete the nick if we do not share any channels if they /part one.
if ($comchan($nick,0) == 0) {
.cnick -r $nick
}
}
; Only delete the nicks ( /abook -l ) that are using the colour the script is using.
alias -l away-nick-delete {
var %x $cnick(0)
while (%x) {
if ($cnick(%x).colour == %away-nick-colour) {
.cnick -r $cnick(%x)
}
dec %x
}
}