mIRC Home    About    Download    Register    News    Help

Print Thread
#11735 17/02/03 03:45 PM
Joined: Jan 2003
Posts: 44
T
Ameglian cow
OP Offline
Ameglian cow
T
Joined: Jan 2003
Posts: 44
How can I differentiate if the /who command has been triggered by a script event or by the user by typing the command /who ???

PLease help me ... frown


Regards, ThE_mASk.
#11736 17/02/03 04:09 PM
Joined: Feb 2003
Posts: 15
H
Pikka bird
Offline
Pikka bird
H
Joined: Feb 2003
Posts: 15
You can add something to the script that notifies you when it triggers a /who. Other than that when a script triggers a /who it's exactly the same as if the user triggered it.

#11737 17/02/03 04:36 PM
Joined: Jan 2003
Posts: 44
T
Ameglian cow
OP Offline
Ameglian cow
T
Joined: Jan 2003
Posts: 44
Yes but I tried to use the following script:
alias who {
set %who yes
who
}

and it didn't worked. because it makes %who - yes every time no matter if it is used by a scritp evento or user


Regards, ThE_mASk.
#11738 17/02/03 07:05 PM
Joined: Dec 2002
Posts: 395
M
Fjord artisan
Offline
Fjord artisan
M
Joined: Dec 2002
Posts: 395
He means something like:

Code:
your_alias_or_event {
  ...
  [your code]
  ...
  echo this /who reaquest was caused by script!
  /who
  ...
}

#11739 18/02/03 01:18 PM
Joined: Dec 2002
Posts: 1,321
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Dec 2002
Posts: 1,321
Here's what I use for this (to only show the /who results in whichever window I typed the /who command in:
Code:

alias who { 
  if ($show) { 
    set -u600 %_WHO.target $active
    set -u600 %_WHO.params $1- 
  }
  .raw WHO $1- 
}
raw 352:*:{
  if (* isin $7) .auser Oper $mask($+($6,!,$3,@,$4),3)
  if (%_WHO.target) {
 
    var %color, %flags = -bflrti
    if ($len($2) > 2) %flags = $+(%flags,$calc($ifmatch + 1))
 
    if ((H isin $7) && (* isin $7)) %color = 02
    elseif ((G isin $7) && (* isin $7)) %color = 12
    elseif ((H isin $7) && (@ isin $7)) %color = 06
    elseif ((G isin $7) && (@ isin $7)) %color = 13
    elseif ((H isin $7) && (+ isin $7)) %color = 03
    elseif ((G isin $7) && (+ isin $7)) %color = 10
    elseif (H isin $7) %color = 01
    elseif (G isin $7) %color = 14
 
    if (!%_WHO.Count) {
      if ($active == Status Window) linesep -s
      else linesep %_WHO.target
    }
    inc -u30 %_WHO.Count
 
    echo %flags %_WHO.target $&
      $+( $chr(3), 02, $2) $&
      $+( $chr(3), %color, $6) $&
      $+( $chr(15), $chr(40), $chr(3), 03, $3, $chr(15), @, $chr(3), 04, $4, $chr(15),$chr(41)) $&
      $+( «, $chr(3), 05, $iif($network == DALnet, $gettok($5,1,46), $5), $chr(15), ») $&
      $+( $chr(3), 10, $9-)
  }
  halt
}
raw 315:*:{
  if (%_WHO.target) {
 
    var %color, %flags = -bflrti
    if ($len($2) > 2) %flags = $+(%flags,$calc($ifmatch + 1))
    if (!%_WHO.Count) var %_WHO.Count = 0
 
    if (%_WHO.Count > 9) {
      echo $color(info) %flags %_WHO.target End of 6/WHO %_WHO.params list. $+([, %_WHO.Count matching users , ])
      linesep $iif(#* iswm $chan($2),$2,$iif($query($2),$ifmatch,$active))
    }
 
    window -g1 $iif($numtok(%_WHO.target,32) > 1,$+(",%_WHO.target,"),%_WHO.target)
 
    .timer 1 5 unset %_WHO.*
  }
  halt
}

Wherever you use /who in your script, simply use .raw WHO instead of /who to bypass showing the results.


DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C

Link Copied to Clipboard