mIRC Home    About    Download    Register    News    Help

Topic Options
#151526 - 18/06/06 07:37 PM $snick
warnesey333 Offline
Self-satisified door

Registered: 18/06/06
Posts: 3
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

Top
#151527 - 18/06/06 07:42 PM Re: $snick
bwr30060 Offline
Fjord artisan

Registered: 23/05/05
Posts: 449
Loc: Georgia USA
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.
_________________________
Bears on Patrol Chat

Top
#151528 - 18/06/06 07:45 PM Re: $snick
warnesey333 Offline
Self-satisified door

Registered: 18/06/06
Posts: 3
sorry i think i got the function wrong - i meant $nick

Top
#151529 - 18/06/06 07:50 PM Re: $snick
bwr30060 Offline
Fjord artisan

Registered: 23/05/05
Posts: 449
Loc: Georgia USA
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.
_________________________
Bears on Patrol Chat

Top
#151530 - 18/06/06 07:57 PM Re: $snick
warnesey333 Offline
Self-satisified door

Registered: 18/06/06
Posts: 3
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
  }
}
}
 

Top
#151531 - 18/06/06 09:48 PM Re: $snick
bwr30060 Offline
Fjord artisan

Registered: 23/05/05
Posts: 449
Loc: Georgia USA
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.
_________________________
Bears on Patrol Chat

Top
#151532 - 18/06/06 11:02 PM Re: $snick
DaveC Offline
Planetary brain

Registered: 26/09/03
Posts: 4230
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!

Top