egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Relay Bot script

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
sober4in
Voice


Joined: 01 May 2006
Posts: 2

PostPosted: Mon May 01, 2006 4:23 pm    Post subject: Relay Bot script Reply with quote

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
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Mon May 01, 2006 7:04 pm    Post subject: Reply with quote

Search the Tcl Archive for relay.
_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
sober4in
Voice


Joined: 01 May 2006
Posts: 2

PostPosted: Mon May 01, 2006 11:50 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
CuteBangla
Halfop


Joined: 27 Feb 2006
Posts: 58
Location: Dhaka, Bangladesh

PostPosted: Thu May 04, 2006 1:20 am    Post subject: Reply with quote

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



u can try clink.tcl
http://www.egghelp.org/cgi-bin/tcl_archive.tcl?mode=download&id=586
i am useing that
_________________
SuMiT
iRC.CuteBangla.Com
Back to top
View user's profile Send private message Visit poster's website
GeeX
Voice


Joined: 19 Sep 2005
Posts: 29

PostPosted: Thu May 04, 2006 5:16 pm    Post subject: Reply with quote

For you:

Code:

#**************************************#
#*         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."
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber