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

	<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-10-03T22:23:21-04:00</updated>

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

		<entry>
		<author><name><![CDATA[rosc2112]]></name></author>
		<updated>2006-10-03T22:23:21-04:00</updated>

		<published>2006-10-03T22:23:21-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=66919#p66919</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=66919#p66919"/>
		<title type="html"><![CDATA[Deleting a line from a text file.]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=66919#p66919"><![CDATA[
I gave you help, you haven't utilized it.  Whether I'm good or not is irrelevent. If you're not looking for a full script, why are you posting in the request forum?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7395">rosc2112</a> — Tue Oct 03, 2006 10:23 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Justdabomb2]]></name></author>
		<updated>2006-10-03T20:43:32-04:00</updated>

		<published>2006-10-03T20:43:32-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=66915#p66915</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=66915#p66915"/>
		<title type="html"><![CDATA[...]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=66915#p66915"><![CDATA[
and if I recall correctly, I never asked you to completely write me a script, I had something, but it messed up, so I asked for <strong class="text-strong">help</strong>.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8244">Justdabomb2</a> — Tue Oct 03, 2006 8:43 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Justdabomb2]]></name></author>
		<updated>2006-10-03T20:28:19-04:00</updated>

		<published>2006-10-03T20:28:19-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=66914#p66914</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=66914#p66914"/>
		<title type="html"><![CDATA[... wtf]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=66914#p66914"><![CDATA[
Yeah, I have no clue what I am doing *sarcasm end*... I am still learning for one. And you aren't too good yourself... There are a few things I don't know okay... big deal.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8244">Justdabomb2</a> — Tue Oct 03, 2006 8:28 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[rosc2112]]></name></author>
		<updated>2006-10-03T17:45:56-04:00</updated>

		<published>2006-10-03T17:45:56-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=66912#p66912</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=66912#p66912"/>
		<title type="html"><![CDATA[Deleting a line from a text file.]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=66912#p66912"><![CDATA[
Actually, you should not be posting scripts to the egghelp tcl archive until you have a clue what you're doing. Shame that files can't come with a big fat WARNING about absolutely clueless people and the potential for deleting your entire hard drive.<br><br><br>And no, I won't write the script for you, when you'll just post it as if you had written it.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7395">rosc2112</a> — Tue Oct 03, 2006 5:45 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[rosc2112]]></name></author>
		<updated>2006-10-03T17:43:16-04:00</updated>

		<published>2006-10-03T17:43:16-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=66911#p66911</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=66911#p66911"/>
		<title type="html"><![CDATA[Deleting a line from a text file.]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=66911#p66911"><![CDATA[
read my last reply about glob.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7395">rosc2112</a> — Tue Oct 03, 2006 5:43 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Justdabomb2]]></name></author>
		<updated>2006-10-03T15:44:46-04:00</updated>

		<published>2006-10-03T15:44:46-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=66909#p66909</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=66909#p66909"/>
		<title type="html"><![CDATA[hmm]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=66909#p66909"><![CDATA[
I tested the script you gave ^^^^<br><br>and this is what ir said <br><blockquote class="uncited"><div>[15:43] &lt;~Justdabomb2&gt; !delmpht justdabomb2<br>[15:43] &lt;JustdaBot&gt; That user was not found.<br>[15:43] &lt;~Justdabomb2&gt; !delmpht juancarlos<br>[15:43] &lt;JustdaBot&gt; That's not your entry so I won't delete it</div></blockquote>So the nick thing works, but it still did not delete the line. It didn't delete anything. Any suggestions?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8244">Justdabomb2</a> — Tue Oct 03, 2006 3:44 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[rosc2112]]></name></author>
		<updated>2006-10-02T23:58:28-04:00</updated>

		<published>2006-10-02T23:58:28-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=66896#p66896</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=66896#p66896"/>
		<title type="html"><![CDATA[Deleting a line from a text file.]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=66896#p66896"><![CDATA[
Actually, I think you'd have to use lsearch -glob  unless you use lindex and split to get the exact name for $gamer from the file first. I answered a post (now in the script request forum) that might be helpful, to show how to read/write/parse text files:<br><a href="http://forum.egghelp.org/viewtopic.php?p=66839#66839" class="postlink">http://forum.egghelp.org/viewtopic.php?p=66839#66839</a><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7395">rosc2112</a> — Mon Oct 02, 2006 11:58 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[rosc2112]]></name></author>
		<updated>2006-10-02T23:54:04-04:00</updated>

		<published>2006-10-02T23:54:04-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=66895#p66895</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=66895#p66895"/>
		<title type="html"><![CDATA[Deleting a line from a text file.]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=66895#p66895"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>proc deleteuser {nick uhost hand chan arg} {  global mphtfile  if {$arg != ""} {         set arg [string tolower $arg]         set gamer [lindex [split $arg] 0]         set nick [string tolower $nick]         if {$nick == $gamer} {              set fd [open $mphtfile r]              while {![eof $fd]} {                     lappend list [gets $fd]              }              close $fd              set le [lsearch -exact $list $gamer]              if {$le != -1} {                       lreplace $list $le $le                       set fd [open $mphtfile w]                       foreach line $list {                             if {$line != ""} {                                   puts $fd [join $line]                             }                       }                       close $fd              } else {                         putquick "PRIVMSG $chan :That user was not found."              }          } else {                        putquick "PRIVMSG $nick :That's not your entry so I won't delete it"          }  }} </code></pre></div>Something like that.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7395">rosc2112</a> — Mon Oct 02, 2006 11:54 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Justdabomb2]]></name></author>
		<updated>2006-10-02T21:20:46-04:00</updated>

		<published>2006-10-02T21:20:46-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=66890#p66890</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=66890#p66890"/>
		<title type="html"><![CDATA[Deleting a line from a text file.]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=66890#p66890"><![CDATA[
Could someone help create me a proc that will delete the line <br><br>"[JuanCarlos] &lt;juancarlos&gt; &lt;3780-2292-1521&gt;"<br><br>from the lines below.<br><br>[Chaoszer14] &lt;chaoszero14&gt; &lt;3350-8023-6356&gt;<br>[Jjoiu] &lt;jjoiu&gt; &lt;0687-8131-8871&gt;<br>[JuanCarlos] &lt;juancarlos&gt; &lt;3780-2292-5121&gt;<br>[Lostfan2420] &lt;lostfan2420&gt; &lt;4639-3128-6539&gt;<br>[Shade] &lt;shade&gt; &lt;5412-2685-7596&gt;<br><br>------------<br><br>I am having quite a bit of trouble figuring out how to a remove a specified line from a text file. And if you can, could you make so that the person could only remove the line "[JuanCarlos] &lt;juancarlos&gt; &lt;3780-2292-1521&gt;" if there name was juancarlos.<br><br>When I tried to make a proc to do this myself, it ended up deleting my whole txt file. The code I used is below. Maybe I did something wrong in my code, or maybe I just need a new code in general. (everytime it would say user not found when I typed !delmpht juancarlos, and then I checked the user to file to clarify, and the whole file was erased.)<br><div class="codebox"><p>Code: </p><pre><code>proc deleteuser {nick uhost hand chan arg} {   global mphtfile   if {$arg != ""} {     set gamer [lindex [split $arg] 0]     set fd [open $::mphtfile r+]     while {![eof $fd]} {       lappend list [gets $fd]     }     close $fd     set fd [open $::mphtfile w+]     if {[set le [lsearch -exact $list $gamer]] != -1} {       puts -nonewline $fd [join [lreplace $list $le $le] \n]       } else {       putquick "PRIVMSG $chan :That user was not found."     }     close $fd   } } </code></pre></div>Thank you!<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8244">Justdabomb2</a> — Mon Oct 02, 2006 9:20 pm</p><hr />
]]></content>
	</entry>
	</feed>
