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 

Topic Relay Script

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


Joined: 28 Jan 2006
Posts: 5

PostPosted: Sat Mar 18, 2006 3:15 pm    Post subject: Topic Relay Script Reply with quote

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
View user's profile Send private message
CuteBangla
Halfop


Joined: 27 Feb 2006
Posts: 58
Location: Dhaka, Bangladesh

PostPosted: Tue Mar 21, 2006 10:59 am    Post subject: Re: Topic Relay Script Reply with quote

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
View user's profile Send private message Visit poster's website
mr_hanky
Voice


Joined: 19 Apr 2006
Posts: 4

PostPosted: Wed Apr 19, 2006 10:56 am    Post subject: Reply with quote

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
View user's profile Send private message
CuteBangla
Halfop


Joined: 27 Feb 2006
Posts: 58
Location: Dhaka, Bangladesh

PostPosted: Wed Apr 19, 2006 2:50 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
mr_hanky
Voice


Joined: 19 Apr 2006
Posts: 4

PostPosted: Wed Apr 19, 2006 4:24 pm    Post subject: Reply with quote

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
View user's profile Send private message
CuteBangla
Halfop


Joined: 27 Feb 2006
Posts: 58
Location: Dhaka, Bangladesh

PostPosted: Wed Apr 19, 2006 4:35 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
mr_hanky
Voice


Joined: 19 Apr 2006
Posts: 4

PostPosted: Wed Apr 19, 2006 4:56 pm    Post subject: Reply with quote

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
View user's profile Send private message
CuteBangla
Halfop


Joined: 27 Feb 2006
Posts: 58
Location: Dhaka, Bangladesh

PostPosted: Wed Apr 19, 2006 5:07 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
mr_hanky
Voice


Joined: 19 Apr 2006
Posts: 4

PostPosted: Wed Apr 19, 2006 6:01 pm    Post subject: Reply with quote

the script is here:

http://www.egghelp.org/cgi-bin/tcl_archive.tcl?mode=download&id=290

i dont think i would be allowed to paste it here, seems to be quite long..
Back to top
View user's profile Send private message
CuteBangla
Halfop


Joined: 27 Feb 2006
Posts: 58
Location: Dhaka, Bangladesh

PostPosted: Wed Apr 19, 2006 11:20 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
xaero
Voice


Joined: 10 Jun 2006
Posts: 2

PostPosted: Sat Jun 10, 2006 10:52 pm    Post subject: Reply with quote

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
View user's profile Send private message
CuteBangla
Halfop


Joined: 27 Feb 2006
Posts: 58
Location: Dhaka, Bangladesh

PostPosted: Sun Jun 11, 2006 1:16 am    Post subject: Reply with quote

Relay & Chan Link
_________________
SuMiT
iRC.CuteBangla.Com


Last edited by CuteBangla on Sun Jun 11, 2006 1:03 pm; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
xaero
Voice


Joined: 10 Jun 2006
Posts: 2

PostPosted: Sun Jun 11, 2006 10:01 am    Post subject: Reply with quote

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
View user's profile Send private message
CuteBangla
Halfop


Joined: 27 Feb 2006
Posts: 58
Location: Dhaka, Bangladesh

PostPosted: Sun Mar 18, 2007 7:10 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
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