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

	<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>2006-04-07T02:43:35-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Alchera]]></name></author>
		<updated>2006-04-07T02:43:35-04:00</updated>

		<published>2006-04-07T02:43:35-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=61712#p61712</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=61712#p61712"/>
		<title type="html"><![CDATA[Slap with subject read from file]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=61712#p61712"><![CDATA[
Utilising the following should work; edit as required:<div class="codebox"><p>Code: </p><pre><code>set slap "./slap.txt"set slapmsg [string range [randomline $slap] 0 end]# Insert your own procedure.proc randomline { filename } {  set position [rand [expr [file size $filename] - 1024]]  set fd [open $filename r]  catch {    seek $fd $position    set text [read $fd 1024]  }  close $fd  set lines [split $text \n]  set lineno [randrange 1 [expr [llength $lines] - 1]]  return [lindex $lines $lineno]}</code></pre></div>Of course you'd have already created "slap.txt" in the ~scripts folder and inserted your own custom messages.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3646">Alchera</a> — Fri Apr 07, 2006 2:43 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[starpossen]]></name></author>
		<updated>2006-04-06T23:45:35-04:00</updated>

		<published>2006-04-06T23:45:35-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=61707#p61707</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=61707#p61707"/>
		<title type="html"><![CDATA[Slap with subject read from file]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=61707#p61707"><![CDATA[
I got this slap:<div class="codebox"><p>Code: </p><pre><code>bind pub o- .slap slap:targetproc slap:target {nick uhost hand chan arg} {set target "[lindex [split $arg] 0]" ; set reason "[join [lrange [split $arg] 1 end]]"putserv "PRIVMSG $chan :\001ACTION slaps $target around with a hord of bots!! $reason\001"}</code></pre></div>Is there anyway I could make it read from a file containing various stuff for the slap subject?<br>I mean if I type .slap nick around with &lt;the stuf from the file&gt;<br>it would then read from a file random.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7219">starpossen</a> — Thu Apr 06, 2006 11:45 pm</p><hr />
]]></content>
	</entry>
	</feed>
