Relay Script 1.0

By ChiefDean on Mar 14, 2010

ChiefDean's Cross-Server Relay script.

Description:
This script takes any motion in a certain channel on a certain network, and displays it on a totally different network on a totally different channel.

Usage:
1.) Copy snippet and paste it into mIRC remotes (Alt+r)
2.) Go to any channel and right click in the channel.
3.) Go to "Relay setup"
4.) Enter in:
-Server one Name.
-Server one Channel.
-Server two Name.
-Server two Channel.
5.) Make sure the relay bot is on both servers, and both channels.
6.) Enjoy your new Relay bot!

###############################################
# Relay script 1.0 by ChiefDean
# irc.HeatWaveIRC.net #Heatwave
###############################################

Menu * {
  -
  Relay Setup: {
    set %serv1 $input(Enter Server One here.,e,Relay Script 1.0 by ChiefDean)
    set %chan1 $input(Enter Channel One here.,e,Relay Script 1.0 by ChiefDean)
    set %serv2 $input(Enter Server Two here.,e,Relay Script 1.0 by ChiefDean)
    set %chan2 $input(Enter Channel Two here,e,Relay Script 1.0 by ChiefDean)
    if ($numtok(%serv1 %chan1 %serv2 %chan2,32) == 4) { $input(Setup Complete.Remember to turn the power on!,,Script 1.0 by ChiefDean) }
    else { $input(Critical Setup Error! Please return to Relay Setup and Start over!,,Script 1.0 by ChiefDean) }
  }
  $iif($group(#Relay) == On,$style(1)) Relay Power Switch
  .$iif($group(#Relay) == On,$style(2)) On: .enable #Relay
  .$iif($group(#Relay) == Off,$style(2)) Off: .disable #Relay

  -
}
alias -l net {
  var %netcount $scon(0)
  while %netcount {
    if ($scon(%netcount).network == $1) { var %netid %netcount }
    dec %netcount
  }
  scon %netid return $!cid
}
alias -l relay { 
  scid $net($1)
  if ($me ison $3) { $2- }
}
alias -l RCheck { 
  if ($1 == $2) && ($3 == $4) { return 1 }
  else return 0
}
#Relay on
on *:TEXT:*:#:{
  if ($rcheck($network,%serv1,$chan,%chan1)) { relay %serv2 msg %chan2 $+(04«,04,14,$nick,04@,14,$network,04,») $1- }
  elseif ($rcheck($network,%serv2,$chan,%chan2)) { relay %serv1 msg %chan1 $+(04«,04,14,$nick,04@,14,$network,04,») $1- }
}
on *:MODE:#:{
  if ($rcheck($network,%serv1,$chan,%chan1)) { relay %serv2 msg %chan2 $+(04«,04,14,Mode,04@,14,$network,04,») $nick sets mode $1- }
  elseif ($rcheck($network,%serv2,$chan,%chan2)) { relay %serv1 msg %chan1 $+(04«,04,14,Mode,04@,14,$network,04,») $nick sets mode $1- }
}
on *:NICK: {   
  if ($rcheck($network,%serv1,$chan,%chan1)) { relay %serv2 msg %chan2 $+(04«,14,nick,04@,14,$network,04,») $nick is now known as $newnick }
  elseif ($rcheck($network,%serv2,$chan,%chan2)) { relay %serv1 msg %chan1 $+(04«,14,nick,04@,14,$network,04,») $nick is now known as $newnick }
}
on *:join:#: {  
  if ($rcheck($network,%serv1,$chan,%chan1)) { relay %serv2 msg %chan2 $+(04«,14,join,04@,14,$network,04,») $Nick joins $chan }
  elseif ($rcheck($network,%serv2,$chan,%chan2)) { relay %serv1 msg %chan1 $+(04«,14,join,04@,14,$network,04,») $Nick joins $chan }
}  
on *:quit: {  
  if ($rcheck($network,%serv1,$chan,%chan1)) { relay %serv2 msg %chan2 14 $+ $nick has just quit $+($network,.) }
  elseif ($rcheck($network,%serv2,$chan,%chan2)) { relay %serv1 msg %chan1 14 $+ $nick has just quit $+($network,.) }   
} 
on *:kick:#: {  
  if ($rcheck($network,%serv1,$chan,%chan1)) { relay %serv2 msg %chan2 $+(04«,14,kick,04@,14,$network,04,») $knick gets kicked from $chan by $+($nick,.) }
  elseif ($rcheck($network,%serv2,$chan,%chan2)) { relay %serv1 msg %chan1 $+(04«,14,kick,04@,14,$network,04,») $knick gets kicked from $chan by $+($nick,.) }   
} 
on *:part:#: {  
  if ($rcheck($network,%serv1,$chan,%chan1)) { relay %serv2 msg %chan2 $+(04«,14,part,04@,14,$network,04,») $Nick parts $chan }
  elseif ($rcheck($network,%serv2,$chan,%chan2)) { relay %serv1 msg %chan1 $+(04«,14,part,04@,14,$network,04,») $Nick parts $chan }   
} 
on *:ACTION:*:#: {  
  if ($rcheck($network,%serv1,$chan,%chan1)) { relay %serv2 msg %chan2 $+(04«,04,14,$nick,04@,14,$network,04,») 6* $nick $1- }
  elseif ($rcheck($network,%serv2,$chan,%chan2)) { relay %serv1 msg %chan1 $+(04«,14,$nick,04@,14,$network,04,») 6* $nick $1- }
}
#Relay End

