i need the script which can communicate in more than 2 networks
#xyz channel of server1 is connected to server 2 #xyz and server3 #xyz
n vice versa
sober4in wrote:i tried searching but all those were for between 2 networks .. incase there is any script for more than 2 networks please kindly help me find it
ty
Code: Select all
#**************************************#
#* Chan Relay by YooDa *#
#**************************************#
# chansets
setudef flag relay;
setudef str relay-victim;
#**************** relay control ******************#
bind pub n|n !relay relay:command;
proc relay:command {nick host hand chan arg} {
set option [string tolower [lindex $arg 0]];
switch -- $option {
on {
channel set $chan +relay
putserv "NOTICE $nick :Done."
}
off {
channel set $chan -relay
putserv "NOTICE $nick :Done."
}
list {
set list [channel get $chan relay-victim]
putserv "NOTICE $nick :Relay victim list:"
foreach {a b c d e f g} $list {
putserv "NOTICE $nick :$a $b $c $d $e $f $g"
}
putserv "NOTICE $nick :End of list."
}
add {
set add [string tolower [lindex $arg 1]];
if {[lsearch [string tolower [channel get $chan relay-victim]] $add] < 0} {
set list "[channel get $chan relay-victim] $add";
channel set $chan relay-victim $list
putserv "NOTICE $nick :Done.";
} else {
putserv "NOTICE $nick :Victim is already in list.";
}
}
del {
set del [string tolower [lindex $arg 1]];
if {[lsearch [string tolower [channel get $chan relay-victim]] $del] >= 0} {
set list [channel get $chan relay-victim];
set newlist "";
foreach victim $list {
if {$victim != $del} {
set newlist "$newlist $victim";
}
}
channel set $chan relay-victim $newlist
putserv "NOTICE $nick :Done.";
} else {
putserv "NOTICE $nick :Victim is not in list.";
}
}
default {
putserv "NOTICE $nick :Syntax: $::lastbind ON/OFF/LIST/ADD/DEL"
}
}
}
#************* relay messages *****************#
# join message
bind JOIN - * relay:join;
proc relay:join {nick host hand chan} {
if {[channel get $chan relay] && ![isbotnick $nick]} {
set relay [channel get $chan relay-victim]
if {$relay != ""} {
foreach r $relay {
puthelp "PRIVMSG $r :\[$chan\] —› join: \002(\002$nick\002)\002 \002(\002$host\002)\002"
}
}
}
}
# part message
bind PART - * relay:part;
proc relay:part {nick host hand chan message} {
if {[channel get $chan relay] && ![isbotnick $nick]} {
set relay [channel get $chan relay-victim]
if {$message == ""} {
set message "no such message";
}
if {$relay != ""} {
foreach r $relay {
puthelp "PRIVMSG $r :\[$chan\] —› part: \002(\002$nick\002)\002 \002(\002$host\002)\002 \002(\002$message\002)\002"
}
}
}
}
# public message
bind PUBM - * relay:pubm;
proc relay:pubm {nick host hand chan arg} {
if {[channel get $chan relay] && ![isbotnick $nick]} {
set access "";
if {[isop $nick $chan]} {
set access "@";
} elseif {[isvoice $nick $chan]} {
set access "+";
}
set relay [channel get $chan relay-victim]
if {$relay != ""} {
foreach r $relay {
puthelp "PRIVMSG $r :\[$chan\] \002(\002$access$nick\002)\002 $arg"
}
}
}
}
# quit message
bind SIGN - * relay:sign;
proc relay:sign {nick host hand chan reason} {
if {[channel get $chan relay] && ![isbotnick $nick]} {
set relay [channel get $chan relay-victim]
if {$reason== ""} {
set reason "Signed Off";
}
if {$relay != ""} {
foreach r $relay {
puthelp "PRIVMSG $r :\[$chan\] —› quit: \002(\002$nick\002)\002 \002(\002$host\002)\002 \002(\002$reason\002)\002"
}
}
}
}
# topic message
bind TOPC - * relay:topic;
proc relay:topic {nick host hand chan topic} {
if {[onchan $nick $chan]} {
if {[channel get $chan relay] && ![isbotnick $nick]} {
set relay [channel get $chan relay-victim]
if {$relay != ""} {
foreach r $relay {
puthelp "PRIVMSG $r :\[$chan\] —› topic: \002(\002$nick\002)\002 changes topic to \002(\002$topic\002)\002"
}
}
}
}
}
# kick message
bind KICK - * relay:kick;
proc relay:kick {nick host hand chan victim reason} {
if {[channel get $chan relay] && ![isbotnick $nick]} {
set relay [channel get $chan relay-victim]
if {$relay != ""} {
foreach r $relay {
puthelp "PRIVMSG $r :\[$chan\] —› kick: \002(\002$victim\002)\002 was kicked by \002(\002$nick\002)\002 \002(\002$reason\002)\002"
}
}
}
}
# channel modes
bind RAW - MODE relay:mode;
proc relay:mode {from key text} {
set text [split $text];
set nick [lindex [split $from !] 0]
set host [lindex [split $from !] 1]
set chan [lindex $text 0]
set mode [join [lrange $text 1 end]]
if {[validchan $chan] && [channel get $chan relay] && ![isbotnick $nick]} {
set relay [channel get $chan relay-victim]
if {$relay != ""} {
foreach r $relay {
puthelp "PRIVMSG $r :\[$chan\] —› mode: \002(\002$nick\002)\002 sets \002(\002$mode\002)\002"
}
}
}
}
# nick message
bind NICK - * relay:nick;
proc relay:nick {nick host hand chan newnick} {
if {[validchan $chan] && [channel get $chan relay] && ![isbotnick $nick] && ![isbotnick $newnick]} {
set relay [channel get $chan relay-victim]
if {$relay != ""} {
foreach r $relay {
puthelp "PRIVMSG $r :\[$chan\] —› nick: \002(\002$nick\002)\002 is now known as \002(\002$newnick\002)\002"
}
}
}
}
# ctcp ACTION
bind CTCP - ACTION relay:action
proc relay:action {nick host hand dest key text} {
if {[validchan $dest] && [channel get $dest relay] && ![isbotnick $nick]} {
set relay [channel get $dest relay-victim]
set access "";
if {[isop $nick $dest]} {
set access "@";
} elseif {[isvoice $nick $dest]} {
set access "+";
}
if {$relay != ""} {
foreach r $relay {
puthelp "PRIVMSG $r :\[$dest\] • \002$access\002$nick $text"
}
}
}
}
putlog "Chanrelay script by YooDa loaded."