vakkotaur: Centaur holding bow - cartoon (Default)
[personal profile] vakkotaur


This entry had been friends only. Since nobody complained about the script screwing up, it is now open...

I've been running this the last few days, as has Timmo (well, a slightly earlier version, actually).

Here's the first, simple (ha) version of what I will eventually call FadeAway.

What it does: Scans the nicks of all the channels you are on and colors the away nicks grey. If you are away, your nick gets colored orange. When no longer away, a nick returns to the normal color, whatever that may be.

How to get it in place: Copy this thing into remote.ini and be sure remote.ini is loaded. It'll start automatically on the next connect.

The colors are set by %AwayColor and %MyAwayColor. (Use Control-K to get the color list if need be.) The colors were chosen to look good, if not great, on both white and black backgrounds.

The two minutes is set by the 120 (seconds) of the ON:CONNECT timer.

The command /who is used, but the responses are supressed. If you want to do a /who and get a visible response, use /wh instead. Note that /who is not /whois and /whois is, so far, completely unaffected by this script.

As with all scripts, look through it and be sure you can trust it. If there's a problem, I'd like to know about it. I believe the commenting to be adequate, but I could be wrong...


; FadeAwayLight
; Paul Neubauer 2003
;
; mIRC script to color nicks of those who are away.
; This script only deals with those who actually set /away
; and does not handle real idle times or away indicating nicks
; that are not truly set /away .
;
;
alias /InitFadeAwayLightVariables {
  ;
  ; Silence /who responses by default.
  set %silence 1
  ;
  ; GREY if someone is away. Global so that the /who trap can paint with it.
  set %AwayColor 14
  ;
  ; Unless it's me. Then ORANGE if I'm away. Also global for the /who trap.
  set %MyAwayColor 7
  ;
}
;
; Let /wh work for /who and get visible results, but
; don't let it bug the server if it has nothing to send.
alias wh {
  if ( $1 == $null ) { /halt }
  set %silence 0
  /who $1
} 
;
;
on 1:CONNECT:{
  ; Start a timer to scan the nicks of all the channels I'm on.
  ; Timer self-triggers (0 stop) and trips every two minutes (120 seconds, well 133 to get it right...).
  /timer 0 133 /WhoAwayScan
  ;
  ; Get the global variables defined and set.
  /InitFadeAwayLightVariables
  ;
}
;
;
; Actually do the scanning of all the nicks on the channels I'm on.
alias WhoAwayScan { 
  ; 
  ;
  ; Loop index
  /var %i
  ;
  ; Nick handling - do it by channel (it seems to be more reliable that way)
  /var %NumberOfChannels
  /var %CurrentChannel
  ;
  ; Get number of nicks on all channels I'm on.
  ;
  %NumberOfChannels = $chan(0)
  ;
  ; Initialize loop index.
  %i = 1
  ;
  ; Loop through all the channels I'm on.
  while ( %i <= %NumberOfChannels) {
    ;
    ; Get the currently indexed channel...
    %CurrentChannel = $chan(%i)
    ;
    ; ...and do a who on it. Try to be as quiet as possible about it.
    /.who %CurrentChannel
    ;    
    ; Increment the loop index or we'll be here forever.
    inc %i
  }
  ;
  ; Shut down, just to be sure and play nice.
  /halt
}
;
;
; Trap the response to /who .
raw 352:*:{ 
  ; 
  ; Remove the nick from the color list.
  /.cnick -r $6
  ;
  ; If away, re-color the nick.
  if ( G isin $left( $7,1 ) ) {
    ;
    ; If it's me being away, quietly color my nick MyAwayColor.
    if ( $6 == $me ) { /.cnick $6 %MyAwayColor }
    ;
    ; If it's anyone else being away, quietly color their nick AwayColor.
    else { /.cnick $6 %AwayColor }
  }
  ;
  ;
  ; Suppress the main /who messages to prevent cluttering up the status window.
  ; Unless /wh said to not be quiet.
  if ( %silence == 1 ) { /halt }
}
;
;
; Suppress "End of" data notification for /who .
; but only for automatic /who . Let /wh work for manual requests.
raw 315:*:{
  if ( %silence == 1 ) { /halt }
  ;
  ; Supress responses again. /wh can turn them back on if it wants.
  else { set %silence 1 }
}
;
; 
; End of FadeAwayLight



The next version will be rather more involved...

Profile

vakkotaur: Centaur holding bow - cartoon (Default)
Vakkotaur

March 2024

S M T W T F S
     12
3 456789
10111213141516
17181920212223
24252627282930
31      

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated 2 January 2026 13:16
Powered by Dreamwidth Studios