mIRC Homepage
Posted By: warnesey333 $snick - 18/06/06 06:37 PM
I was wondering, with the $snick function, do i have to be able to get into that channel for this to work, i e. If i was banned from the specific channel - would this not work?

Thank
Posted By: bwr30060 Re: $snick - 18/06/06 06:42 PM
From the mIRC help:
Quote:

$snick(#,N)
Returns the Nth selected nickname in the channel listbox on channel #.

So, yes, you'd have to be in a channel to have a nick selected to do anything with it.
Posted By: warnesey333 Re: $snick - 18/06/06 06:45 PM
sorry i think i got the function wrong - i meant $nick
Posted By: bwr30060 Re: $snick - 18/06/06 06:50 PM
Then that depends on what you're trying to do. $nick will return the nick of the person who triggered a script, so if you have something that triggers when you receive a query (or a notice, or a DCC...) you don't need to be in a channel for that to happen. If you give specifics of what you're trying to do, we can answer your question better.
Posted By: warnesey333 Re: $snick - 18/06/06 06:57 PM
I would like to retrieve a list of people in a channel, without having to go in and type /name,

so far i've got

Code:
 
on *:TEXT:!getusers*:#: {
  if ($nick isop #warns_snug) { 
    %chan = $2-
    %nicks = $nick(%chan,0)
    %no = 1
  while ( %nicks > %no ) {
    %nick = $nick(%chan,%no)
    /inc %no 1
    /msg #warns_snug %nick
  }
}
}
 
Posted By: bwr30060 Re: $snick - 18/06/06 08:48 PM
I think in a lot of cases, that won't work. If the user is mode +i (invisible), which quite a few networks set by default, you can't see them in a /whois if you aren't in the channel with them.
Posted By: DaveC Re: $snick - 18/06/06 10:02 PM
Code:
on *:TEXT:!getusers *:#: {
  if ($nick isop #warns_snug) { 
    var %chan = $2-
    var %nicks = $nick(%chan,0)
    var %no = 1
    while ( %no <= %nicks ) {
      var %nick = $nick(%chan,%no)
      msg #warns_snug %nick
      inc %no
    }
  }
}

* untested, fixed code to use local vars, and corrected possable ertror in while loop *

The nick with the script MUST be in that channel for this to work tho!
© mIRC Discussion Forums