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

	<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>2009-10-11T17:50:24-04:00</updated>

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

		<entry>
		<author><name><![CDATA[lenooxx]]></name></author>
		<updated>2009-10-11T17:50:24-04:00</updated>

		<published>2009-10-11T17:50:24-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=90471#p90471</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=90471#p90471"/>
		<title type="html"><![CDATA[thx]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=90471#p90471"><![CDATA[
Thank you mate ^^  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10564">lenooxx</a> — Sun Oct 11, 2009 5:50 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[arfer]]></name></author>
		<updated>2009-10-11T13:04:50-04:00</updated>

		<published>2009-10-11T13:04:50-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=90470#p90470</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=90470#p90470"/>
		<title type="html"><![CDATA[need help  for my pub command script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=90470#p90470"><![CDATA[
!addcommand == add a command<br>!delcommand == delete a command<br>!listcommand == list all commands<br>!command == output a random command<br><br>make sure you deleted any command.txt from your earlier scripting efforts<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5705">arfer</a> — Sun Oct 11, 2009 1:04 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[lenooxx]]></name></author>
		<updated>2009-10-11T12:51:10-04:00</updated>

		<published>2009-10-11T12:51:10-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=90469#p90469</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=90469#p90469"/>
		<title type="html"><![CDATA[thx]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=90469#p90469"><![CDATA[
Thank you mate !  <br><br>i added some command , but <br>strange when i typed !command  <br><br>i get only one command :s  how I can receive the list what I added ?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10564">lenooxx</a> — Sun Oct 11, 2009 12:51 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[arfer]]></name></author>
		<updated>2009-10-11T12:20:02-04:00</updated>

		<published>2009-10-11T12:20:02-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=90468#p90468</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=90468#p90468"/>
		<title type="html"><![CDATA[need help  for my pub command script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=90468#p90468"><![CDATA[
As long as the saved data isn't overly large, I find it better to keep it in memory and only write it after changes. I have done a limited amount of testing on the following script. It could be used to save/display any text.<br><div class="codebox"><p>Code: </p><pre><code># command.tcl# set here the single character command triggerset vCommandTrigger !# set here the bot user flag(s) required to add/delete commandsset vCommandFlag nproc pCommandTrigger {} {    global vCommandTrigger    return $vCommandTrigger}bind EVNT - init-server pCommandInitbind EVNT - rehash pCommandInitproc pCommandInit {type} {    pCommandRead    return 0}bind PUB $vCommandFlag [pCommandTrigger]addcommand pCommandAddbind PUB $vCommandFlag [pCommandTrigger]delcommand pCommandDelbind PUB - [pCommandTrigger]command pCommandRandbind PUB - [pCommandTrigger]listcommand pCommandListproc pCommandAdd {nick uhost hand chan text} {    global vCommandData    set command [string trim $text]    if {[string length $command] != 0} {        if {[lsearch -exact [string tolower $vCommandData] [string tolower $command]] == -1} {            lappend vCommandData $command            putserv "NOTICE $nick :command $command added"            pCommandWrite        } else {putserv "NOTICE $nick :The command $command already exists"}    }  else {putserv "NOTICE $nick :Usage [pCommandTrigger]addcommand &lt;command&gt;"}    return 0}proc pCommandDel {nick uhost hand chan text} {    global vCommandData    set command [string trim $text]    if {[string length $command] != 0} {        if {[llength $vCommandData] != 0} {            if {[set position [lsearch -exact [string tolower $vCommandData] [string tolower $command]]] != -1} {                set vCommandData [lreplace $vCommandData $position $position]                putserv "NOTICE $nick :command $command deleted"                pCommandWrite            } else {putserv "NOTICE $nick :The command $command is not currently on file"}        } else {putserv "NOTICE $nick :There are no commands currently on file"}    }  else {putserv "NOTICE $nick :Usage [pCommandTrigger]delcommand &lt;command&gt;"}    return 0}proc pCommandRand {nick uhost hand chan text} {    global vCommandData    set command [string trim $text]    if {[string length $command] == 0} {        if {[llength $vCommandData] != 0} {            putserv "PRIVMSG $chan :[lindex $vCommandData [rand [llength $vCommandData]]]"        } else {putserv "NOTICE $nick :There are no commands currently on file"}    }  else {putserv "NOTICE $nick :Usage [pCommandTrigger]command without additional arguments"}    return 0}proc pCommandList {nick uhost hand chan text} {    global vCommandData    set command [string trim $text]    if {[string length $command] == 0} {        if {[llength $vCommandData] != 0} {            foreach element $vCommandData {                putserv "NOTICE $nick :$element"            }        } else {putserv "NOTICE $nick :There are no commands currently on file"}    } else {putserv "NOTICE $nick :Usage [pCommandTrigger]listcommand without additional arguments"}    return 0}proc pCommandRead {} {    global vCommandData    if {[file exists command.txt]} {        set id [open command.txt r]        set vCommandData [split [read -nonewline $id] \n]        close $id    } else {        set vCommandData {}        pCommandWrite    }    return 0}proc pCommandWrite {} {    global vCommandData    set id [open command.txt w]    if {[llength $vCommandData] != 0} {        puts -nonewline $id [join $vCommandData \n]    }    close $id    return 0}putlog "command.tcl loaded"# eof</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5705">arfer</a> — Sun Oct 11, 2009 12:20 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[lenooxx]]></name></author>
		<updated>2009-10-11T10:43:42-04:00</updated>

		<published>2009-10-11T10:43:42-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=90467#p90467</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=90467#p90467"/>
		<title type="html"><![CDATA[need help  for my pub command script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=90467#p90467"><![CDATA[
How can i creat  addaccomand  , list , remove commands? please help me Thank you <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br><br>bind pub - !command pub:command<br>bind pub w !addcommand pub:addcommand<br><br>proc pub:addcommand { nick uhost handle channel arg } {<br>if { $arg == "" } {<br>putserv "NOTICE $nick :USAGE: !addcommand &lt;command&gt;"<br>return 0<br>}<br>set command [open "command.txt" a]<br>puts $command "$arg"<br>close $command<br>putserv "NOTICE $nick :Command Added"<br>}<br><br>proc pub:command { nick uhost handle channel arg } {<br>set commandfile [open "command.txt" r]<br>set i 0<br>while { [eof $commandfile] != 1 } {<br>incr i 1<br>set command($i) [gets $commandfile]<br>}<br>set w [rand $i]<br>set outcommand $command($w)<br>putserv "PRIVMSG $channel :$outcommand"<br>}<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10564">lenooxx</a> — Sun Oct 11, 2009 10:43 am</p><hr />
]]></content>
	</entry>
	</feed>
