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

	<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>2011-09-27T12:33:29-04:00</updated>

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

		<entry>
		<author><name><![CDATA[lee8oi]]></name></author>
		<updated>2011-09-27T12:33:29-04:00</updated>

		<published>2011-09-27T12:33:29-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=97796#p97796</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=97796#p97796"/>
		<title type="html"><![CDATA[minor update]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=97796#p97796"><![CDATA[
Script has been moved to its own repository. New github link is: <a href="https://github.com/lee8oi/dinfo/blob/master/dinfo.tcl" class="postlink">https://github.com/lee8oi/dinfo/blob/master/dinfo.tcl</a><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11681">lee8oi</a> — Tue Sep 27, 2011 12:33 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[lee8oi]]></name></author>
		<updated>2011-06-29T13:11:00-04:00</updated>

		<published>2011-06-29T13:11:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=97123#p97123</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=97123#p97123"/>
		<title type="html"><![CDATA[Dinfo script. Update release v1.1]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=97123#p97123"><![CDATA[
Heres v1.1  with a couple minor updates.<div class="codebox"><p>Code: </p><pre><code>namespace eval dinfo {#################################################################################   Copyright ©2011 lee8oi@gmail.com##   This program is free software; you can redistribute it and/or modify#   it under the terms of the GNU General Public License as published by#   the Free Software Foundation; either version 2 of the License, or#   (at your option) any later version.##   This program is distributed in the hope that it will be useful,#   but WITHOUT ANY WARRANTY; without even the implied warranty of#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the#   GNU General Public License for more details.#   http://www.gnu.org/licenses/###################################################################################   Dinfo script v1.1 (6-27-11)#   by: &lt;lee8oi@github&gt;&lt;lee8oiOnfreenode&gt;#   github link: https://github.com/lee8oi/eggdrop/blob/master/dinfo.tcl##   Dinfo script is the first 'graduate' from the dukescript volatile#   experiment. This script is simply an info script. Similar to what 'factoids'#   are in supybot or 'egglearn' for eggdrop. The public '.info' command has#   list and retrieval capabilities while the dcc/partyline command '.dinfo'#   allows owners to add, remove, list info entries as well as backup and#   restore the info database to/from file.##   Initial channel setup:#   (enables use of public info command in specified channel)#    .chanset #channel +dinfo##   Public command syntax:#    .info ?list|help|&lt;text&gt;?##   DCC (partyline) command syntax:#    .dinfo ?backup|restore|add|remove|list? ?args?##   Example Usage:#    (public)#        &lt;lee8oi&gt; .info#    &lt;dukelovett&gt; Usage: .info ?list|help|&lt;text&gt;?#        &lt;lee8oi&gt; .info version#    &lt;dukelovett&gt; version: dinfo 1.0 by lee8oi@github.#        &lt;lee8oi&gt; .info list#    &lt;dukelovett&gt; Info Available: help, version, lee8oi#        &lt;lee8oi&gt; .info lee8oi#    &lt;dukelovett&gt; lee8oi: The king of dukelovett.org.##    (console)#        lee8oi .dinfo#    dukelovett ~dinfo~ Usage: .dinfo ?backup|restore|add|remove? ?text?#        lee8oi .dinfo backup#    dukelovett dinfodb saved.#        lee8oi .dinfo restore#    dukelovett dinfodb restored.#        lee8oi .dinfo add test Just a test info entry.#    dukelovett ~dinfo~ Info item added.#        lee8oi .dinfo test#    dukelovett test: Just a test info entry.### Updates:#   v1.1#       1. Removed lingering '.hi' command that was left in the code when script#       graduated from Dukescript Volatile Experiment.#       2. Added ::dinfo:: namespace.#       3. Fixed script version references to use variable.##################################################################################   Experts only below this line.################################################################################    variable ver "1.1"    set ::dinfo::dinfodb(version) "Dinfo $ver by lee8oi@github."    if {[file exist "scripts/dinfodb.tcl"]} {        source scripts/dinfodb.tcl    }}bind pubm - * ::dinfo::pub_handlerbind dcc n dinfo ::dinfo::dcc_procsetudef flag dinfonamespace eval dinfo {        proc restoredb {args} {        # restore from file        variable ::dinfo::dinfodb        source scripts/dinfodb.tcl    }    proc backupdb {args} {        # backup dinfodb to file.        variable ::dinfo::dinfodb        set fs [open "scripts/dinfodb.tcl" w+]        # write variable lines for loading namespace vars.        # create 'array set' lines using array data.        puts $fs "variable ::dinfo::dinfodb"        puts $fs "array set dinfodb [list [array get dinfodb]]"        close $fs;    }    proc dcc_proc {handle idx text} {        # dcc/partyline command        variable ::dinfo::dinfodb        variable ::dinfo::ver        set textarr [split $text]        set text [string tolower [lindex $textarr 0]]        switch $text {            "" {                # show help.                putdcc $idx "~dinfo $ver~ Usage: .dinfo ?backup|restore|add|remove? ?args?"            }            "backup" {                # run backup procedure.                ::dinfo::backupdb                putdcc $idx "dinfodb saved."            }            "restore" {                # run restore procedure.                ::dinfo::restoredb                putdcc $idx "dinfodb restored."            }            "add" {                # add a new info entry.                set second [lindex $textarr 1]                set value [lrange $textarr 2 end]                if {$second != "" &amp;&amp; $value != ""} {                    set dinfodb($second) $value                    ::dinfo::backupdb                    putdcc $idx "~dinfo~ Info item added."                } else {                    putdcc $idx "~dinfo $ver~ Usage: .dinfo add &lt;name&gt; &lt;text&gt;"                }            }            "remove" {                # remove info entry                set second [lindex $textarr 1]                if {$second != ""} {                    if {[info exists dinfodb($second)]} {                        unset dinfodb($second)                        ::dinfo::backupdb                        putdcc $idx "~dinfo~ Info item removed."                    }                } else {                    putdcc $idx "~dinfo $ver~ Usage: .dinfo remove &lt;name&gt;"                }              }            "list" {                # list existing info entries names.                set arrayvar ""                foreach {name value} [array get dinfodb] {                    lappend arrayvar $name                }                #set stringvar [join $arrayvar]                set cleanvar [regsub -all {[ \t]+} $arrayvar {, }]                putdcc $idx "Info Available: $cleanvar"            }            default {                # value isn't part of command. Do search.                set first [lindex $textarr 0]                if {[info exists dinfodb($first)]} {                    putdcc $idx "$first: $dinfodb($first)"                } else {                    putdcc $idx "Info not available."                }            }        }       }    proc pub_handler {nick userhost handle channel text} {        if {[channel get $channel dinfo]} {            variable ::dinfo::ver            set textarr [split $text]            set first [string tolower [lindex $textarr 0]]            switch $first {                ".info" {                    variable ::dinfo::dinfodb                    set second [lindex $textarr 1]                    if {$second != ""} {                        switch $second {                            "list" {                                # list existing info entries names.                                set arrayvar ""                                foreach {name value} [array get dinfodb] {                                    lappend arrayvar $name                                }                                #set stringvar [join $arrayvar]                                set cleanvar [regsub -all {[ \t]+} $arrayvar {, }]                                putserv "PRIVMSG $channel :Info Available: $cleanvar"                            }                            default {                                # value isn't part of command. Do search.                                if {[info exists dinfodb($second)]} {                                    putserv "PRIVMSG $channel :${second}: $dinfodb($second)"                                } else {                                    putserv "PRIVMSG $channel :Info not available."                                }                            }                        }                    } else {                        putserv "PRIVMSG $channel :~dinfo $ver~ Usage: .info ?list|help|&lt;text&gt;?"                     }                }            }        }    }}putlog "Dinfo script [set ::dinfo::ver] Loaded."</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11681">lee8oi</a> — Wed Jun 29, 2011 1:11 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[lee8oi]]></name></author>
		<updated>2011-09-27T12:32:32-04:00</updated>

		<published>2011-06-27T22:08:21-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=97102#p97102</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=97102#p97102"/>
		<title type="html"><![CDATA[Dinfo script. Latest version v1.1.]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=97102#p97102"><![CDATA[
Dinfo script is the first 'graduate' from the dukescripts volatile experiment. This script is simply an info script. Similar to what 'factoids' are in supybot or 'egglearn' for eggdrop. The public '.info' command has list and retrieval capabilities while the dcc/partyline command '.dinfo' allows owners to add, remove, list info entries as well as backup and restore the info database to/from file.<br><br>Latest version available from github at: <a href="https://github.com/lee8oi/dinfo/blob/master/dinfo.tcl" class="postlink">https://github.com/lee8oi/dinfo/blob/master/dinfo.tcl</a><br><br>Code for v1.0:<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11681">lee8oi</a> — Mon Jun 27, 2011 10:08 pm</p><hr />
]]></content>
	</entry>
	</feed>
