mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jun 2013
Posts: 43
G
Ameglian cow
OP Offline
Ameglian cow
G
Joined: Jun 2013
Posts: 43
Hi, I need some quick help on a function I would like to incorporate.

What I would like is, for example, if a message is sent on the irc.test1.net server and #firsttest channel, that message should be repeated into the irc.test2.org server and #secondtest channel.

I don't know if there is an example of this anywhere, but when I googled it, I couldn't find anything. So, if anyone could link me something, or give me some help, it would be greatly appreciated. If you need any more information, please just ask! Many thanks.
-Tom

Edit - May be worth to note that both servers have a different password.

Last edited by GamingTom; 12/05/14 09:20 PM.
Joined: Apr 2014
Posts: 191
B
Vogon poet
Offline
Vogon poet
B
Joined: Apr 2014
Posts: 191
You might want to use network name for checking instead of server name. To know network name use //echo $network
I believe the code must be like this.
Code:
on *:TEXT:*:#firstchannel:{
  if $network == firstnetwork { scid -at1 relay # $replace($1-,|,-,%,-,$,-) }
}

alias -l relay {
  if $network == secondnetwork && $me ison #secondchannel {
    msg #secondchannel ( $1 ) $2-
  }
}

Last edited by blessing; 14/05/14 11:55 AM.
Joined: Jul 2006
Posts: 4,149
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,149
Quote:
$replace($1-.|,-,%,-,$,-)

What's with the .| at the end, why do you add that to $1-?
In any case, replacing $ and % by - is just incorrect, if you want to properly escape those, you must use the safe alias. It's best to use $safe() around $chan too, which might become a problem in the future (though for now, a static channel name is used, no injection is possible)


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Apr 2014
Posts: 191
B
Vogon poet
Offline
Vogon poet
B
Joined: Apr 2014
Posts: 191
Ups, it is typo. My bad.
Like Wims said, this one use $safe() alias. Thanks wink

Code:
on *:TEXT:*:#firstchannel:{
  if $network == firstnetwork { scid -at1 relay $safe(#) $safe($1-) }
}

alias -l relay {
  if $network == secondnetwork && $me ison #secondchannel {
    msg #secondchannel ( $1 ) $2-
  }
}

alias safe return $!decode( $encode($1-, m) ,m)


Link Copied to Clipboard