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

	<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-12-22T20:11:55-04:00</updated>

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

		<entry>
		<author><name><![CDATA[poppabear]]></name></author>
		<updated>2006-12-22T20:11:55-04:00</updated>

		<published>2006-12-22T20:11:55-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=69162#p69162</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=69162#p69162"/>
		<title type="html"><![CDATA[Unable to find fault with the code. ini writing]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=69162#p69162"><![CDATA[
<blockquote class="uncited"><div>Still have the same problem i just cant see why,</div></blockquote>Well i could tell you one of the problems with the ini_functions are that, if you try and add a "nick" or "section" for the section part and the nick say for exaple has any [] in it then it tries and add to the data base for example: [poppabear] will be written to the database as [[poppabear]] then it tries to interpret the extra [] so basically what i am saying is that the ini_functions script is not special char friendly.<br><br>i currently am having the same issues myself, would be nice if someone was able to come out with a new version with this bug fix.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8522">poppabear</a> — Fri Dec 22, 2006 8:11 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Wannabe]]></name></author>
		<updated>2006-02-11T11:14:33-04:00</updated>

		<published>2006-02-11T11:14:33-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=60306#p60306</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=60306#p60306"/>
		<title type="html"><![CDATA[Unable to find fault with the code. ini writing]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=60306#p60306"><![CDATA[
Still have the same problem i just cant see why,<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7360">Wannabe</a> — Sat Feb 11, 2006 11:14 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[OpEn_FiRe]]></name></author>
		<updated>2006-02-11T08:31:58-04:00</updated>

		<published>2006-02-11T08:31:58-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=60305#p60305</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=60305#p60305"/>
		<title type="html"><![CDATA[Unable to find fault with the code. ini writing]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=60305#p60305"><![CDATA[
I have a found a version newer than your for inidb.tcl.<br>I didnt really take a look at your scripts or even checked if the inidb you have to see if it is differecnt from this version i found. but u can always give it a try.<div class="codebox"><p>Code: </p><pre><code>###################### INI Database v0.4.3 [ JUN/29/2001 ]##  By mamaKIN (mamakin@mailandnews.com)##  By Ze (mgm@ifrance.com) (v0.4.3)##  $Id: inidb.tcl,v 1.2 2001/09/29 18:22:39 Ze Exp $####  Thanks to Amadeus` for spotting some important issues#### Visit http://mort.level5.net/~mamakin/scripts/eggdrop/inidb.html for updates#### Description:##   INI Datbase allows people to easily store settings and easily access them.##   * INI Database is for TCL scripters only *####-----------------------------------------------------------------------------##   PROCEDURE:   ini_read &lt;ini file&gt; &lt;section&gt; &lt;item&gt;##   DESCRIPTION: Reads the value of an item from the specified section in the##                ini file.##   RETURNS:     the value of the item if successful; semi-colon ';' otherwise##                (semi-colon because any other characters could be used as the##                  value, so use "\;" when comparing ini_read's return value)##-----------------------------------------------------------------------------##   PROCEDURE:   ini_write &lt;ini file&gt; &lt;section&gt; &lt;item&gt; [value]##   DESCRITPION: Sets the value of item in the specified section in the ini##                file.##   RETURNS:     TRUE (1) if successful; FALSE (0) otherwise##-----------------------------------------------------------------------------##   PROCEDURE:   ini_remove &lt;ini file&gt; &lt;section&gt; [item]##   DESCRIPTION: Removes a section of the ini file or an item of the section.##                Use "" in place of the item variable if you wish to##                exclude it.##                ( Use "file delete" if you want to remove the ini file )##   RETURNS:     TRUE (1) if successful; FALSE (0) otherwise##-----------------------------------------------------------------------------##   PROCEDURE:   ini_get_section_list &lt;ini file&gt;##   DESCRIPTION: Return the list of all section who are present in 'ini file'##   RETURNS:     A list. "" if no section was found.####################set inidb_ver "{INI Database v0.4.2} {04200!00} {6447b} {945384656} {mamaKIN}"proc ini_get_section_list {inifile} {    if { [lindex $inifile 0] == "" } {return ""    }    if {![file exists $inifile]} { return "\;" }    set fileo [open $inifile r]    set sect_list ""    while {![eof $fileo]} {set rline [gets $fileo]set rline [string trim $rline]if {[string index $rline 0] == "\[" &amp;&amp; [string index $rline [expr [string length $rline] - 1]] == "\]"} {    lappend sect_list [string range $rline 1 [expr [string length $rline] - 2]]}    }    close $fileo    return sect_list}proc ini_read {inifile section item} {  set item [lindex $item 0]  if {[lindex $inifile 0] == "" || [lindex $section 0] == "" || [lindex $item 0] == ""} { return "\;" }  if {![file exists $inifile]} { return "\;" }  set fileo [open $inifile r]  set sect ""  while {![eof $fileo]} {    set rline [gets $fileo]    set rline [string trim $rline]    if {$rline != "" || [string index $rline 0] != "\;"} {      if {[string index $rline 0] == "\[" &amp;&amp; [string index $rline [expr [string length $rline] - 1]] == "\]"} {        set sect [string range $rline 1 [expr [string length $rline] - 2]]      } elseif {[string tolower $sect] == [string tolower $section]} {        set im [string tolower [string range $rline 0 [expr [string first = $rline] - 1]]]        set va [string range $rline [expr [string first = $rline] + 1] end]        set itm(${im}) $va      }    }  }  if {[array names itm [string tolower $item]] == ""} {       close $fileo      return "\;"   }  set rtrn [set itm([string tolower $item])]  close $fileo  return $rtrn}proc ini_write {inifile section item value} {  set section [lindex [string tolower $section] 0]  if {[lindex $inifile 0] == "" || [lindex $section 0] == "" || [lindex $item 0] == ""} { return 0 }  if {![file exists $inifile] || [file size $inifile] == 0} {    set filew [open $inifile w]    puts $filew "\[$section\]"    puts $filew "[string tolower $item]=$value"    close $filew; return 1  }  set fileo [open $inifile r]  set cursect ""; set sect ""  while {![eof $fileo]} {    set rline [string trim [gets $fileo]]    if {$rline != "" || [string index $rline 0] != "\;"} {      if {[string index $rline 0] == "\[" &amp;&amp; [string index $rline [expr [string length $rline] - 1]] == "\]"} {        set cursect [string tolower [string range $rline 1 [expr [string length $rline] - 2]]]        lappend sect $cursect      } {        set im [string tolower [string range $rline 0 [expr [string first = $rline] - 1]]]        set vl [string range $rline [expr [string first = $rline] + 1] end]        lappend [join "ini $cursect" ""]($im) $vl      }    }  }  close $fileo; unset fileo  if {[lsearch $sect $section] == -1} { lappend sect $section }  set [join "ini $section" ""]([string tolower $item]) $value  set fileo [open $inifile w]  foreach sct $sect {    puts $fileo "\[$sct\]"    foreach ite [array names [join "ini $sct" ""]] {      set ite [lindex $ite 0]      set valu [set [join "ini $sct" ""]($ite)]      if {$ite != ""} {        puts $fileo "$ite=[join $valu]"      }    }    puts $fileo ""  }  close $fileo  return 1}proc ini_remove { inifile section item } {  set section [lindex [string tolower $section] 0]  set item [lindex [string tolower $item] 0]  if {[lindex $inifile 0] == ""} { return 0 }  if {![file exists $inifile]} { return 0 }  if {$section == ""} { return 0 }  set fileo [open $inifile r]  set cursect ""; set sect ""  while {![eof $fileo]} {    set rline [string trim [gets $fileo]]    if {$rline != "" || [string index $rline 0] != "\;"} {      if {[string index $rline 0] == "\[" &amp;&amp; [string index $rline [expr [string length $rline] - 1]] == "\]"} {        set cursect [string tolower [string range $rline 1 [expr [string length $rline] - 2]]]        lappend sect $cursect      } {        set im [string tolower [string range $rline 0 [expr [string first = $rline] - 1]]]        set vl [string range $rline [expr [string first = $rline] + 1] end]        lappend [join "ini $cursect" ""]($im) $vl      }    }  }  close $fileo; unset fileo  set sesect [lsearch $sect $section]  if {$sesect == -1} {    return 0  } {    if {$item == ""} { set sect [lreplace $sect $sesect $sesect] }  }  set seitem [lsearch [array names [join "ini $section" ""]] $item]  if {$seitem != -1} {    unset [join "ini $section" ""]($item)    if {[llength [array names [join "ini $section" ""]]] == 1} {      set sect [lreplace $sect $sesect $sesect]    }  }  if {[llength $sect] == 0} { file delete $inifile; return 1 }  set fileo [open $inifile w]  foreach sct $sect {    puts $fileo "\[$sct\]"    foreach ite [array names [join "ini $sct" ""]] {      set ite [lindex $ite 0]      set valu [set [join "ini $sct" ""]($ite)]      if {$ite != "" &amp;&amp; [lindex $valu 0] != ""} {        puts $fileo "$ite=[join $valu]"      }    }    puts $fileo ""  }  close $fileo  return 1}if {[info exists version]} {  putlog "Loaded [lindex $inidb_ver 0] by [lindex $inidb_ver 4]"}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7306">OpEn_FiRe</a> — Sat Feb 11, 2006 8:31 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Wannabe]]></name></author>
		<updated>2006-02-10T19:36:53-04:00</updated>

		<published>2006-02-10T19:36:53-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=60295#p60295</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=60295#p60295"/>
		<title type="html"><![CDATA[Unable to find fault with the code. ini writing]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=60295#p60295"><![CDATA[
Ok fixed sorry about that<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7360">Wannabe</a> — Fri Feb 10, 2006 7:36 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2006-02-10T19:17:17-04:00</updated>

		<published>2006-02-10T19:17:17-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=60294#p60294</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=60294#p60294"/>
		<title type="html"><![CDATA[Unable to find fault with the code. ini writing]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=60294#p60294"><![CDATA[
I don't know about the others, but the code looks ugly with all those #'s. So I suggest you fix it.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Fri Feb 10, 2006 7:17 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Wannabe]]></name></author>
		<updated>2006-02-10T19:36:21-04:00</updated>

		<published>2006-02-10T13:12:14-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=60283#p60283</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=60283#p60283"/>
		<title type="html"><![CDATA[Unable to find fault with the code. ini writing]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=60283#p60283"><![CDATA[
Ok, ive downloaded the ini database script written by mamaKIN, who i cant seem to contact (e-mail bounces, never on irc)<br><br>using his script (which ill post here too) ive updated my own script to use ini files. but now i get an odd result when running the !add command. ill post an example of the ini file after only ONE add. <br><br>ignore the # on all the blank lines, its from the pastebin i copied this code back from.<br><br>Anyone able to work out why it stores multiple times and suggest a fix. i will be very happy with <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><div class="codebox"><p>Code: </p><pre><code>#bind msg - !help addme_help#bind msg - help addme_help#bind pub - !help addme_help_pub#bind msg - !removeall addme_removeall#bind msg - removeall addme_removeall#bind pub - !removeall addme_removeall_pubbind pub - !add addg_addguildbind pub - !addme addg_addguildbind pub - !clearall clearallbind pub - !match addg_matchbind pub - !readall readallbind pub - !remove addg_removenamebind pub - !removeme addg_removename#bind pub - !rappel addme_recall#bind pub - !recall addme_recallbind pub - !motd addme_updatemotd#bind pub - !stats addme_gamecount#bind join - * addme_welcome# on very populated channels, you may want to comment out this line,# so the bot wont keep looking at people joining.# If so, add a static welcome message to another bot, or to channel service# (ie X on undernet, Q or L on quakenet ...)bind part - * addg_partbind sign - * addg_partbind kick - * addg_kickbind nick - * addg_nick#bind msg - addme_version addme_version#initset addg_channels "#guildwars.pvp"set addg_motd "Guildwars PvP gather Beta 1"set addg_number 0set inifile "data/guild.ini"proc addg_addguild {nick mask hand chan text} {putlog "In the proc addguild"#add player to array and incr counter is supposed to do so       global inifileglobal addg_channelsglobal addg_motdglobal addg_numberputlog "pasted the globals, now checking channel"# if {![regexp $chan $addg_channels]} {#putlog "Wrong chan"#               return 0#}if {$text == "" || $text == "{}" || ![info exists text]} {putquick "NOTICE $nick :Invalid Syntax, See !help command \002$nick\002 Error Number 1"}        set leader $nick        putlog "leader set to $leader"        set guild [lindex $text 0]        putlog "guild set to $guild"        set rank [lindex $text 1]        putlog "rank set to $rank"        if {![info exist leader] || ![info exist guild] || ![info exists rank]} {putquick "NOTICE $nick :Invalid Syntax, See !help command \002$nick\002 Error Number 2"}                if {$rank &lt; 10 } {           set bracket 1           putlog "Bracket 1"        } elseif { $rank &gt; 10 &amp;&amp; $rank &lt; 50 } {           set bracket 2           putlog "Bracket 2"        } elseif { $rank &gt; 50 &amp;&amp; $rank &lt; 100 } {           set bracket 3           putlog "Bracket 3"        } elseif { $rank &gt; 100 &amp;&amp; $rank &lt; 500 } {           set bracket 4           putlog "Bracket 4"        } elseif { $rank &gt; 500 &amp;&amp; $rank &lt; 1000 } {           set bracket 5           putlog "Bracket 5"        } elseif { $rank &gt; 1000 &amp;&amp; $rank &lt; 5000 } {           set bracket 6           putlog "Bracket 6"        } elseif { $rank &gt; 5000 } {           set bracket 7           putlog "Bracket 7"        }        if {![nickfind $nick]} {           putlog "storing..."           lappend nicklist $nick           ini_write $inifile $nick rank $rank           ini_write $inifile $nick guild $guild           ini_write $inifile $nick bracket $bracket           ini_write $inifile added leaders $nicklist           #set guildinfo($leader,rank) $rank           #set guildinfo($leader,guild) $guild           #set guildinfo($leader,bracket) $bracket           putlog "done, now changing topic"           incr addg_number           addg_updatetopic $addg_number $addg_motd        } else {           putlog "the value of is nick [isnick $nick]"           putquick "NOTICE $nick :Your already stored"        }}proc addg_removename  {nick mask hand chan text} {# Call the internal proc remove when someone types !remove, if supposed to do soglobal botnickglobal inifileif {$text == "" || $text == "{}" || ![info exists text]} {set text $nick}if {![isop $nick $chan]} {putquick "NOTICE $nick :Sorry \002$nick\002, admin command : you need to be op"return 0} else {                       addg_remove $nick                }}proc addg_remove {nick} {global addg_motdglobal addg_numberglobal inifile       if {[file exist $inifile]} {           ini_remove $inifile $nick ""           set ulist [ini_read $inifile added leaders]           set uindex [lsearch $ulist $nick]           set newlist [lreplace $ulist $uindex $uindex]           ini_write $inifile added leaders $newlist           set newnum [$addg_number - 1]           addg_updatetopic $newnum $addg_motd       } else {           putquick "NOTICE $nick : Your not added, please view !help"       }}proc nickfind {nick} {global inifileset isthere [ini_read $inifile added leaders]foreach name $isthere {if {$name == $nick} { return 1} else { return 0}}}proc isnick {nick} {     putlog "nick is $nick"     putlog "checking if nick is added or file exists"     global inifile     if {[file exist $inifile]} {       if {[ini_read $inifile $nick rank] == ";"} {           putlog "was not found"           return 0        } else {           putlog "Found"           return 1        }     } else {     return 0     }}proc addg_nick {nick host hand chan newnick} {# When someone listed in topic changes nick (Tom -&gt; Tom|AFK), changes topic to match new nickglobal botnickglobal addg_channels#if {[regexp $chan $addg_channels]} { }#addg_getvars $chanif {[isnick $nick] == 1} {remove($nick)putquick "NOTICE $nick : Changing your nickname has removed you from the list, please re-add"}}proc addg_part {nick host hand chan text} {# Remove nick from players list if they leave channel or irc serverglobal botnickglobal addg_channels        if {[regexp $chan $addg_channels]} {addg_getvars $chanif {[isnick $nick] == 1} {remove($nick)}}}proc addg_kick {nick host hand chan target reason} {# Remove nick from players list if they leave channel or irc serverglobal botnickglobal addg_channels        if {[regexp $chan $addg_channels]} {addg_getvars $chanif {[isnick $nick] == 1} {remove($nick)}}}proc addg_updatetopic {number motd} {# Internal proc modify topic with new arguments (chan, Guild number and motd)set newtopic "Currently $number of guilds waiting for a game \0037 $motd"puthelp "TOPIC #guildwars.pvp : $newtopic"}proc addg_match { nick host hand chan text } {global inifileset randum 0set found 0    if {[file exist $inifile]} {       if {[ini_read $inifile $nick rank] == ";"} {          putquick "NOTICE $nick :Please add yourself before attempting the !match command, see !help"       } else {          putlog "Found"          set matchrank [ini_read $inifile $nick rank]          set $found 1       }    }set ulist [ini_read $inifile added leaders]set num 0foreach name $ulist {if{[ini_read $inifile $name bracket] == $matchrank} {             set unames($num) $name}set num $num+1}set randem [rand [array size unames]]set result $unames($randem)if {$randem == 0} {putquick "NOTICE $nick : Sorry An error has accured please contact Syntax-error Error invalid Array at rand"} else {putquick "NOTICE $nick : Match found against $result"putquick "NOTICE $result : Match found against $nick"}}proc readall { nick host hand chan text } {global inifileforeach guild [array names guildinfo] { putquick "NOTICE $nick : $guildinfo($guild,rank)" putquick "NOTICE $nick : $guildinfo($guild,guild)" putquick "NOTICE $nick : $guildinfo($guild,bracket)" }}proc clearall { nick host hand chan text } {global inifileunset guildinfoputlog "Array is gone"}</code></pre></div><br><br><br><div class="codebox"><p>Code: </p><pre><code>###################### INI Database v0.4.2 [ DEC/16/1999 ]##  By mamaKIN (mamakin@mailandnews.com)####  Thanks to Amadeus` for spotting some important issues#### Visit http://mort.level5.net/~mamakin/scripts/eggdrop/inidb.html for updates#### Description:##   INI Datbase allows people to easily store settings and easily access them.##   * INI Database is for TCL scripters only *####-----------------------------------------------------------------------------##   PROCEDURE:   ini_read &lt;ini file&gt; &lt;section&gt; &lt;item&gt;##   DESCRIPTION: Reads the value of an item from the specified section in the##                ini file.##   RETURNS:     the value of the item if successful; semi-colon ';' otherwise##                (semi-colon because any other characters could be used as the##                  value, so use "\;" when comparing ini_read's return value)##-----------------------------------------------------------------------------##   PROCEDURE:   ini_write &lt;ini file&gt; &lt;section&gt; &lt;item&gt; [value]##   DESCRITPION: Sets the value of item in the specified section in the ini##                file.##   RETURNS:     TRUE (1) if successful; FALSE (0) otherwise##-----------------------------------------------------------------------------##   PROCEDURE:   ini_remove &lt;ini file&gt; &lt;section&gt; [item]##   DESCRIPTION: Removes a section of the ini file or an item of the section.##                Use "" in place of the item variable if you wish to##                exclude it.##                ( Use "file delete" if you want to remove the ini file )##   RETURNS:     TRUE (1) if successful; FALSE (0) otherwise##-----------------------------------------------------------------------------####################set inidb_ver "{INI Database v0.4.2} {04200!00} {6447b} {945384656} {mamaKIN}"proc ini_read {inifile section item} {  set item [lindex $item 0]  if {[lindex $inifile 0] == "" || [lindex $section 0] == "" || [lindex $item 0] == ""} { return "\;" }  if {![file exists $inifile]} { return "\;" }  set fileo [open $inifile r]  set sect ""  while {![eof $fileo]} {    set rline [gets $fileo]    set rline [string trim $rline]    if {$rline != "" || [string index $rline 0] != "\;"} {      if {[string index $rline 0] == "\[" &amp;&amp; [string index $rline [expr [string length $rline] - 1]] == "\]"} {        set sect [string range $rline 1 [expr [string length $rline] - 2]]      } elseif {[string tolower $sect] == [string tolower $section]} {        set im [string tolower [string range $rline 0 [expr [string first = $rline] - 1]]]        set va [string range $rline [expr [string first = $rline] + 1] end]        set itm(${im}) $va      }    }  }  if {[array names itm [string tolower $item]] == ""} { return "\;" }  set rtrn [set itm([string tolower $item])]  return $rtrn}proc ini_write {inifile section item value} {  set section [lindex [string tolower $section] 0]  if {[lindex $inifile 0] == "" || [lindex $section 0] == "" || [lindex $item 0] == ""} { return 0 }  if {![file exists $inifile] || [file size $inifile] == 0} {    set filew [open $inifile w]    puts $filew "\[$section\]"    puts $filew "[string tolower $item]=$value"    close $filew; return 1  }  set fileo [open $inifile r]  set cursect ""; set sect ""  while {![eof $fileo]} {    set rline [string trim [gets $fileo]]    if {$rline != "" || [string index $rline 0] != "\;"} {      if {[string index $rline 0] == "\[" &amp;&amp; [string index $rline [expr [string length $rline] - 1]] == "\]"} {        set cursect [string tolower [string range $rline 1 [expr [string length $rline] - 2]]]        lappend sect $cursect      } {        set im [string tolower [string range $rline 0 [expr [string first = $rline] - 1]]]        set vl [string range $rline [expr [string first = $rline] + 1] end]        lappend [join "ini $cursect" ""]($im) $vl      }    }  }  close $fileo; unset fileo  if {[lsearch $sect $section] == -1} { lappend sect $section }  set [join "ini $section" ""]([string tolower $item]) $value  set fileo [open $inifile w]  foreach sct $sect {    puts $fileo "\[$sct\]"    foreach ite [array names [join "ini $sct" ""]] {      set ite [lindex $ite 0]      set valu [set [join "ini $sct" ""]($ite)]      if {$ite != ""} {        puts $fileo "$ite=[join $valu]"      }    }    puts $fileo ""  }  close $fileo  return 1}proc ini_remove { inifile section item } {  set section [lindex [string tolower $section] 0]  set item [lindex [string tolower $item] 0]  if {[lindex $inifile 0] == ""} { return 0 }  if {![file exists $inifile]} { return 0 }  if {$section == ""} { return 0 }  set fileo [open $inifile r]  set cursect ""; set sect ""  while {![eof $fileo]} {    set rline [string trim [gets $fileo]]    if {$rline != "" || [string index $rline 0] != "\;"} {      if {[string index $rline 0] == "\[" &amp;&amp; [string index $rline [expr [string length $rline] - 1]] == "\]"} {        set cursect [string tolower [string range $rline 1 [expr [string length $rline] - 2]]]        lappend sect $cursect      } {        set im [string tolower [string range $rline 0 [expr [string first = $rline] - 1]]]        set vl [string range $rline [expr [string first = $rline] + 1] end]        lappend [join "ini $cursect" ""]($im) $vl      }    }  }  close $fileo; unset fileo  set sesect [lsearch $sect $section]  if {$sesect == -1} {    return 0  } {    if {$item == ""} { set sect [lreplace $sect $sesect $sesect] }  }  set seitem [lsearch [array names [join "ini $section" ""]] $item]  if {$seitem != -1} {    unset [join "ini $section" ""]($item)    if {[llength [array names [join "ini $section" ""]]] == 1} {      set sect [lreplace $sect $sesect $sesect]    }  }  if {[llength $sect] == 0} { file delete $inifile; return 1 }  set fileo [open $inifile w]  foreach sct $sect {    puts $fileo "\[$sct\]"    foreach ite [array names [join "ini $sct" ""]] {      set ite [lindex $ite 0]      set valu [set [join "ini $sct" ""]($ite)]      if {$ite != "" &amp;&amp; [lindex $valu 0] != ""} {        puts $fileo "$ite=[join $valu]"      }    }    puts $fileo ""  }  close $fileo  return 1}if {[info exists version]} {  putlog "Loaded [lindex $inidb_ver 0] by [lindex $inidb_ver 4]"}</code></pre></div><br>And this is the ini file after a single add <br><div class="codebox"><p>Code: </p><pre><code>   1.      [syn[coding]]   2.      rank=1234 1234 1234 1234 1234 1234   3.      bracket=6 6 6   4.      guild=myguild myguild myguild myguild myguild myguild   5.          6.      [syn[coding]]   7.      rank=1234 1234 1234 1234 1234 1234   8.      bracket=6 6 6   9.      guild=myguild myguild myguild myguild myguild myguild  10.         11.      [syn[coding]]  12.      rank=1234 1234 1234 1234 1234 1234  13.      bracket=6 6 6  14.      guild=myguild myguild myguild myguild myguild myguild  15.         16.      [added]  17.      leaders=syn[coding] </code></pre></div><div class="codebox"><p>Code: </p><pre><code></code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7360">Wannabe</a> — Fri Feb 10, 2006 1:12 pm</p><hr />
]]></content>
	</entry>
	</feed>
