This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Relay Chan1 & Chan2 to Chan3 on 1 eggdrop & 1 server

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
m
mvp1
Voice
Posts: 22
Joined: Thu Jan 27, 2022 4:28 am

Relay Chan1 & Chan2 to Chan3 on 1 eggdrop & 1 server

Post by mvp1 »

Hi Guys,

I am after something very simple. I have an eggdrop on one server, e.g Dalnet, and I want it to join 3 channels, e.g #Chan1 , #Chan2 and #Chan3

And I want it to relay everything (chat,joins/parts etc etc) from #Chan1 and #Chan2 into #Chan3

Is there anything already available? Of if anyone can help with a simple TCL code please?

Many thanks in advance.
User avatar
CrazyCat
Revered One
Posts: 1234
Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:

Post by CrazyCat »

Here is a simple script (untested) for relaying pub, join and part, feel free to add others (kicks, quits, act, ...):

Code: Select all

namespace eval spy {
   variable src {"#chan1" "#chan2"}
   variable dest "#chan3"

   bind pubm - * ::spy::spub
   proc spub {nick uhost handle chan text} {
      if {[lsearch -nocase $::spy::src $chan]==-1} { return }
      putserv "PRIVMSG $::spy::dest :${nick}${chan}> $text"
   }

   bind join - * ::spy::sjoin
   proc sjoin {nick uhost handle chan} {
      if {[lsearch -nocase $::spy::src $chan]==-1} { return }
      putserv "PRIVMSG $::spy::dest :--> $nick joined $chan"
   }

   bind part - * ::spy::spart
   proc spart {nick uhost handle chan reason} {
      if {[lsearch -nocase $::spy::src $chan]==-1} { return }
      putserv "PRIVMSG $::spy::dest :<-- $nick leaved $chan ($reason)"
   }
}
User avatar
mabrook
Halfop
Posts: 60
Joined: Mon Jun 14, 2021 9:41 am

Post by mabrook »

This is working 99%, tested.
User avatar
mabrook
Halfop
Posts: 60
Joined: Mon Jun 14, 2021 9:41 am

Post by mabrook »

@CrazyCat

can you please add on/off for the script.


chanset #channel -spy
chanset #channel +spy



thank you.
User avatar
CrazyCat
Revered One
Posts: 1234
Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:

Post by CrazyCat »

This changes a little bit the way the script will work:

Code: Select all

namespace eval spy {

   setudef flag spy
   variable dest "#chan3"

   bind pubm - * ::spy::spub
   proc spub {nick uhost handle chan text} {
      if {![channel get $chan spy]} { return }
      putserv "PRIVMSG $::spy::dest :${nick}${chan}> $text"
   }

   bind join - * ::spy::sjoin
   proc sjoin {nick uhost handle chan} {
      if {![channel get $chan spy]} { return }
      putserv "PRIVMSG $::spy::dest :--> $nick joined $chan"
   }

   bind part - * ::spy::spart
   proc spart {nick uhost handle chan reason} {
      if {![channel get $chan spy]} { return }
      putserv "PRIVMSG $::spy::dest :<-- $nick leaved $chan ($reason)"
   }
}
Now, you can activate the spy on any channel you want, and deactivate it.

Think to never do a .chanset #chan3 +spy (when #chan3 is the destination channel)
User avatar
mabrook
Halfop
Posts: 60
Joined: Mon Jun 14, 2021 9:41 am

Post by mabrook »

thank you.. it is working ..
Post Reply