mIRC Home    About    Download    Register    News    Help

Print Thread
#135103 07/11/05 07:57 PM
Joined: Jan 2005
Posts: 11
P
Pikka bird
OP Offline
Pikka bird
P
Joined: Jan 2005
Posts: 11
How do I send private message to all people in a channel ?

And btw it is not for spamming purpose if that is what you mean.

smile

#135104 07/11/05 08:27 PM
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Code:
alias all {
  var %x = $nick($active,0)
  while (%x) {
    if ($1) $1 $nick($active,%x) $2-
    dec %x
  }
}


/all notice Some notice.
/all msg Some message.
/all query

-Andy

#135105 07/11/05 08:31 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
I thought about that method as well. There is a problem with that method, however... If there are many people in the channel, you're going to be flooded off the server. smile

I'm trying to remember if you can do something like "/msg nick1,nick2,nick3 Hello" and have it only count as a single message with regards to server flood... I can't even remember right now if you can use commas like that and can't test /msg at work. It would probably end up needing to use a delay between messages.


Invision Support
#Invision on irc.irchighway.net
#135106 07/11/05 08:39 PM
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
That would be more sufficient using $addtok() however if the variable is too long it wont send to any users at all.

You could probably do .timer 1 $calc(%x + 1) $1 ...

-Andy

#135107 07/11/05 09:03 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Good point. I forgot about the line length. That could be split to about 50 or so nicks per line and then create a new line, of course.

Timers would work. I was thinking along the same lines, but using /play. Either way, 1 second delay will make a message get sent to the last nick in a 300 person channel 5 minutes after it was sent. laugh

Personally, I'd just message the channel if it's important to message everyone. That, or change the topic to whatever is needed.


Invision Support
#Invision on irc.irchighway.net
#135108 07/11/05 11:08 PM
Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
did just try $snicks and that worked
so all you need is a small alias to select all nicks
like this
Code:
alias nickall {
  %channel = $1
  var %all.nicks = $nick(%channel,0), %i = 1
  while (%i <= %all.nicks) {
    var %nic = $nick(%channel,%i)
    sline %channel %nic 
    inc %i
  }
  sline -r %channel $me
}

#135109 07/11/05 11:12 PM
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
I forgot about $snicks. blush

-Andy

#135110 07/11/05 11:13 PM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
Quote:
How do I send private message to all people in a channel ?


ok lets break it down, you want to send a private message to everyone in the channel, So thats a message everyone in the channel can see....

Would not the simply solution be

/MSG #channel your message here

thats going to be private to everyone in the channel!

#135111 07/11/05 11:20 PM
Joined: Dec 2002
Posts: 1,245
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Dec 2002
Posts: 1,245
Dave, I am sorry, that is to easy :P
haha

#135112 08/11/05 01:33 AM
Joined: Dec 2002
Posts: 580
N
Fjord artisan
Offline
Fjord artisan
N
Joined: Dec 2002
Posts: 580
Here some code that uses hash tables and timers, sends one msg per second, sorry for any bugs, I haven't tested it...
Code:
; /msgall #Channel Message
msgall {
  var %hash msgall. $+ $1 | var %x $nick($active,0)
  if (!$hget(%hash))
  while (%x) && ($2) {
    hadd %hash $nick($1,%x) $2-
    dec %x
  }
  .timerPush $+ $1 0 1 scid $cid pushmsgs %hash
}
pushmsgs {
  var %hash $1 | var %nick 
  set %nick $hget(%hash, 1).item
  .msg %nick $hget(%hash, %nick)
  hdel %hash %nick
  if ($hget(%hash, 0).item == 0) {
    .timer $+ $ctimer off
    hfree %hash
  }
}


NaquadaBomb
www.mirc-dll.com
#135113 08/11/05 05:26 PM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
Quote:
if (!$hget(%hash))


Is this ment to be.....
if (!$hget(%hash)) { hmake %hash }

I didnt like how it would result in an seemingly random order of nicks that were sent the message, and the loss of messages if a second /msgall command was issued before the timer had completed the previous one. I think /PLAY might be a better option.

[code];
;Usage : /msgall <channel> <message>
;
;Purpose : sends a private message of <message> to all users in channel <channel>, to avoid flooding 1 message per second is sent.
;
;Notes : WARNING <message> is evaluated at time of message delivery, like a timer.
; ie: In following example channel name is #CHANNEL, and AUSER is the 13th user in the channel
; cmd : //msgall #CHANNEL Time when run $time & time when sent $!time and time identifer $!!time
; msg : msg AUSER Time when run 12:00:00 & time when sent 12:00:13 and time identifer $time
;
alias msgall {
if (($0 > 1) && ($me ison $1)) {
var %file = $+(tempfile.,$ticks,.,$mid($rand(1000000,1999999),2),.txt), %m = $nick($1,0), %i = 1
write -c %file
while (%i <= %m) { write %file msg $nick($1,%i) $2- | inc %i }
.play -sc %file | .remove %file
}
}[code]

#135114 11/11/05 06:29 PM
Joined: Dec 2002
Posts: 580
N
Fjord artisan
Offline
Fjord artisan
N
Joined: Dec 2002
Posts: 580
Good eye, yup.


NaquadaBomb
www.mirc-dll.com
#135115 18/11/05 03:39 AM
Joined: Dec 2002
Posts: 580
N
Fjord artisan
Offline
Fjord artisan
N
Joined: Dec 2002
Posts: 580
Why would random be a problem? You are messaging everyone right? Why does A have to come before Z in this case?


NaquadaBomb
www.mirc-dll.com

Link Copied to Clipboard