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.

chanrelay.tcl

Old posts that have not been replied to for several years.
T
TurboChicken
Halfop
Posts: 61
Joined: Wed Sep 29, 2004 3:18 pm

chanrelay.tcl

Post by TurboChicken »

i've got a problem with the chanrelay.tcl script.

got the botnet up...
got one bot "turbo" on irc.blah.net on channel #gumballs
got another bot "chicken" on irc.poultry.net on channel #sweets

i only want it to mirror from #gumballs to #sweets and not the other way.

i can't this script to do anything.....

here's what i have so far

Code: Select all

## CONFIGURATION ##

# Fill the values as you want but don't forget to keep the same order between each array.
set eggdrops {"turbo"}
set chans {"#gumballs"}
set networks {"blah"}
# Remember that all is case sensitive, so don't write DuMmY if your eggdrop is named dummy :)

# Do you want to use bold (1), underline (2) or nothing (0) to higtlight nicknames ?
set high "1"

# Do yo want to indicate from wich network comes the message (y/n)?
set snet "n"

# Do you want the bot transmit actions from the channel (y/n)?
set transmit "n"; # default value is yes

# Do you want the bot recept actions (y/n)?
set receive "y"; # default value is yes

# transmission configuration
set trans_pub "y"; # transmit the pub
set trans_act "n"; # transmit the actions (/me)
set trans_nick "n"; # transmit the nick changement
set trans_join "n"; # transmit the join
set trans_part "n"; # transmit the part
set trans_quit "n"; # transmit the quit
set trans_topic "n"; # transmit the topic changements
set trans_kick "n"; # transmit the kicks
set trans_mode "n"; #transmit the mode changements

# reception configuration
set recv_pub "n"; # recept the pub
set recv_act "n"; # recept the actions (/me)
set recv_nick "n"; # recept the nick changement
set recv_join "n"; # recept the join
set recv_part "n"; # recept the part
set recv_quit "n"; # recept the quit
set recv_topic "n"; # recept the topic changements
set recv_kick "n"; # recept the kicks
set recv_mode "n"; #recept the mode changements
that's on turbo

and...

Code: Select all

## CONFIGURATION ##

# Fill the values as you want but don't forget to keep the same order between each array.
set eggdrops {"chicken"}
set chans {"#sweets"}
set networks {"poultry"}
# Remember that all is case sensitive, so don't write DuMmY if your eggdrop is named dummy :)

# Do you want to use bold (1), underline (2) or nothing (0) to higtlight nicknames ?
set high "1"

# Do yo want to indicate from wich network comes the message (y/n)?
set snet "n"

# Do you want the bot transmit actions from the channel (y/n)?
set transmit "y"; # default value is yes

# Do you want the bot recept actions (y/n)?
set receive "n"; # default value is yes

# transmission configuration
set trans_pub "y"; # transmit the pub
set trans_act "n"; # transmit the actions (/me)
set trans_nick "n"; # transmit the nick changement
set trans_join "n"; # transmit the join
set trans_part "n"; # transmit the part
set trans_quit "n"; # transmit the quit
set trans_topic "n"; # transmit the topic changements
set trans_kick "n"; # transmit the kicks
set trans_mode "n"; #transmit the mode changements

# reception configuration
set recv_pub "y"; # recept the pub
set recv_act "n"; # recept the actions (/me)
set recv_nick "n"; # recept the nick changement
set recv_join "n"; # recept the join
set recv_part "n"; # recept the part
set recv_quit "n"; # recept the quit
set recv_topic "n"; # recept the topic changements
set recv_kick "n"; # recept the kicks
set recv_mode "n"; #recept the mode changements
and that is on chicken...

anyone any idea what i am doing wrong or can they suggest a better script for it??? ideally i want to be able to set it to only a certain nick being mirrored
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

you sure that it can relay one channel to another? if so, there must be a way to specify #chanA <-> #chanB relationship, and I don't see this in your config...
T
TurboChicken
Halfop
Posts: 61
Joined: Wed Sep 29, 2004 3:18 pm

Post by TurboChicken »

well the original script had this line in it

Code: Select all

set eggdrops {"eggdrop1" "eggdrop2" "eggdrop3"} 
set chans {"#channel1" "#channel2" "#channel3"} 
set networks {"network1" "network2" "network3"} 
but i removed them in each config...

i've now changed them so both say the same and it has the same in each

Code: Select all

set eggdrops {"turbo" "chicken"}
set chans {"#gumballs" "#sweets"}
set networks {"blah" "poultry"} 
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

these are lists that don't neccessary imply certain 1-to-1 relationship I was talking about - I'd presume the chans list simply specifies which channels are to be relayed, not pairs of linked channels
T
TurboChicken
Halfop
Posts: 61
Joined: Wed Sep 29, 2004 3:18 pm

Post by TurboChicken »

in that case then i don't know what i need to change... as far as i could read that is what the script does. i got it off this website.

i would prefer if someone who has some time would write me one.