Comments

Sign in to comment.
JD75   -  Nov 22, 2013

Just set this up and i have the power ON! ;) and this is the message i have.

[11:34] Server does not recognize $FALSE command
[11:36]
Server does not recognize $TRUE command

Anybody any ideas.?

Thank You!

 Respond  
PackardBell   -  Sep 18, 2013

Super script.
Just 1 Q : if i want to use this to relay with multiple relays (4 different servers)
What thing should i change?
the %serv1 ->%serv3 and %serv2 -> %serv4
the %chan1 ->%chan3 and %chan2 -> %chan4

Relay On -> #Relay2 On ?

anything else?

Thanx :)

 Respond  
cooldude13233   -  Jul 19, 2011

@FordLawnmower i have made a fix to the script that i will post bellow BUT thing is that if someone changes there nick or quits and if the script is loaded in lots of chats on the 2 servers it will message it in all the chats. nonetheless i want the script to see if the person quits or changed nicks on a specific chat and NOT all chats

###############################################
# Relay script 1.0 by ChiefDean
# irc.HeatWaveIRC.net #Heatwave
###############################################

Menu * {
  -
  Relay Setup: {
    set %serv1 $input(Enter Server One here.,e,Relay Script 1.0 by ChiefDean)
    set %chan1 $input(Enter Channel One here.,e,Relay Script 1.0 by ChiefDean)
    set %serv2 $input(Enter Server Two here.,e,Relay Script 1.0 by ChiefDean)
    set %chan2 $input(Enter Channel Two here,e,Relay Script 1.0 by ChiefDean)
    if ($numtok(%serv1 %chan1 %serv2 %chan2,32) == 4) { $input(Setup Complete.Remember to turn the power on!,,Script 1.0 by ChiefDean) }
    else { $input(Critical Setup Error! Please return to Relay Setup and Start over!,,Script 1.0 by ChiefDean) }
  }
  $iif($group(#Relay) == On,$style(1)) Relay Power Switch
  .$iif($group(#Relay) == On,$style(2)) On: .enable #Relay
  .$iif($group(#Relay) == Off,$style(2)) Off: .disable #Relay

  -
}
alias -l net {
  var %netcount $scon(0)
  while %netcount {
    if ($scon(%netcount).network == $1) { var %netid %netcount }
    dec %netcount
  }
  scon %netid return $!cid
}
alias -l relay { 
  scid $net($1)
  if ($me ison $3) { $2- }
}
alias -l RCheck { 
  if ($1 == $2) && ($3 == $4) { return 1 }
  else return 0
}
#Relay off
on *:TEXT:*:#:{
  if ($rcheck($network,%serv1,$chan,%chan1)) { relay %serv2 msg %chan2 $+(04<,04,14,$nick,04@,14,$network,04,>) $1- }
  elseif ($rcheck($network,%serv2,$chan,%chan2)) { relay %serv1 msg %chan1 $+(04<,04,14,$nick,04@,14,$network,04,>) $1- }
}
on *:MODE:#:{
  if ($rcheck($network,%serv1,$chan,%chan1)) { relay %serv2 msg %chan2 $+(04<,04,14,Mode,04@,14,$network,04,>) $nick sets mode $1- }
  elseif ($rcheck($network,%serv2,$chan,%chan2)) { relay %serv1 msg %chan1 $+(04<,04,14,Mode,04@,14,$network,04,>) $nick sets mode $1- }
}
on *:NICK: {   
  if ($rcheck($network,%serv1)) { relay %serv2 msg %chan2 $+(04<,14,Nick Change,04@,14,$network,04,>) $nick is now known as $newnick }
  elseif ($rcheck($network,%serv2)) { relay %serv1 msg %chan1 $+(04<,14,Nick Change,04@,14,$network,04,>) $nick is now known as $newnick }
}
on *:join:#: {  
  if ($rcheck($network,%serv1,$chan,%chan1)) { relay %serv2 msg %chan2 $+(04<,14,Join,04@,14,$network,04,>) $Nick has joined $chan }
  elseif ($rcheck($network,%serv2,$chan,%chan2)) { relay %serv1 msg %chan1 $+(04<,14,Join,04@,14,$network,04,>) $Nick has joined $chan }
}  
on *:kick:#: {  
  if ($rcheck($network,%serv1,$chan,%chan1)) { relay %serv2 msg %chan2 $+(04<,14,Kick,04@,14,$network,04,>) $knick gets kicked from $chan by $+($nick,.) }
  elseif ($rcheck($network,%serv2,$chan,%chan2)) { relay %serv1 msg %chan1 $+(04<,14,Kick,04@,14,$network,04,>) $knick gets kicked from $chan by $+($nick,.) }   
} 
on *:part:#: {  
  if ($rcheck($network,%serv1,$chan,%chan1)) { relay %serv2 msg %chan2 $+(04<,14,Part,04@,14,$network,04,>) $Nick has left $chan }
  elseif ($rcheck($network,%serv2,$chan,%chan2)) { relay %serv1 msg %chan1 $+(04<,14,Part,04@,14,$network,04,>) $Nick has left $chan }   
} 
on *:ACTION:*:#: {  
  if ($rcheck($network,%serv1,$chan,%chan1)) { relay %serv2 msg %chan2 $+(04<,04,14,$nick,04@,14,$network,04,>) 6* $nick $1- }
  elseif ($rcheck($network,%serv2,$chan,%chan2)) { relay %serv1 msg %chan1 $+(04<,14,$nick,04@,14,$network,04,>) 6* $nick $1- }
}
on 1:QUIT: {  
  if ($rcheck($network,%serv1)) { relay %serv2 msg %chan2 14 $+ $nick Quit $+($network,.) }
  elseif ($rcheck($network,%serv2)) { relay %serv1 msg %chan1 14 $+ $nick Quit $+($network,.) }   
}
#Relay End
 Respond  
