mIRC Homepage
Posted By: irony is it possible to /msg selected channels - 02/03/03 09:02 AM
Hi guys, gals, others smile

Is it possible to /msg selected channels with the same /msg. I know there's /amsg but that's for all. I just want it for some. Preferably an easy way smile
Posted By: druiddk Re: is it possible to /msg selected channels - 02/03/03 09:28 AM
Just /mmsg #channel1.#channel2.#channel3 text to send :P

Code:
 alias mmsg {
var %number.of.chans.to.msg = $numtok($1,46)
while (%number.of.chans.to.msg != 0) {
write mmsg.txt msg $gettok($1,number.of.chans.to.msg,46) $2
dec %number.of.chans.to.msg 1
}
while ($read(mmsg.txt, w, *) != $null) {
[ / [ $+ [ $read(mmsg.txt, 1) ] ] ]
write -dl1 mmsg.txt
}
if (($read(mmsg.txt, w, *) == $null) { .remove mmsg.txt }
}
Here's a way (it can't be to many channels though)...

/msg #chan1,#chan2,#chan3 Message
druiddk:

Ouch! do yourself a favor... /help hash tables smile
Posted By: irony Re: is it possible to /msg selected channels - 02/03/03 09:53 AM
thanks kindly peoples, i will try the /mmsg alias, looks just what i need, I'm way too lazy and dumb to even try and understand hash tables, unless it's tables with has.... ummmm, never mind :P
Why use that alias? What I said has the same functionality and is built-in to mirc. If you have all channels on one line you are limited to a max line length. It would be better to directly script a loop in to your code rather than trying to do it with one commands because no matter which method you use, multiple commands are still being sent to the server.

This code messages everyone in your internal address list
Code:
alias msg.ial {
  var %Index 1 | var %Nick | set %Nick $gettok($ial(*!*@*, 1), 1, 33)
  while (%Nick) {
    msg %Nick $1-
    inc %Index | set %Nick $gettok($ial(*!*@*, 1), 1, 33)
  }
}


This code messages all channels joined to on a particular network
Code:
alias msg.all.chan {
  var %Index 1
  while ($chan(%Index)) {
    msg $chan(%Index) $1-
    inc %Index
  }
}


If you're interested I could give you some "funky" ways to add in delays too, so you don't get killed for server flooding... smile

btw, don't be afraid, try it....
mmm, Hash tables smirk
Posted By: irony Re: is it possible to /msg selected channels - 03/03/03 01:26 AM
thanks for the info, i just want to msg certain channels with info at variopus times and the info may be more appropriate to some channels i am in and not to others so having that option suits my needs perfectly. Having the option of just typing the channels and the message is easy and simple to me and to be perfectly honest i don't have the time, inclination or patience to sit down and try and learn more new stuff.

Appreciate the inoput though, thanks
© mIRC Discussion Forums