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 Chan1 & Chan2 to Chan3 on 1 eggdrop & 1 server

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


Joined: 27 Jan 2022
Posts: 22

PostPosted: Thu Jul 07, 2022 1:19 am    Post subject: Relay Chan1 & Chan2 to Chan3 on 1 eggdrop & 1 server Reply with quote

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


Joined: 13 Jan 2002
Posts: 1074
Location: France

PostPosted: Thu Jul 07, 2022 3:06 am    Post subject: Reply with quote

Here is a simple script (untested) for relaying pub, join and part, feel free to add others (kicks, quits, act, ...):
Code:
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)"
   }
}

_________________
https://www.eggdrop.fr - French IRC network
Offer me a coffee - Do not ask me help in PM, we are a community.
Back to top
View user's profile Send private message Visit poster's website
mabrook
Halfop


Joined: 14 Jun 2021
Posts: 60

PostPosted: Sun Jul 24, 2022 3:19 am    Post subject: Reply with quote

This is working 99%, tested.
Back to top
View user's profile Send private message
mabrook
Halfop


Joined: 14 Jun 2021
Posts: 60

PostPosted: Mon Jul 25, 2022 7:52 am    Post subject: Reply with quote

@CrazyCat

can you please add on/off for the script.


chanset #channel -spy
chanset #channel +spy



thank you.
Back to top
View user's profile Send private message
CrazyCat
Revered One


Joined: 13 Jan 2002
Posts: 1074
Location: France

PostPosted: Mon Jul 25, 2022 10:35 am    Post subject: Reply with quote

This changes a little bit the way the script will work:
Code:
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)
_________________
https://www.eggdrop.fr - French IRC network
Offer me a coffee - Do not ask me help in PM, we are a community.
Back to top
View user's profile Send private message Visit poster's website
mabrook
Halfop


Joined: 14 Jun 2021
Posts: 60

PostPosted: Tue Jul 26, 2022 1:06 am    Post subject: Reply with quote

thank you.. it is working ..
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