mIRC Home    About    Download    Register    News    Help

Print Thread
#182664 12/08/07 09:56 PM
Joined: Jul 2007
Posts: 1,129
T
Tomao Offline OP
Hoopy frood
OP Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
Hi, is there a snippet that can show people who are away in the channels, in gray color, when I join them? I want to see who are away and who aren't based on the color.

Thanks in advance for those who can be of assistance.

Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Well, it can be done using /cnick but then for that to work effectively you'd need to perform a /userhost every second or couple of seconds which would probably slow down your script dramatically.

Examples 1, 2.

Joined: Jan 2004
Posts: 509
L
Fjord artisan
Offline
Fjord artisan
L
Joined: Jan 2004
Posts: 509
Alt B, select the colors tab, you can modify idle time by nick color.

Joined: Nov 2006
Posts: 1,559
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
Originally Posted By: SladeKraven
Well, it can be done using /cnick but then for that to work effectively you'd need to perform a /userhost every second or couple of seconds which would probably slow down your script dramatically.

On unreal IRCd, you could use the command "who +aM" ever so often, e.g. a timer 0 30

+a : user is away
+M : user is on a comchan

Then, you could:
1) use a #group (or another switch) to /halt the output of those continuous raw replies (352: "who reply" and 315: "end of wholist")
2) parse the raw 352 to /cnick: check for "if (G isin $7)" (user is Gone aka Away), $6 being the nickname of that user

Joined: Jul 2007
Posts: 1,129
T
Tomao Offline OP
Hoopy frood
OP Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
Code:
raw 352:*: {
  if (G isin $6) && ($me ison $4) {
    cline -l $color(gray) $comchan($8,1) $fline($comchan($8,1),$8,1,1))
  }
}


I might have done something wrong because the away nicks won't appear in gray when I join the channels.

Joined: Nov 2006
Posts: 1,559
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
The "/*line" commands like /cline work only in custon windows.

Joined: Feb 2003
Posts: 3,432
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
raw 352:*: { if (G isin $7) && ($me ison $2) { cline -l the_color_you_want $2 $6 } }

But remeber, you need to do a /who #channel to make away users show. And i saw you had some errors in your code.

Last edited by sparta; 13/08/07 09:01 AM.

if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
Joined: Oct 2005
Posts: 1,741
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
/cline can be used to color nicknames (in the nicklist) in channels.

-genius_at_work

Joined: Nov 2006
Posts: 1,559
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
Originally Posted By: genius_at_work
/cline can be used to color nicknames (in the nicklist) in channels.
Being used to work with /cnick, I overlooked the -l switch of /cline - Thanks for pointing out my fault.

Hence, I played with /cline -l and the /who +aM command mentioned above... here is the little result; maybe it's a wee bit useful for someone.
Code:
; ---------- SETUP START ---------- 
; setup: colour for nicks marked "away"
alias -l away.check.gone { return 14 }

; setup: colour for nicks not away
alias -l away.check.here { return  10 }

; setup: interval to check away status (seconds)
alias -l away.check.interval { return 90 }
; ---------- SETUP END ---------- 


; on connect, start a loop to check away status
on *:connect: { $+(.timer.away.refresh.,$network) 0 $away.check.interval away.check }


; menu switch to stop/restart the checking manually
menu status,channel {
  Awaycheck $+($chr(91),$network,$chr(93))
  .$iif(($timer($+(.away.refresh.,$network))),$style(1)) resume : {
    away.check
    $+(.timer.away.refresh.,$network) 0 $away.check.interval away.check
  }
  .$iif((!$timer($+(.away.refresh.,$network))),$style(1)) pause : {
    $+(.timer.away.refresh.,$network) off
  }
}


; checking routine
alias -l away.check {
  ; enable group to halt the display of raw replies related to away-checking
  .enable #awaycatch

  ; start disabling timer for it
  .timer.away.catch 1 20 .disable #awaycatch

  ; open a hidden window to list users marked as away 
  window -h @away.catch

  ; request list of all users marked away and sharing a chan
  who +aM
}


; group to catch and halt raw replies
#awaycatch off
raw 352:*: {
  ; if user is marked as away, add nick to the hidden window (as precaution, check "away" again)
  if (G isin $7) { aline @away.catch $6 }

  ; halt display of that raw reply
  haltdef
}

raw 315:*: {
  ; end of who: execute timer that disables the group
  timer.away.catch -e

  ; execute colouring alias 
  awaycatch.colour $network

  ; halt display of that raw reply
  haltdef
}
#awaycatch end


; colouring routine 
alias -l awaycatch.colour {
  scon $1
  ; cycle all chans
  var %c.nr = 1
  while ($chan(%c.nr)) {
    var %chan = $v1, %n.nr = 1

    ; cycle all nicks 
    while ($nick(%chan,%n.nr)) {
      var %nick = $v1

      ; colour nick accordingly (nick is or is not listed in the window of users marked away)
      cline -l $iif(($fline(@away.catch,%nick,1)),$away.check.gone,$away.check.here) %chan %nick
      inc %n.nr
    }
    inc %c.nr
  }

  ; close hidden window
  window -c @away.catch
  scon -r
}

Advantages of approach:
- there are less who reply lines to parse
- there is no need to /who all chans separately, which might flood you off without a queue- or timer system
Disadvantage:
- "who +aM" will not work on every IRCd (tested on unreal)


Link Copied to Clipboard