mIRC Home    About    Download    Register    News    Help

Print Thread
#115874 31/03/05 02:48 AM
Joined: Oct 2003
Posts: 48
R
r00ted Offline OP
Ameglian cow
OP Offline
Ameglian cow
R
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

#115875 31/03/05 02:59 AM
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
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.

#115876 31/03/05 03:28 AM
Joined: Nov 2003
Posts: 257
A
Fjord artisan
Offline
Fjord artisan
A
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

#115877 31/03/05 03:30 AM
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
That's the thing though it messages each channel your on, not each common channel.

#115878 31/03/05 03:32 AM
Joined: Nov 2003
Posts: 257
A
Fjord artisan
Offline
Fjord artisan
A
Joined: Nov 2003
Posts: 257
ah you'd need to use $comchan then I believe

#115879 31/03/05 03:36 AM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
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 ?

#115880 31/03/05 03:36 AM
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Yes.

Code:
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 } blush

Last edited by SladeKraven; 31/03/05 03:39 AM.
#115881 31/03/05 08:06 AM
Joined: Oct 2003
Posts: 48
R
r00ted Offline OP
Ameglian cow
OP Offline
Ameglian cow
R
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.

#115882 31/03/05 09:10 AM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
Quote:
the public announcement


Errr whats this puplic announcement thing your talking about, can you show me an example of one.

#115883 31/03/05 05:25 PM
Joined: Jun 2003
Posts: 994
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Jun 2003
Posts: 994
Quote:
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. wink
#115884 31/03/05 05:48 PM
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
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.

Code:
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-

#115885 31/03/05 05:53 PM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
/describe as well dude.

#115886 31/03/05 05:58 PM
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Hehe yeah, good point. smile

Code:
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
    }
  }
}

#115887 31/03/05 06:15 PM
Joined: Oct 2003
Posts: 48
R
r00ted Offline OP
Ameglian cow
OP Offline
Ameglian cow
R
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

#115888 31/03/05 06:18 PM
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
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. smile


Link Copied to Clipboard