| View previous topic :: View next topic |
| Author |
Message |
Dunn Voice
Joined: 28 Jan 2006 Posts: 5
|
Posted: Sat Mar 18, 2006 3:15 pm Post subject: Topic Relay Script |
|
|
| 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). |
|
| Back to top |
|
 |
CuteBangla Halfop
Joined: 27 Feb 2006 Posts: 58 Location: Dhaka, Bangladesh
|
Posted: Tue Mar 21, 2006 10:59 am Post subject: Re: Topic Relay Script |
|
|
use a relay script
any relay script
like clink relay & add those line
| Code: |
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: | 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] _________________ SuMiT
iRC.CuteBangla.Com
Last edited by CuteBangla on Wed Apr 19, 2006 4:46 pm; edited 1 time in total |
|
| Back to top |
|
 |
mr_hanky Voice
Joined: 19 Apr 2006 Posts: 4
|
Posted: Wed Apr 19, 2006 10:56 am Post subject: |
|
|
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? |
|
| Back to top |
|
 |
CuteBangla Halfop
Joined: 27 Feb 2006 Posts: 58 Location: Dhaka, Bangladesh
|
Posted: Wed Apr 19, 2006 2:50 pm Post subject: |
|
|
mayb this will help you
| Code: | 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
} |
_________________ SuMiT
iRC.CuteBangla.Com |
|
| Back to top |
|
 |
mr_hanky Voice
Joined: 19 Apr 2006 Posts: 4
|
Posted: Wed Apr 19, 2006 4:24 pm Post subject: |
|
|
| should i use that script on its own? or add it to an existing script? (for example, clink.tcl in the 2nd post..) |
|
| Back to top |
|
 |
CuteBangla Halfop
Joined: 27 Feb 2006 Posts: 58 Location: Dhaka, Bangladesh
|
Posted: Wed Apr 19, 2006 4:35 pm Post subject: |
|
|
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..) |
_________________ SuMiT
iRC.CuteBangla.Com |
|
| Back to top |
|
 |
mr_hanky Voice
Joined: 19 Apr 2006 Posts: 4
|
Posted: Wed Apr 19, 2006 4:56 pm Post subject: |
|
|
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? |
|
| Back to top |
|
 |
CuteBangla Halfop
Joined: 27 Feb 2006 Posts: 58 Location: Dhaka, Bangladesh
|
Posted: Wed Apr 19, 2006 5:07 pm Post subject: |
|
|
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? |
_________________ SuMiT
iRC.CuteBangla.Com |
|
| Back to top |
|
 |
mr_hanky Voice
Joined: 19 Apr 2006 Posts: 4
|
|
| Back to top |
|
 |
CuteBangla Halfop
Joined: 27 Feb 2006 Posts: 58 Location: Dhaka, Bangladesh
|
Posted: Wed Apr 19, 2006 11:20 pm Post subject: |
|
|
mayb you ill get that by addin this in ur tcl
| Code: | 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
|
_________________ SuMiT
iRC.CuteBangla.Com |
|
| Back to top |
|
 |
xaero Voice
Joined: 10 Jun 2006 Posts: 2
|
Posted: Sat Jun 10, 2006 10:52 pm Post subject: |
|
|
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. |
|
| Back to top |
|
 |
CuteBangla Halfop
Joined: 27 Feb 2006 Posts: 58 Location: Dhaka, Bangladesh
|
|
| Back to top |
|
 |
xaero Voice
Joined: 10 Jun 2006 Posts: 2
|
Posted: Sun Jun 11, 2006 10:01 am Post subject: |
|
|
| 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. |
|
| Back to top |
|
 |
CuteBangla Halfop
Joined: 27 Feb 2006 Posts: 58 Location: Dhaka, Bangladesh
|
Posted: Sun Mar 18, 2007 7:10 am Post subject: |
|
|
| 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" _________________ SuMiT
iRC.CuteBangla.Com |
|
| Back to top |
|
 |
|