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]
}
}
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]." }
}
}
[/code]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: 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
}
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?
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
ya search with "channel link"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.