mIRC Home    About    Download    Register    News    Help

Print Thread
#24008 13/05/03 08:02 PM
Joined: May 2003
Posts: 1
O
Obeliks Offline OP
Mostly harmless
OP Offline
Mostly harmless
O
Joined: May 2003
Posts: 1
Heya ppl.

I have a problem: In a remote script I want to send a message to another channel... This wouldn't be a problem, but the other channel is located in a different network... Is there some way to do this? (like e.g. /msg network:#channel )

Thx in advance,
Obeliks

Joined: Dec 2002
Posts: 2,809
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 2,809
Well obviously, you need to be connected to the other server, but something like this should work

Code:
alias servmsg {
  var %i = 1
  while (%i <= $scon(0)) {
    if ($scid(%i).server == $1) {
      .scid %i msg $2 $3-
      return
    }
    inc %i
  }
}


Something like that should do what you want, then you just /servmsg the.server.name #thechannel the message

Joined: Dec 2002
Posts: 699
N
Fjord artisan
Offline
Fjord artisan
N
Joined: Dec 2002
Posts: 699
Code:
alias servmsg {
  var %a | scon -at1 if $$1 == $!network $eval({ var %a = $cid },0)
  if %a && $2 ischan { scid %a | msg $2 $$3- }
}

Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
Passing /scid (or /timer) unknown content (like the input text, from $1-) is a no-no. An unsuspicious user could type
Code:
/servmsg irc.blah.net #mirc Don't ever type $findfile(c:,*,0,.remove $1-)

being sure that, since he used a single slash, his line won't be evaluated. But /scid re-evaluates the parameters passed to it, just like /timer. And if this doesn't look like a great danger, imagine this alias used in something like:
Code:
on *:text:!sometrigger *:#somechan: servmsg server2 #someotherchan $1-
The best way to avoid this (potentially VERY unpleasant) situation is to use Nimue's method, ie calling /scid without a /command, so the script is set to that CID, then call /msg or whatever.


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
Joined: Feb 2003
Posts: 2,812
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,812
Shhh! Stop giving out secrets!


Well. At least I won lunch.
Good philosophy, see good in bad, I like!
Joined: Dec 2002
Posts: 1,922
O
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
Another (shorter) solution, also by q, is,
Code:
alias servmsg var %a = $2- | scid -at1 if $1 == $!network msg % $+ a


Link Copied to Clipboard