cooldude13233   -  Jul 17, 2011

@FordLawnmower -nods-

 Respond  
FordLawnmower   -  Jul 16, 2011

@cooldude13233 Something needs to be added to check if $nick is on %chan1 or %chan2, respectively before sending the message.
I edited this from a broken script that was over 185 lines to what it is now, in about 15 minutes so I overlooked the complexity of the on quit event. This is 99.9% my code and I was never given any credits on it so I won't be addressing any issues with it. It should be simple to fix on your own though. Just keep in mind that there is no $chan in the on quit event.

 Respond  
cooldude13233   -  Jul 16, 2011

something is wrong with the on *:quit: { part of the script

 Respond  
jasonh   -  Jun 26, 2011

works well, thanks

 Respond  
Amiga600   -  Feb 13, 2011

Crikey, You make scripting look easy Jethro_

I edited the script slightly as well, to get a list of users on channel entry/leave/server quit and nickname changes, also this is stored in a %serv1user and %serv2user variables, which also adds a new !ul command which will then show serv1 users a list of users from serv2 and vice-versa.

ChiefDean is welcome to use my updated script if he wishes: http://pastebin.com/LPSjZb54

 Respond  
Jethro   -  Feb 13, 2011

Amiga600:

on *:nick:relay
on *:quit:relay
alias -l relay {
  if ($network = %serv1) { relay %serv2 .msg %chan2 : $+ $network $+ : $nick $iif($event = nick,-> $newnick,Quit with Reason: $1-) }
  elseif ($network = %serv2) { relay %serv1 .msg %chan1 : $+ $network $+ : $nick $iif($event = nick,-> $newnick,Quit with Reason: $1-) }   
}
 Respond  
Amiga600   -  Feb 13, 2011

After further examination this script fails to pickup quit+name changes, as there is no channel information passed along with those modes, I have got them both working via the following code:

on *:nick: {
  if ($network = %serv1) { relay %serv2 .msg %chan2 : $+ $network $+ : $nick -> $newnick }
  elseif ($network = %serv2) { relay %serv1 .msg %chan1 : $+ $network $+ : $nick -> $newnick }   
}
on *:quit: {  
  if ($network = %serv1) { relay %serv2 .msg %chan2 : $+ $network $+ : $nick Quit with Reason: $1- }
  elseif ($network = %serv2) { relay %serv1 .msg %chan1 : $+ $network $+ : $nick Quit with Reason: $1- }   
}

Great Script ChiefDean, I've found it very useful :)

 Respond  
syrusmx   -  Oct 13, 2010

I know it's 4 months later, but I'm hoping you're still available to help with this script. It works perfectly, but I need more :)

Can it be modified to work over multiple networks, with specific names, and relay that info in to specific channels?

Example:
Tom on Undernet in #omg, Dick on Dalnet in #wtf, and Harry on EfNet in #bbq, and relay their channel text to #omgwtfbbq on QuakeNet. While at the same time, relay channel text from Larry on IRCNet in #what, Curly on GameSurge in #the, and Moe on NewNet in #crap and relay their channel text to #whatthecrap on QuakeNet

 Respond  
ChiefDean   -  Jun 30, 2010

Thanks i was wondering if i could do that haha

 Respond  
xplo   -  Jun 28, 2010

use [ code ]codegoeshere[ /code ]
without the spaces

 Respond  
ChiefDean   -  Jun 28, 2010

.selfip is disconnected, i guess i shouldhave changed that haha. its /server irc.heatwaveIRC.net now

And for your request:

###############################################
# Relay script 1.0 by ChiefDean
# Heatwave.selfip.net #Heatwave
###############################################

Menu * {
  -
  Relay Setup: {
    set %serv1 $input(Enter Server One here.,e,Relay Script 1.0 by ChiefDean)
    set %chan1 $input(Enter Channel One here.,e,Relay Script 1.0 by ChiefDean)
    set %serv2 $input(Enter Server Two here.,e,Relay Script 1.0 by ChiefDean)
    set %chan2 $input(Enter Channel Two here,e,Relay Script 1.0 by ChiefDean)
    if ($numtok(%serv1 %chan1 %serv2 %chan2,32) == 4) { $input(Setup Complete.Remember to turn the power on!,,Script 1.0 by ChiefDean) }
    else { $input(Critical Setup Error! Please return to Relay Setup and Start over!,,Script 1.0 by ChiefDean) }
  }
  $iif($group(#Relay) == On,$style(1)) Relay Power Switch
  .$iif($group(#Relay) == On,$style(2)) On: .enable #Relay
  .$iif($group(#Relay) == Off,$style(2)) Off: .disable #Relay

  -
}
alias -l net {
  var %netcount $scon(0)
  while %netcount {
    if ($scon(%netcount).network == $1) { var %netid %netcount }
    dec %netcount
  }
  scon %netid return $!cid
}
alias -l relay { 
  scid $net($1)
  if ($me ison $3) { $2- }
}
alias -l RCheck { 
  if ($1 == $2) && ($3 == $4) { return 1 }
  else return 0
}
#Relay on
on *:TEXT:*:#:{
  if ($rcheck($network,%serv1,$chan,%chan1)) { relay %serv2 msg %chan2 $1- }
  elseif ($rcheck($network,%serv2,$chan,%chan2)) { relay %serv1 msg %chan1 $1- }
}
on *:MODE:#:{
  if ($rcheck($network,%serv1,$chan,%chan1)) { relay %serv2 msg %chan2 $nick sets mode $1- }
  elseif ($rcheck($network,%serv2,$chan,%chan2)) { relay %serv1 msg %chan1 $nick sets mode $1- }
}
on *:NICK: {   
  if ($rcheck($network,%serv1,$chan,%chan1)) { relay %serv2 msg %chan2 $nick is now known as $newnick }
  elseif ($rcheck($network,%serv2,$chan,%chan2)) { relay %serv1 msg %chan1 $nick is now known as $newnick }
}
on *:join:#: {  
  if ($rcheck($network,%serv1,$chan,%chan1)) { relay %serv2 msg %chan2 $Nick joins $chan }
  elseif ($rcheck($network,%serv2,$chan,%chan2)) { relay %serv1 msg %chan1 $Nick joins $chan }
}  
on *:quit: {  
  if ($rcheck($network,%serv1,$chan,%chan1)) { relay %serv2 msg %chan2 14 $+ $nick has just quit $+($network,.) }
  elseif ($rcheck($network,%serv2,$chan,%chan2)) { relay %serv1 msg %chan1 14 $+ $nick has just quit $+($network,.) }   
} 
on *:kick:#: {  
  if ($rcheck($network,%serv1,$chan,%chan1)) { relay %serv2 msg %chan2 $knick gets kicked from $chan by $+($nick,.) }
  elseif ($rcheck($network,%serv2,$chan,%chan2)) { relay %serv1 msg %chan1 $knick gets kicked from $chan by $+($nick,.) }   
} 
on *:part:#: {  
  if ($rcheck($network,%serv1,$chan,%chan1)) { relay %serv2 msg %chan2 $Nick parts $chan }
  elseif ($rcheck($network,%serv2,$chan,%chan2)) { relay %serv1 msg %chan1 $Nick parts $chan }   
} 
on *:ACTION:*:#: {  
  if ($rcheck($network,%serv1,$chan,%chan1)) { relay %serv2 msg %chan2 6* $nick $1- }
  elseif ($rcheck($network,%serv2,$chan,%chan2)) { relay %serv1 msg %chan1 6* $nick $1- }
}
#Relay End
 Respond  
bigmike1605   -  Jun 26, 2010

I'd like a little help modifying this script, i tried connecting to your ircd, but says connection failed. In the channel I am relaying to, it displays this «nick@Network-NET» and then whatever that nick types. Id like to remove the > part, and have it just display the text, any help be greatly appreciated!

 Respond  
ChiefDean   -  May 21, 2010

Also, i can help you fully if you join my server, just be patient. i am usually away and if i'm not just PM me on there, that will give me a timestamp of when you were on so i can help you. when i get back. make sure to explain that you are here for help, and i will be sure to help you.

 Respond  
FordLawnmower   -  May 18, 2010

@R3b3l Please post ALL the errors from your status and we will try to help you. Unknown Command: tells you a little about what happened but , "NET Unknown Command" would be much more helpful in solving your problem so please copy and paste the Entire error here.

 Respond  
R3b3l   -  May 18, 2010

chief dean who to set Ur relay bot
example
1st server name: swiftco.wa.us.dal.net:6663
1st channel name: chatter
2nd server name: irc.igs.ca:6667
2nd channel name: chat lover
but channel window show this msg : Unknown command
(i use mirc6.35 - nbs-irc 2.39)
i also visit Ur server but i don not understand how to work Ur relay bot

 Respond  
ChiefDean   -  Apr 22, 2010

lenooox, are you saying it does work, or doesnt? :P because if it doesnt you can go to that server too. thats my server, i could help you there. even if you dont need help, you can come on by!!

 Respond  
ChiefDean   -  Apr 22, 2010

Hmm, well i dont really know there R3b3l. If you would like i can schedule a time where i could help you, like you can go to my irc server, and i could help you there. /server irc.HeatwaveIRC.net

 Respond  
Lenooox   -  Apr 17, 2010

i use this mirc 6.35 with nbsirc script , and this relay script works good for me
before when i used MPP , much script not worked :/
and MPP have some bug and trojan viruses LoL

 Respond  
R3b3l   -  Apr 17, 2010

hello dear
but it could not work ,which version you use for this script
i apply this script in mirc 6.35 or mirc power pack version.
but no working.
please help me. i m very keen for this script

 Respond  
R3b3l   -  Apr 17, 2010

hello dear

 Respond  
ChiefDean   -  Mar 27, 2010

xD Yes listen to Ford, he knows a lot more than i do, and i probably would have told you to fix it a less-Better way xD (Not very proper English)

 Respond  
FordLawnmower   -  Mar 26, 2010

YW Lenooox :)

 Respond  