preferably i would like it to parse what is said in one channel before it outputs it to another

(extract_data1)-››-[extract_data2]

and then have some way to format the output.

if someone has the time i would very much like a script that would do that
User avatar
user
&nbsp;
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

?

Post by user »

TurboChicken wrote:preferably i would like it to parse what is said in one channel before it outputs it to another

(extract_data1)-››-[extract_data2]

and then have some way to format the output.
How about using regexp to do the parsing? Or would you like us to invent some other kind of generic text parser? :P

Code: Select all

# in bot1 (the one listening for messages):
bind pubm R "#chan1 *" pub:relay
proc pub:relay {n u h c a} {
    # insert parsing/formatting here :P
    putbot bot2 "rmsg <$n> $a"
}

# in bot2 (the one displaying the messages):
bind bot R rmsg bot:relay
proc bot:relay {b k a} {puthelp "PRIVMSG #chan2 :$a"}
in bot1, do:
.+user relay TheNickToRelay!*@*
.chattr relay +R


in bot2:
.chattr bot1 +R

PS: make sure you change "#chan1", "#chan2" to the real channel names and "bot2" to the right botnick
Have you ever read "The Manual"?
T
TurboChicken
Halfop
Posts: 61
Joined: Wed Sep 29, 2004 3:18 pm

Post by TurboChicken »

if i just do it as a plain relay (as in no parsing etc.) atm... what should i put in?
Last edited by TurboChicken on Mon Nov 22, 2004 8:35 pm, edited 1 time in total.
User avatar
user
&nbsp;
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

TurboChicken wrote:if i just do it as a plain relay atm... what should i put in?
what do you mean by "plain" and "put in"? Try the script and see what happens?
Have you ever read "The Manual"?
T
TurboChicken
Halfop
Posts: 61
Joined: Wed Sep 29, 2004 3:18 pm

Post by TurboChicken »

/me bow to the might of user


all i need now is for someone to create the parsing and formatting side of it
User avatar
user
&nbsp;
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

TurboChicken wrote:all i need now is for someone to create the parsing and formatting side of it
Telling us what you want to parse and the desired output format would speed up that process :wink:
Have you ever read "The Manual"?
T
TurboChicken
Halfop
Posts: 61
Joined: Wed Sep 29, 2004 3:18 pm

Post by TurboChicken »

(extract_data1)-››-[extract_data2]-››-(Extract_data3)

() & [] are not included in any of the extract datas and the whole line has some colour formatting so that would need to be removed first i would think (if doesn't NEED to be removed i would like it to be if possible)... and extract_data3 doesn't always exist so some times it would say:

(extract_data1)-››-[extract_data2]

and sometimes there may be some normal chat from the user... so i don't want it to pick up that stuff

as for formatting if those can be extracting into variable i can do the rest i'm pretty sure.

i can do some TCL but i'm just learning.

so if you could tell me a good resource to learn from i could probably do it myself
User avatar
user
&nbsp;
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

Code: Select all

# in bot1 (the one listening for messages):
bind pubm R "#chan1 *›*" pub:relay
proc pub:relay {n u h c a} {
	regsub -all {\002|\026|\017|\037|\003(\d{1,2}(,\d{1,2})?)?} $a "" a
	if {[regexp {^(.+?)-››-(.+?)(?:-››-(.+?))?$} $a a data1 data2 data3]} {
		if {$data3!={}} {
			putbot bot2 "rmsg 3: $data1 | $data2 | $data3"
		} else {
			putbot bot2 "rmsg 2: $data1 | $data2"
		}
	}
}
Notice the "›" added to the bind to weed out most unwanted messages. (the regexp will weed out the rest)
Remember to get rid of the old bind by restarting/unbinding and to change the channel name and botnick :)
Have you ever read "The Manual"?
T
TurboChicken
Halfop
Posts: 61
Joined: Wed Sep 29, 2004 3:18 pm

Post by TurboChicken »

not working... no errors and i have changed bot nick and channels... and i restarted and rehashed the bot... i also tried removing the *>* part so see coz i thought i might be stopping it coz the > part is emboldened
User avatar
user
&nbsp;
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

hmm

Post by user »

TurboChicken wrote:not working... no errors and i have changed bot nick and channels... and i restarted and rehashed the bot... i also tried removing the *>* part so see coz i thought i might be stopping it coz the > part is emboldened
Might be an encoding problem...use the old bind (without the ›) and replace the ›'s in the regexp with \x9B - if that fails, try \u203A ...if that fails, replace them with dots (.)
Oh and btw: ">" is not the same char as "›" even if they look similar.
Have you ever read "The Manual"?
T
TurboChicken
Halfop
Posts: 61
Joined: Wed Sep 29, 2004 3:18 pm

Post by TurboChicken »

now it's not working at all... nothing nada... i've reverted back to the orginal one and nothing...

<EDIT> didn't know i had to re +R original is working... going to try the new ones
Locked