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.

Topic Relay Script

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
D
Dunn
Voice
Posts: 5
Joined: Sat Jan 28, 2006 5:07 am

Topic Relay Script

Post by Dunn »

I've searched everywhere and I can find a lot of scripts CLOSE to what I want, but I have failed in all of my attempts to modify them for my use. What I need is a script that will run on one bot and monitor several channels for topic changes and message my other eggdrop when one occurs. On the eggdrop that receives the message, I would like it to post this topic in a channel (not set the topic, just send a message with it to the channel). At least for now, the bots will not need to work on seperate networks, so just messaging from one bot to another should work fine (as opposed to using a botnet or anything).
C
CuteBangla
Halfop
Posts: 58
Joined: Mon Feb 27, 2006 10:47 pm
Location: Dhaka, Bangladesh
Contact:

Re: Topic Relay Script

Post by CuteBangla »

use a relay script
any relay script
like clink relay & add those line

Code: Select all

bind topc - * clink_topc

proc clink_topc {nick uhost hand chan text} {
	global clink_onchan network
	if {[info exist clink_onchan($chan@$network)]} {
		clink_botsend $chan [concat "topc" [clink_cleannick $nick] $text]
	}
}
& replace the following part in proc clink_botdat part

Code: Select all

proc clink_botdat {bot clink param} {
	global clink_relaynet clink_color clink_charmsgs clink_relayto clink_add network
	if {$clink_relaynet == 1} {
		set clink_network "\[[lindex $param 1]\] "
	} else {
		set clink_network ""
	}
	if {[lrange $param 5 end] != ""} {
		set reason "\([lrange $param 5 end]\)"
	} else {
		set reason ""
	}
	set clink_destchan [lindex [split [lindex $clink_relayto([lindex $param 0]@[lindex $param 1]) [lsearch -glob $clink_relayto([lindex $param 0]@[lindex $param 1]) "*@$network"]] @] 0]
	switch [lindex $param 2] {
		pubm	{ putserv "PRIVMSG $clink_destchan :$clink_network$clink_color(pubm)[lindex $clink_charmsgs 0][lindex $param 3][lindex $clink_charmsgs 1] [lrange $param 4 end]" }
		topc	{ putserv "PRIVMSG $clink_destchan :$clink_network$clink_color(topc)[lindex $clink_charmsgs 0][lindex $clink_add][lindex $clink_charmsgs 1] [lrange $param 4 end]" }
		default { putlog "Relay: Warning: unknown action type "[lindex $param 2]" for [lindex $param 0]." }
	}
}
Moderator (Alchera) note: Please use code tags when posting code in future.

Dunn wrote:I've searched everywhere and I can find a lot of scripts CLOSE to what I want, but I have failed in all of my attempts to modify them for my use. What I need is a script that will run on one bot and monitor several channels for topic changes and message my other eggdrop when one occurs. On the eggdrop that receives the message, I would like it to post this topic in a channel (not set the topic, just send a message with it to the channel). At least for now, the bots will not need to work on seperate networks, so just messaging from one bot to another should work fine (as opposed to using a botnet or anything).
[/code]
Last edited by CuteBangla on Wed Apr 19, 2006 4:46 pm, edited 1 time in total.
m
mr_hanky
Voice
Posts: 4
Joined: Wed Apr 19, 2006 10:27 am

Post by mr_hanky »

im looking for a script that does the exact same thing, except watches for changes on one network (quakenet), and the message is passed onto another bot on another server (Efnet)..

would this code work for that?
C
CuteBangla
Halfop
Posts: 58
Joined: Mon Feb 27, 2006 10:47 pm
Location: Dhaka, Bangladesh
Contact:

Post by CuteBangla »

mayb this will help you

Code: Select all

set link_botnicks {"BOT1" "BOT2"}