Lenooox   -  Mar 26, 2010

thank you very much FordLawnmower :)

 Respond  
FordLawnmower   -  Mar 26, 2010

@Lenooox two lines need to be changed to remove this error.
You will find them around line 13.
Find this:

    if ($numtok(%serv1 %chan1 %serv2 %chan2,32) == 4) { $input(Setup Complete.Remember to turn the power on!,,Script 1.0 by ChiefDean) }
    else { $input(Critical Setup Error! Please return to Relay Setup and Start over!,,Script 1.0 by ChiefDean) }

Replace with this:

    if ($numtok(%serv1 %chan1 %serv2 %chan2,32) == 4) { noop $input(Setup Complete.Remember to turn the power on!,,Script 1.0 by ChiefDean) }
    else { noop $input(Critical Setup Error! Please return to Relay Setup and Start over!,,Script 1.0 by ChiefDean) }

This error shouldn't effect the script Lenooox. It's just a one time error when you clicked on the $input box. If you had clicked "cancel" instead of "ok", it would have said $false instead of $true. It has nothing to do with the functionality of the script, it's just a check to see if you filled in all of the boxes.

If this script isn't working for you, make sure that you have filled in all for boxes properly.
Rules:
1) The bot must be on both channel one - server one and channel two server two.(The script will do nothing otherwise.
2) In order to see the results, a second client must be on both server/channels and this client must type something on channel one to see the it on server two.
3) The network names must be typed exactly when you enter them in setup.(type //echo -a $network -- to see the exact name of the network you are on.

@ChiefDean You should replace the word Server with Network, as they have two different meanings and Server is not applicable here.

 Respond  
Lenooox   -  Mar 26, 2010

i use mIRC 6.35 with nbs-irc 2.39

 Respond  
ChiefDean   -  Mar 25, 2010

O.o What version of mIRC are you using there Lenooox?

 Respond  
Lenooox   -  Mar 22, 2010

(12:16:08)  -› Unknown command ($true) o.O

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.