mIRC Home    About    Download    Register    News    Help

Print Thread
#110148 05/02/05 12:05 AM
Joined: Nov 2004
Posts: 332
R
Fjord artisan
OP Offline
Fjord artisan
R
Joined: Nov 2004
Posts: 332
i have an away and when i turn it on it notices the channel that i turn it on in what i want it to do is notice all the channels that i am in rather than just the one


The Kodokan will move you, one way or another.
Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
Code:
  var %i = 1
  while $chan(%i) {
    notice $v1 <message>
    inc %i
  }

Joined: Nov 2004
Posts: 332
R
Fjord artisan
OP Offline
Fjord artisan
R
Joined: Nov 2004
Posts: 332
thanks i thought there would be a simpler way but it turns out you have to do it like you have to do to get a echo of everyone on the chan


The Kodokan will move you, one way or another.
Joined: Jun 2004
Posts: 87
B
Babel fish
Offline
Babel fish
B
Joined: Jun 2004
Posts: 87
u idiots RTFM the mIRC help file is ur best friend

/amsg <message>
This and the /ame command send the specifed message or action to all open channel windows.

Joined: Mar 2004
Posts: 175
Vogon poet
Offline
Vogon poet
Joined: Mar 2004
Posts: 175
I fail to see how /amsg or /ame sends a notice to all channels. smile


- Relinsquish
Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
Guess who's the real idiot grin


Gone.
Joined: Sep 2004
Posts: 200
I
Fjord artisan
Offline
Fjord artisan
I
Joined: Sep 2004
Posts: 200
I think i foun a better way:
anotice {
var %n = $chan(0)
while (%n > 0) {
var %n1 = %n1 $+ , $+ $chan(%n)
dec %n
}
raw notice $mid(%n1,2,$calc($len(%n1) - 1)) : $+ $1-
}
add that to your aliases script section, and it should work. i tested it

Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
Just a little note to save you time and coding

$mid(%n1,2,$calc($len(%n1) - 1))
replace with
$mid(%n1,2) aka character 2 to end of text

Joined: Apr 2003
Posts: 701
K
Hoopy frood
Offline
Hoopy frood
K
Joined: Apr 2003
Posts: 701
Since everyone is making suggestions, I can't stay behind wink
The condition in an if/while evaluates to $true for everything but 0, $null and $false, and since you can't join channel 0 (even though some people tell you you can wink ) it goes over all channels. Then use $v1 to use the channel in the loop...

I also found out the notice isn't being shown if you use raw, so I put in some echo's and hid the raw display in $active.

anotice {
var %n = 1, %n1
while ($chan(%n)) {
var %n1 = %n1 $+ , $+ $v1
echo $color(notice) $v1 $+(-,$me,:,$v1,-) $1-
inc %n
}
.raw notice $right(%n1,-1) : $+ $1-
}

Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
ok heres mine then

i just left the raw showing as I dont like echoing stuff to channels (aslo it would have been lots more code)

Code:
alias anotice {
  set %i 0
  var %c = $str($!chan($inci) $+ $chr(32),$chan(0))
  raw notice $replace($eval(%c,2),$chr(32),$chr(44)) : $+ $1-
  unset %i
} 
alias -l inci { inc %i $1 | return %i }

Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
Not really lots more smile
Code:
alias anotice {
  set -u %i 0
  var %c = $replace($($str($!chan($inci) $+ $chr(32),$chan(0)),2),$chr(32),$chr(44)), %b = $1-
  .notice %c %b
  tokenize 44 %c
  echo -cit notice $* -&gt; $* : %b
} 
alias -l inci { inc %i $1 | return %i }


Link Copied to Clipboard