set link_onchan(#room@Quakenet) "BOT1"
set link_onchan(#room@EFNet) "BOT1""

set link_relayto(#room@Quakenet) {"#room@EFNet"}

set link_usecolor 1

set link_relaynet 0

set link_charmsgs {"[" "]"}

bind topc - * link_topc
bind bot - link link_botdat

if {$link_usecolor == 1} {
	set link_color(topc) ""
} else {
        set link_color(tops) ""
}

if {${botnet-nick} == ""} {
	set {botnet-nick} $nick
	putlog "Warning: botnet-nick not defined in .conf file, using \"$nick\"."
}
if {[lsearch $link_botnicks ${botnet-nick}] == -1} {
	putlog "Fatal: Bot \"${botnet-nick}\" not defined in link_botnicks. Please edit link.tcl and check your configuration."
}
if {$network == "unknown-net"} {
	putlog "Warning: network not defined in .conf file, using \"unknown-net\"."
}

proc link_botsend {chan param} {
	global link_onchan {botnet-nick} network link_relayto
	foreach link_relaychan $link_relayto($chan@$network) {
		if {[lsearch -exact [bots] $link_onchan($link_relaychan)] == -1} {
			putlog "link.tcl: Warning: bot $link_onchan($link_relaychan) not linked."
		} else {
			putbot $link_onchan($link_relaychan) "link $chan $network $param"
		}
	}
}
proc link_topc {nick uhost hand chan text} { 
   global link_onchan network 
   if {[info exist link_onchan($chan@$network)]} { 
      link_botsend $chan [concat "topc" [link_cleannick $nick] $text] 
   } 
} 
proc link_botdat {bot link param} { 
   global link_relaynet link_color link_charmsgs link_relayto link_add network 
   if {$link_relaynet == 1} { 
      set link_network "\[[lindex $param 1]\] " 
   } else { 
      set link_network "" 
   } 
   if {[lrange $param 5 end] != ""} { 
      set reason "\([lrange $param 5 end]\)" 
   } else { 
      set reason "" 
   } 
   set link_destchan [lindex [split [lindex $link_relayto([lindex $param 0]@[lindex $param 1]) [lsearch -glob $link_relayto([lindex $param 0]@[lindex $param 1]) "*@$network"]] @] 0] 
   switch [lindex $param 2] { 
      topc   { putserv "TOPICS $link_destchan :$link_network$link_color(topc)[lindex $link_charmsgs 0][lindex $link_add][lindex $link_charmsgs 1] [lrange $param 4 end]" } 
      default { putlog "Relay: Warning: unknown action type \"[lindex $param 2]\" for [lindex $param 0]." } 
   } 
} 
proc link_cleannick {nick} {
	if {[string range $nick 0 0] == "\{"} {
		set nick "\\$nick"
	}
        return $nick
}
m
mr_hanky
Voice
Posts: 4
Joined: Wed Apr 19, 2006 10:27 am

Post by mr_hanky »

should i use that script on its own? or add it to an existing script? (for example, clink.tcl in the 2nd post..)
C
CuteBangla
Halfop
Posts: 58
Joined: Mon Feb 27, 2006 10:47 pm
Location: Dhaka, Bangladesh
Contact:

Post by CuteBangla »

if u use clink.tcl then u have to follow the second post
or if do dont use anyother then u can use last post

mr_hanky wrote:should i use that script on its own? or add it to an existing script? (for example, clink.tcl in the 2nd post..)
m
mr_hanky
Voice
Posts: 4
Joined: Wed Apr 19, 2006 10:27 am

Post by mr_hanky »

I was using relay.tcl, to send messages and actions from one channel to another, but it didnt give any information about topic changes...

ive added what you posted as a script, and made changes.. but it didnt seem to work.. i may be at fault and not changed the correct things.. but my question is, is it okay to run your script (posted above) and relay.tcl at the same time?
C
CuteBangla
Halfop
Posts: 58
Joined: Mon Feb 27, 2006 10:47 pm
Location: Dhaka, Bangladesh
Contact:

Post by CuteBangla »

which relay script ur useing ??

please paste that script

mr_hanky wrote:I was using relay.tcl, to send messages and actions from one channel to another, but it didnt give any information about topic changes...

ive added what you posted as a script, and made changes.. but it didnt seem to work.. i may be at fault and not changed the correct things.. but my question is, is it okay to run your script (posted above) and relay.tcl at the same time?
m
mr_hanky
Voice
Posts: 4
Joined: Wed Apr 19, 2006 10:27 am

Post by mr_hanky »

the script is here:

http://www.egghelp.org/cgi-bin/tcl_arch ... oad&id=290

i dont think i would be allowed to paste it here, seems to be quite long..
C
CuteBangla
Halfop
Posts: 58
Joined: Mon Feb 27, 2006 10:47 pm
Location: Dhaka, Bangladesh
Contact:

Post by CuteBangla »

mayb you ill get that by addin this in ur tcl

Code: Select all

proc send_topc {nick uhost hand chan text} {
  send_across "topc" $chan $text
}
bind topc - * send_topc

proc recv_topc {frm_bot command arg} {
  putserv "TOPICS [lindex $arg 0] :\[[lindex $arg 1]\] [lrange $arg 2 end]"
}
bind bot - topc recv_topc
x
xaero
Voice
Posts: 2
Joined: Sat Jun 10, 2006 10:47 pm

Post by xaero »

I like most others have been searching and searching for a relay script for multiple bots and multiple networks/channels.

At the moment I have 4 bots, 3 are in 3 channels on 3 networks, 1 bot is the central hub bot, he sits on a private network just so he has a place to be.

The scripts I have come across all seem to duplex everything to every channel and I don't want nor need that .... #chan1 <-> #chan1 on all networks is the idea.
C
CuteBangla
Halfop
Posts: 58
Joined: Mon Feb 27, 2006 10:47 pm
Location: Dhaka, Bangladesh
Contact:

Post by CuteBangla »

Last edited by CuteBangla on Sun Jun 11, 2006 1:03 pm, edited 1 time in total.
x
xaero
Voice
Posts: 2
Joined: Sat Jun 10, 2006 10:47 pm

Post by xaero »

that links redirects me to http://www.egghelp.org/tcl.htm and I've downloaded all the ones that are found in the database, non e work the way I need them to.
C
CuteBangla
Halfop
Posts: 58
Joined: Mon Feb 27, 2006 10:47 pm
Location: Dhaka, Bangladesh
Contact:

Post by CuteBangla »

xaero wrote:that links redirects me to http://www.egghelp.org/tcl.htm and I've downloaded all the ones that are found in the database, non e work the way I need them to.
ya search with "channel link"
Post Reply