mIRC Home    About    Download    Register    News    Help

Print Thread
#151526 18/06/06 06:37 PM
Joined: Jun 2006
Posts: 3
W
Self-satisified door
OP Offline
Self-satisified door
W
Joined: Jun 2006
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

#151527 18/06/06 06:42 PM
Joined: May 2005
Posts: 449
Fjord artisan
Offline
Fjord artisan
Joined: May 2005
Posts: 449
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.

#151528 18/06/06 06:45 PM
Joined: Jun 2006
Posts: 3
W
Self-satisified door
OP Offline
Self-satisified door
W
Joined: Jun 2006
Posts: 3
sorry i think i got the function wrong - i meant $nick

#151529 18/06/06 06:50 PM
Joined: May 2005
Posts: 449
Fjord artisan
Offline
Fjord artisan
Joined: May 2005
Posts: 449
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.

#151530 18/06/06 06:57 PM
Joined: Jun 2006
Posts: 3
W
Self-satisified door
OP Offline
Self-satisified door
W
Joined: Jun 2006
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
  }
}
}
 

#151531 18/06/06 08:48 PM
Joined: May 2005
Posts: 449
Fjord artisan
Offline
Fjord artisan
Joined: May 2005
Posts: 449
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.

#151532 18/06/06 10:02 PM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
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!


Link Copied to Clipboard