mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Apr 2010
Posts: 59
A
Babel fish
OP Offline
Babel fish
A
Joined: Apr 2010
Posts: 59
Hi, I wrote this script to block the perpetual noise of people join/part/nick/quitting, especially in larger channels. Everyone should use it. The way it works is you suppress (hide) all the events (Options > IRC > Events), then the script echos some of them manually. The criteria to show them, are if the person has spoken in the last hour. The script should be dissected and shredded by all; please read before loading. It might have to be merged with existing handlers if any.
Code:
; Display nick/part/quit messages if a user is active, so
; the rest can be suppressed, in Options > IRC > Events.
; "Active" is tracked with an entry in the "active nicks"
; hashtable, consisting of "[network] _ [nick]".  Remove
; the entry on nick/quit, and part if not in any more
; mutual channels.  Join is never shown.  On Nick, On Part,
; and On Quit will need to be merged with other procedures
; if existing.  Then the count of active nicks is:
; "$hget(active_nicks, 0).item".

; Echo $3- to the channels we and user $1 are both on in
; color $2, for displaying quit/nick events.
alias comchan_echo {
  var %k $comchan($1, 0)
  while (%k > 0) {
    echo -ci2t $2 $comchan($1, %k) $3-
    dec %k
  } 
}

alias on_nick_proc {
  var %key $+($network, _, $nick)
  if ($hget(active_nicks, %key)) {
    hdel active_nicks %key
    comchan_echo $newnick nick * $nick changed their nick to $newnick
  }
}

alias on_part_proc {
  var %key $+($network, _, $nick)
  if ($hget(active_nicks, %key )) {
    if ($comchan($nick, 0) == 1) {
      hdel active_nicks %key
    }
    echo -ci2t part $chan * $nick $iif($len($1-) > 0, left:, left) $1-
  }
}

alias on_quit_proc {
  var %key $+($network, _, $nick)
  if ($hget(active_nicks, %key )) {
    hdel active_nicks %key
    comchan_echo $nick quit * $nick $iif($len($1-) > 0, quit:, quit) $1-
  }
}

; Reset the user's active timer to 1 hour (3600 sec.).
alias on_text_proc {
  var %key $+($network, _, $nick)
  hadd -mu3600 active_nicks %key 1
}

on *:NICK:on_nick_proc
on *:PART:*:on_part_proc $1-
on *:QUIT:on_quit_proc $1-
on *:TEXT:*:*:on_text_proc

Joined: Jun 2003
Posts: 81
T
TRT Offline
Babel fish
Offline
Babel fish
T
Joined: Jun 2003
Posts: 81
Good idea, but if you do it the other way around (halt events when user never spoke) it will work with existing theme scripts without editing

Joined: Jul 2006
Posts: 4,149
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,149
Quote:
Everyone should use it
What confused


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Apr 2010
Posts: 59
A
Babel fish
OP Offline
Babel fish
A
Joined: Apr 2010
Posts: 59
Then should I use "on ^1:NICK" or "on ^*:NICK"? And should I use "halt" or "haltdef"? However I do like my replacement text.

Also, "+b" and "+q" chan-user mode changes could be useful to keep displaying.


Joined: Apr 2010
Posts: 59
A
Babel fish
OP Offline
Babel fish
A
Joined: Apr 2010
Posts: 59
Wims, I just feel that the nick-noise detracts both from people's experience and ability to communicate on IRC. In some interpretations, it also makes the "enter" key seem more tempting to press too often. I can't imagine that I'm the only one who perceives it that way. The utility of the script could also be very widely useful, while the utility of the nick-noise is not.


Link Copied to Clipboard