mIRC Home    About    Download    Register    News    Help

Print Thread
#114517 15/03/05 02:46 AM
Joined: Mar 2004
Posts: 155
D
Darkmnm Offline OP
Vogon poet
OP Offline
Vogon poet
D
Joined: Mar 2004
Posts: 155
I'm not sure if this is even possable and figured i'd ask before I even attempted to try it but is it possible to select all the nicks in the nicklist after joining a channel and saying hello to them all at once?

#114518 15/03/05 04:07 AM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
If you load this into your Nicklist Popups (Alt-R, PopUps Tab, View - Nick List). I think it'll work

Code:
/say Hi $snick(#,0)

#114519 15/03/05 05:09 AM
Joined: Mar 2004
Posts: 175
Vogon poet
Offline
Vogon poet
Joined: Mar 2004
Posts: 175
$snick(#,0) returns the total number of selected users in the channel, not the names of the users.

It's not possible to select all the nicknames. You can only select one at a time through /sline.

However, you may return all the selected nicknames through the $snicks identifier.

Alternatively, you can use raws to retrieve all the nicknames in the channel like so:

Code:
on me:*:JOIN:#channel: { set $+(%,names.,$cid,.,#) }
raw 353:*: {
  if ($var($+(%,names.,$cid,.,$3))) {
    set $+(%,names.,$cid,.,$3) $($+(%,names.,$cid,.,$3),2) $right($4-,-1)
  }
}
raw 366:*: {
  if ($($+(%,names.,$cid,.,$2),2)) {
    msg $2 Hello, $v1
    unset $+(%,names.,$cid,.,$2)
  }
}


- Relinsquish
#114520 15/03/05 11:20 AM
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Quote:

It's not possible to select all the nicknames. You can only select one at a time through /sline.


Yes it is possible.

From the help file

/sline [-a|r] <#channel> <N|nick>
Selects or deselects lines in a channel nickname listbox. It can select either the Nth nickname in a listbox, or a specified nickname.

If you do not specify any switches, any existing selections in the listbox are cleared. If you specify the -a switch then the specified is selected without affecting the selection states of other lines. If you specify the -r switch then the specified item is deselected.

Darkmnm,

Code:
alias getnicks {
  if ($active ischan) {
    var %x = $nick($active,0)
    while (%x) {
      sline -a $active %x
      msg $nick($active,%x) Hello $nick($active,%x)
      dec %x
    }
  }
}

#114521 15/03/05 11:33 AM
Joined: Mar 2004
Posts: 540
A
Fjord artisan
Offline
Fjord artisan
A
Joined: Mar 2004
Posts: 540
Why make things so complicated?
Say Hi: {
var %tnicks = $snick(#,0)
var %x = 1
while (%x <= %tnicks) {
msg $active Hi $snick(#,%x)
inc %x
}
}

#114522 15/03/05 11:41 AM
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
The thing is though, they want to select the nicknames upon joining and with your code they'd need to manually select the nicknames then proceed with the command.

How about something like,

Code:
on me:*:join:[color:red]#channel[/color]: {
  getnicks
}

alias getnicks {
  if ($active ischan) {
    var %x = $nick($active,0)
    while (%x) {
      sline -a $active %x
      msg $nick($active,%x) Hello $nick($active,%x)
      dec %x
    }
  }
}

#114523 15/03/05 11:44 AM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
eeeeeeek you msg flooder. lol smile

Code:
menu nicklist {
  Say hello to all selected : {
    var %s = Hello to
    var %n
    var %m = $snick($chan,0)
    var %i = 1
    while (%i &lt;= %m) {
      var %n = %n $snick($chan,%i)
      if ($len(%n) &gt; 400) {
        //echo say %s %n
        var %s = and also
        var %n
      }
      inc %i
    }
    if (%n) //echo say %s %n
  }
}


This says hello to everyone selected.

PS: its a bit flood as well smile

#114524 15/03/05 12:03 PM
Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
on me:*:JOIN:#: msg # Hello everyone.

No flood and is aimed at every nick in the channel grin


Gone.
#114525 15/03/05 12:09 PM
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Quote:
eeeeeeek you msg flooder. lol smile


It has been known. grin

How about adding a timer for a short delay..

Code:
on me:*:Join:#: {
  %getnicks.chan = $chan
  .timerGetnicks 1 1 getnicks
}

alias getnicks {
  var %x = $nick(%getnicks.chan,0)
  while (%x) {
    sline -a %getnicks.chan %x
    .timer 1 $calc(%x + 1) .msg $nick(%getnicks.chan,%x) Hello $nick(%getnicks.chan,%x)
    dec %x
  }
}

#114526 15/03/05 12:09 PM
Joined: Mar 2004
Posts: 540
A
Fjord artisan
Offline
Fjord artisan
A
Joined: Mar 2004
Posts: 540
Quote:
I'm not sure if this is even possable and figured i'd ask before I even attempted to try it but is it possible to select all the nicks in the nicklist after joining a channel and saying hello to them all at once?

The way I read that is that he is joining a channel and highlighting the list after he joins the room, so I see no fault in my code in that view point

#114527 15/03/05 12:14 PM
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Yeah, we both had different ideas as to what the original poster asked for. I don't think there's anything wrong with your code and there's by far no fault either I'm sorry if it came across that way.

All the best,

Andy.

#114528 15/03/05 12:20 PM
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Quote:

on me:*:JOIN:#: msg # Hello everyone.

No flood and is aimed at every nick in the channel grin


Hahaha very clever!! lol.. grin

I know this is stupid but also..

Code:
on me:*:Join:#: {
  set %getnicks.chan $chan
  .timer 1 1  getnicks
}

alias getnicks {
  var %x = $nick(%getnicks.chan,0), %getnicks.nicks
  while (%x) {
    var %getnicks.nicks = $addtok(%getnicks.nicks,$nick(%getnicks.chan,%x),44)
    dec %x
  }
  msg %getnicks.chan Hello $replace(%getnicks.nicks,$chr(44),$chr(44) $+ $chr(32)) $+ .
  unset %getnicks.*
}


Just a silly suggestion. blush

#114529 15/03/05 12:59 PM
Joined: Mar 2004
Posts: 155
D
Darkmnm Offline OP
Vogon poet
OP Offline
Vogon poet
D
Joined: Mar 2004
Posts: 155
Thanks to everyone that's posted sollutions to my question. I'll try each one and use the one that works the best. Thanks again.

#114530 15/03/05 01:07 PM
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
You're welcome. smile

#114531 15/03/05 01:38 PM
Joined: Mar 2004
Posts: 175
Vogon poet
Offline
Vogon poet
Joined: Mar 2004
Posts: 175
Quote:
Yes it is possible.

From the help file

/sline [-a|r] <#channel> <N|nick>
Selects or deselects lines in a channel nickname listbox. It can select either the Nth nickname in a listbox, or a specified nickname.

If you do not specify any switches, any existing selections in the listbox are cleared. If you specify the -a switch then the specified is selected without affecting the selection states of other lines. If you specify the -r switch then the specified item is deselected.

Thanks for letting me know. I was looking in the Custom Windows section of the help file and overlooked the -a switch. grin


- Relinsquish
#114532 15/03/05 01:41 PM
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
You're welcome dude. smile

#114533 15/03/05 09:22 PM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
On the continuing of sillyness..

You didnt select all the nicks tho?

Code:
on me:*:Join:#: {
  .timer 1 1 selectnicks $chan
}
alias selectnicks {
  var %i = $nick($1,0) | while (%i) { sline -a $1 %i | dec %i }
  msg $1 Hello $replace($snicks,$chr(44),$chr(44) $+ $chr(32)) $+ .
  ;^ I suspect the script to go spalt on its face at this moment when the string to long error occurs unless only a few uasers are in channel.
}



