|
Joined: Oct 2003
Posts: 48
Ameglian cow
|
OP
Ameglian cow
Joined: Oct 2003
Posts: 48 |
Ok. Here's the scenario: I am in 5 channels, #chan1 #chan2 #chan3 #chan4 and #chan5 as seen here: They reside in that order in the "switch bar" in mIRC, now when I whois myself, Im seeing: So, if I have a script that sends an on join note to the channel (Thanks for ops) directed towards UserA who is usually in 2 common channels of mine #chan1 and #chan3, what channel will the message goto, #chan1 or #chan3? I'd think it would goto #chan1 seeing as it's my first listed channel in the switch bar....but maybe the inner workings of scripts/mIRC work differently for this? Thanks in advance, r00ted
|
|
|
|
Joined: Dec 2002
Posts: 3,547
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,547 |
Hmm, couldn't you use a While Loop or some sort to send the message to all channels?
As I think it'd send the message to the first common channel you are on.
|
|
|
|
Joined: Nov 2003
Posts: 257
Fjord artisan
|
Fjord artisan
Joined: Nov 2003
Posts: 257 |
I use this alias for something similar
chans { .unset %chan.* .set %chan.all $chan(0) .set %chan.now 1 :chans if (%chan.all == %chan.now) { .set %chan.str $addtok(%chan.str,$chan(%chan.now),44) | .return %chan.str } .set %chan.str $addtok(%chan.str,$chan(%chan.now),44) .inc %chan.now .goto chans } syntax is: //privmsg $chans test that would msg each channel in the order they appear in status
|
|
|
|
Joined: Dec 2002
Posts: 3,547
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,547 |
That's the thing though it messages each channel your on, not each common channel.
|
|
|
|
Joined: Nov 2003
Posts: 257
Fjord artisan
|
Fjord artisan
Joined: Nov 2003
Posts: 257 |
ah you'd need to use $comchan then I believe
|
|
|
|
Joined: Sep 2003
Posts: 4,230
Hoopy frood
|
Hoopy frood
Joined: Sep 2003
Posts: 4,230 |
I know he said an on join message, but then he said it was for "thanks for ops" directed at a specific user, correct me if im wrong but wouldnt you want to send that to the channel where you just got oped ?
|
|
|
|
Joined: Dec 2002
Posts: 3,547
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,547 |
Yes.
alias chans {
if ($comchan($1,0)) {
var %x = $comchan($1,0)
while (%x) {
msg $comchan($1,%x) $2-
dec %x
}
}
[color:red]}[/color]
It's untested though. Edit: *Added alignments *Added }
Last edited by SladeKraven; 31/03/05 03:39 AM.
|
|
|
|
Joined: Oct 2003
Posts: 48
Ameglian cow
|
OP
Ameglian cow
Joined: Oct 2003
Posts: 48 |
the thanks for ops was just an example. I'd want it expandable.
Basically, I need to know how mIRC deals with sending messages to channels, where there is the same user in more than one channel of my channels.
ok, i think im confusing myself now, maybe not though.
i think what im wanting to know is how mIRC determines the common channel and once it does determine it, how would it determine which of the common channels to send the public announcement to? Im guessing it would send it to the "first" common channel, but would that be #chan5 or #chan1? from left to right in my channel switch bar? Or right to left.
or is it just totally random in what channel it would send the message to.
|
|
|
|
Joined: Sep 2003
Posts: 4,230
Hoopy frood
|
Hoopy frood
Joined: Sep 2003
Posts: 4,230 |
Errr whats this puplic announcement thing your talking about, can you show me an example of one.
|
|
|
|
Joined: Jun 2003
Posts: 994
Hoopy frood
|
Hoopy frood
Joined: Jun 2003
Posts: 994 |
Basically, I need to know how mIRC deals with sending messages to channels, where there is the same user in more than one channel of my channels. correct me if I'm wrong, but is this what you're wanting? A message to the channel (/msg $chan or /notice $chan) would go just to that channel. If you send it to the individual (/msg $nick or /notice $nick) it would show (to that person only) in all common channels.
I refuse to engage in a battle of wits with an unarmed person.
|
|
|
|
Joined: Dec 2002
Posts: 3,547
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,547 |
You'd need an alias to do this. /chan [msg|notice] <Nick> <Message> /chan msg Andy Hello - sends a message in all channels with the nickname. /chan notice Andy Hello - sends a notice in all channels with the nickname.
alias chan {
if ($1 == msg) { var %do.cmd = msg }
elseif ($1 == notice) { var %do.cmd = notice }
else { return }
if ($comchan($$2,0)) {
var %x = $comchan($$2,0)
while (%x) {
%do.cmd $comchan($$2,%x) $$3-
dec %x
}
}
}
Message type being $1 Nickname being $2 Text to send being $3-
|
|
|
|
Joined: Sep 2003
Posts: 4,230
Hoopy frood
|
Hoopy frood
Joined: Sep 2003
Posts: 4,230 |
|
|
|
|
Joined: Dec 2002
Posts: 3,547
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,547 |
Hehe yeah, good point.
alias chans {
if ($1 == msg) { var %do.cmd = msg }
elseif ($1 == notice) { var %do.cmd = notice }
elseif (desc == $1 || describe == $1) { var %do.cmd = describe }
else { return }
if ($comchan($$2,0)) {
var %x = $comchan($$2,0)
while (%x) {
%do.cmd $comchan($$2,%x) $$3-
dec %x
}
}
}
|
|
|
|
Joined: Oct 2003
Posts: 48
Ameglian cow
|
OP
Ameglian cow
Joined: Oct 2003
Posts: 48 |
Ok, I figured it out. from what another mIRC scripter told me, the scripts would send the channel msg (directed towards a specific user who is in 2+ channels with me) to the first common channel on my switch bar.
and yes, the "public announcement" would be a public message to the channel directed at the particular user, who is common between 2+ channels. And the script would/should send the message to the first common channel we are in together, according to my switchbar.
Thanks for the help/investigation :P
|
|
|
|
Joined: Dec 2002
Posts: 3,547
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 3,547 |
Hehehe, takes me back to when I was doing maths investigations at school. None the less, you're welcome.
|
|
|
|
|