<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
	<link rel="self" type="application/atom+xml" href="https://forum.eggheads.org/app.php/feed/topic/17971" />

	<title>egghelp/eggheads community</title>
	<subtitle>Discussion of eggdrop bots, shell accounts and tcl scripts.</subtitle>
	<link href="https://forum.eggheads.org/index.php" />
	<updated>2010-08-26T14:17:06-04:00</updated>

	<author><name><![CDATA[egghelp/eggheads community]]></name></author>
	<id>https://forum.eggheads.org/app.php/feed/topic/17971</id>

		<entry>
		<author><name><![CDATA[Football]]></name></author>
		<updated>2010-08-26T14:17:06-04:00</updated>

		<published>2010-08-26T14:17:06-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=94119#p94119</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=94119#p94119"/>
		<title type="html"><![CDATA[relay tcl support]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=94119#p94119"><![CDATA[
hey, could anyone modify this to relay with a designated color picked by me? would be nice if it could also scan the word.txt and relay a text that contains more than one word in the same line on word.txt, currently it scans word.txt. Please help.<br><div class="codebox"><p>Code: </p><pre><code># Set here, the channel you want the bot to listen for messages on                        set mchan "#FootballScores" # Set here, the channel you want the messages to be relayed to.                            set rchan "#EPL" # Add a word for relay bind pub n|o !addword addword # View a list of your relays bind pub o|o !relays relays # Clear all relays from words.txt bind pub o|o !relayclr msgclear # This is what searches for and relays lines bind pubm * * relay_to_chan # Delete a relay word from file bind pub n|o !delword delword proc addword {nick host hand chan text} {  global mchan     if {[string equal -nocase $chan $mchan]} {  set mfs "words.txt"         set word [join [lindex [split $text] 0]]         if {![file exists $mfs]} {             close [open $mfs w]         }         set fs [open $mfs]         set data [read -nonewline $fs]   close $fs         if {![string length $data]} {             set fs [open $mfs w]         } else {             set fs [open $mfs a]         }  puts $fs "$word"   close $fs    putserv "NOTICE $nick :Relay added: $word"     }  return } proc relays {nick host hand chan text} {     set fs [open "words.txt"]     set data [read -nonewline $fs]   close $fs     if {![string length $data]} {   putserv "NOTICE $nick :I don't currently have any messages to relay."  return 0     }   putserv "NOTICE $nick :My list of relay messages is as follows:"     set fs [open "words.txt"]   seek $fs 0 start     while {[gets $fs line] &gt;= 0} {   puthelp "NOTICE $nick :$line"     }  close $fs } proc msgclear {nick host hand chan text} {     close [open "words.txt" w] } proc relay_to_chan {nick host hand chan text} {   global mchan rchan         if {[string equal -nocase $chan $mchan]} {  set fs [open "words.txt"]    seek $fs 0 start      while {[gets $fs line] &gt;= 0} {          if {[regexp -nocase ".*$line.*" [join [lrange [split $text] 0 end]] match]} {    putserv "PRIVMSG $rchan :$match"          }    }  close $fs  return         }  return } proc delword {nick host hand chan text} {  global mchan     if {[string equal -nocase $chan $mchan]} {  set word [lindex [split $text] 0]  set fs [open "words.txt"]  set words [split [read -nonewline $fs] \n]    close $fs  set match [lsearch -exact $words $word]  set fs [open "words.txt" w]  set newwords [lreplace $words $match $match]    puts $fs [join $newwords "\n"]    close $fs     putserv "NOTICE $nick :Relay deleted: $word."     }    return } </code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10393">Football</a> — Thu Aug 26, 2010 2:17 pm</p><hr />
]]></content>
	</entry>
	</feed>