My personal fav for sillyness would be do excactly what he asked for...

Quote:
I'm not sure if this is even possable and figured i'd ask before I even attempted to try it but is it possible to select all the nicks in the nicklist after joining a channel and saying hello to them all at once?


Code:
on me:*:Join:#: {
  .timer 1 1 selectnicks $chan
}
alias selectnicks {
  var %i = $nick($1,0) | while (%i) { sline -a $1 %i | dec %i }
  msg $1 hello to them all at once?
}


What? What! Why is everyone laughng at me?

#114534 15/03/05 09:30 PM
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Quote:

You didnt select all the nicks tho?


I know, it was along the lines of what FiberOPtics suggested. grin

Quote:

My personal fav for sillyness would be do excactly what he asked for...


I did what he asked for too, or atleast I think I did.

Code:
on me:*:Join:#: {
  %getnicks.chan = $chan
  .timerGetnicks 1 1 getnicks
}

alias getnicks {
  var %x = $nick(%getnicks.chan,0)
  while (%x) {
    sline -a %getnicks.chan %x
    .timer 1 $calc(%x + 1) .msg $nick(%getnicks.chan,%x) Hello $nick(%getnicks.chan,%x)
    dec %x
  }
}


The only difference is that you added a silly $1 ($chan) and moved the msg between the two closing braces. We really do have a silly thread here.. grin

#114535 15/03/05 09:43 PM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
Nothing wrong with it but it would be a killer on a channel im in 1800+ users eeeeeeeek 1800+ timers. 30mins later someone gets a Hi from me lol

#114536 15/03/05 09:44 PM
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Nothing wrong with a late birthday card unless there's no cash in it. grin


Link Copied to Clipboard