<?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/17643" />

	<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-03-08T14:09:53-04:00</updated>

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

		<entry>
		<author><name><![CDATA[ertz]]></name></author>
		<updated>2010-03-08T14:09:53-04:00</updated>

		<published>2010-03-08T14:09:53-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=92435#p92435</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=92435#p92435"/>
		<title type="html"><![CDATA[#ch talk script with random line from txt file every x min]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=92435#p92435"><![CDATA[
thank you so much Torrevado!<br>One more question, is there I way I could set time for each channel?<br><br><br><br><div class="codebox"><p>Code: </p><pre><code>set anunt(char) "!"#Here you can set what flags can use the commandset anunt(flags) "nm|MNnA"#Here you can set the time interval of the advertisementsset anunt(time) "1"#If you want the advertisements to be done by the PRIVMSG $chan method #set here "0" or if you want by the /me (action) set here "1"set anunt(how) "1"#########################################################################                         Smile Mothafucka########################################################################set own "BLaCkShaDoW"set vr "1.1"bind pub $anunt(flags) $anunt(char)an anounce:processsetudef flag announceif {![info exists announce:timer_running]} {timer $anunt(time) announce:timerset announce:timer_running 1}proc anounce:process {nick host hand chan arg} {global anuntset flag "announce"set dir "logs/an($chan).txt"set who [lindex [split $arg] 0]set message [join [lrange [split $arg] 1 end]]set number [lindex [split $arg] 1]if {[channel get $chan announce]} { set status "on" } else { set status "off" }if {$who == ""} { puthelp "NOTICE $nick :Please use $anunt(char)an &lt;on&gt; | &lt;off&gt; | &lt;add&gt; &lt;mesaj&gt; | &lt;list&gt; | &lt;del&gt; &lt;number&gt;"return 0}if {([regexp -nocase -- {(#[0-9]+|on|off|add|list|del)} $who tmp a]) &amp;&amp; (![regexp -nocase -- {\S#} $who])} {    switch $a {on {channel set $chan +$flagputhelp "NOTICE $nick :I activated the advertise system. To add an advertise just type $anunt(char)an add &lt;your advertise&gt;.You can add as many as you want"}off {channel set $chan -$flagputhelp "NOTICE $nick :I deactivated the advertise system."}add {if {$message == ""} { puthelp "NOTICE $nick :Please use $anunt(char)an add &lt;your advertise&gt;"return 0}if {$status == "off" } { puthelp "NOTICE $nick :First you have to activate the advertise system by typing $anunt(char)an on"return 0}if {[file exists $dir] == 0} {set file [open $dir a]close $file}set file [open $dir a]puts $file $messageclose $fileputhelp "NOTICE $nick :Added an advertise for $chan:"puthelp "NOTICE $nick :$message"}list {if {$status == "off" } { puthelp "NOTICE $nick :First you have to activate the advertise system by typing $anunt(char)an on"return 0}if {[file exists $dir] == 0} {set file [open $dir a]close $file}set dir "logs/an($chan).txt"set file [open $dir "r"]set w [read -nonewline $file]close $fileset data [split $w "\n"]set i 0if {$data == ""} { puthelp "NOTICE $nick :There are no advertisements for $chan"return 0}foreach mes $data {set i [expr $i +1]puthelp "NOTICE $nick :The advertisements list for $chan is:"puthelp "NOTICE $nick :$i. $mes"}}del {if {$message == ""} { puthelp "NOTICE $nick :Please use $anunt(char)an del &lt;number&gt;. To list the advertisements type $anunt(char)an list"return 0}if {$status == "off" } { puthelp "NOTICE $nick :First you have to activate the advertise system by typing $anunt(char)an on"return 0}set dir "logs/an($chan).txt"if {[file exists $dir] == 0} {set file [open $dir a]close $file}set file [open $dir "r"]set data [read -nonewline $file]close $fileset lines [split $data "\n"]set i [expr $number - 1]set delete [lreplace $lines $i $i]set files [open $dir "w"]puts $files [join $delete "\n"]close $filesputhelp "NOTICE $nick :Deleted the advertisement number :$number for $chan."puthelp "NOTICE $nick :Please check if i am right by typing $anunt(char)an list"}}}}proc announce:timer {} {global anuntforeach chan [channels] {set dir "logs/an($chan).txt"if {[channel get $chan announce]} {if {[file exists $dir] == 0} {set file [open $dir a]close $file}set file [open $dir "r"]set data [read -nonewline $file]close $fileset lines [split $data "\n"]set numlines [llength $lines]set random [rand $numlines]set randomline [lindex $lines $random]if {$anunt(how) == "1"} {puthelp "PRIVMSG $chan :\001ACTION $randomline\001"} else { puthelp "PRIVMSG $chan :$randomline"}}}timer $anunt(time) announce:timerreturn 1}putlog "BlackAdvertise Tcl $vr by $own Loaded"</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11131">ertz</a> — Mon Mar 08, 2010 2:09 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Torrevado]]></name></author>
		<updated>2010-03-07T13:49:08-04:00</updated>

		<published>2010-03-07T13:49:08-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=92419#p92419</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=92419#p92419"/>
		<title type="html"><![CDATA[Re: #ch talk script with random line from txt file every x m]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=92419#p92419"><![CDATA[
<blockquote class="uncited"><div>I  need a script that is going to read a random line from text file and post it in the #chan every xx min.</div></blockquote>From egghelp Tcl Archive: <a href="http://www.egghelp.org/tclhtml/3478-4-0-0-1-advertisement.htm" class="postlink">http://www.egghelp.org/tclhtml/3478-4-0 ... sement.htm</a><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8047">Torrevado</a> — Sun Mar 07, 2010 1:49 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ertz]]></name></author>
		<updated>2010-03-07T13:40:48-04:00</updated>

		<published>2010-03-07T13:40:48-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=92418#p92418</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=92418#p92418"/>
		<title type="html"><![CDATA[#ch talk script with random line from txt file every x min]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=92418#p92418"><![CDATA[
Hello everybody,<br>I was browsing for this script for a while now... Maybe it's somewhere there, but i missed it. <br><br>I  need a script that is going to read a random line from text file and post it in the #chan every xx min.<br><br>I would use it to show some interesting facts into the chan. I did used the on join script, when the scripts posts random line on join, but it went to messy.<br><br>Thank You!<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11131">ertz</a> — Sun Mar 07, 2010 1:40 pm</p><hr />
]]></content>
	</entry>
	</feed>
