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
@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
@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.
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
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-) }
}
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 :)
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
.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
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!
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
@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.