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

	<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>2003-06-14T12:51:41-04:00</updated>

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

		<entry>
		<author><name><![CDATA[BiLL]]></name></author>
		<updated>2003-06-14T12:51:41-04:00</updated>

		<published>2003-06-14T12:51:41-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=21819#p21819</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=21819#p21819"/>
		<title type="html"><![CDATA[Delete Proc for database file]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=21819#p21819"><![CDATA[
awesome - works perfect - big thanks.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=50">BiLL</a> — Sat Jun 14, 2003 12:51 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[stdragon]]></name></author>
		<updated>2003-06-14T12:47:50-04:00</updated>

		<published>2003-06-14T12:47:50-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=21818#p21818</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=21818#p21818"/>
		<title type="html"><![CDATA[Delete Proc for database file]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=21818#p21818"><![CDATA[
Try changing that line to<br><br>if {[string match -nocase $info [lindex [split $line |] 0]]} {<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8">stdragon</a> — Sat Jun 14, 2003 12:47 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[BiLL]]></name></author>
		<updated>2003-06-14T12:40:38-04:00</updated>

		<published>2003-06-14T12:40:38-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=21817#p21817</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=21817#p21817"/>
		<title type="html"><![CDATA[Delete Proc for database file]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=21817#p21817"><![CDATA[
big thanks.<br><br>there seems to be a little bug in it thought.<br><br>i used some putserv msgs to check where the error is:<br><br>    putserv "PRIVMSG $nick :info = $info"<br>    putserv "PRIVMSG $nick :line = $line"<br>    putserv "PRIVMSG $nick :found = $found"<br><br>into the while.<br><br>now i see :<br><br>[18:37] : !deluser user10<br>[18:37] (test-): info = user10<br>[18:37] (test-): line = user10|pass10<br>[18:37] (test-): found = 0<br>...<br>[18:37] (test-): User user10 not found.<br><br>but info (arg/rest) is correct and the line too.<br>but it didnt set found = 1.<br><br>if {[string match $info [lindex $line 0]]} { <br>there must be something wrong. maybe that lindex $line 0 ?<br><br>please help thanks<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=50">BiLL</a> — Sat Jun 14, 2003 12:40 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2003-06-14T11:21:22-04:00</updated>

		<published>2003-06-14T11:21:22-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=21815#p21815</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=21815#p21815"/>
		<title type="html"><![CDATA[Delete Proc for database file]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=21815#p21815"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>set datafile "bla.txt"bind pub o !del pub:delproc pub:del {nick host handle channel text} {  set found 0  set index ""  set info "[lindex [split $text] 0]"   set file [open $::datafile r]   while {![eof $file]} {    gets $file line    if {$line == ""} { continue }    if {[string match $info [lindex $line 0]]} {      set found 1      } else {      lappend index $line    }  }  if {$found == 0} {    putserv "PRIVMSG $channel :$info was not found."    return  }  catch {close $file}  set file [open $::datafile w]   foreach line $index {    puts $file $line  }  catch {close $file}  putserv "PRIVMSG $channel :User '$info' removed."}</code></pre></div>This should do fine.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Sat Jun 14, 2003 11:21 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[BiLL]]></name></author>
		<updated>2003-06-14T10:27:02-04:00</updated>

		<published>2003-06-14T10:27:02-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=21814#p21814</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=21814#p21814"/>
		<title type="html"><![CDATA[Delete Proc for database file]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=21814#p21814"><![CDATA[
Greetings,<br><br>I have a problem - big one <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_surprised.gif" width="15" height="15" alt=":o" title="Surprised">). I tried every ways but I don't get it working.<br><br>I have a $db file. (easy .txt file).<br><br>$db looks like:<br><br>User1|Pass1<br>User2|Pass2<br>User3|Pass3<br>User4|Pass4<br><br>Now I want to make a function !deluser.<br>The problem is that it should delete using the username. I already got a proc which does this by linenumber, for example !deluser num 3 (line 3 - User3) - thats no problem, but the problem is getting the line by just the username and the number. I dont want to use !deluser num - I want to use !deluser User2. Can anyone help me coding that proc ? I really don't get it working. It should work like this:<br><br>!deluser User3<br><br>-&gt; Searches User3 in $db and deletes the WHOLE LINE out of $db.<br>After that command $db looks like:<br><br>User1|Pass1<br>User3|Pass3<br>User4|Pass4<br><br>Can anyone help me with that?<br><br>Big thanks.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=50">BiLL</a> — Sat Jun 14, 2003 10:27 am</p><hr />
]]></content>
	</entry>
	</feed>
