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

	<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>2007-08-22T09:49:08-04:00</updated>

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

		<entry>
		<author><name><![CDATA[ipone]]></name></author>
		<updated>2007-08-22T09:49:08-04:00</updated>

		<published>2007-08-22T09:49:08-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=75442#p75442</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=75442#p75442"/>
		<title type="html"><![CDATA[Search and write file.]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=75442#p75442"><![CDATA[
Now i have tested many things to make this work, and it just will not work :/<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7525">ipone</a> — Wed Aug 22, 2007 9:49 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ipone]]></name></author>
		<updated>2007-08-14T22:00:19-04:00</updated>

		<published>2007-08-14T22:00:19-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=75287#p75287</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=75287#p75287"/>
		<title type="html"><![CDATA[Search and write file.]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=75287#p75287"><![CDATA[
thats look pretty sweet, but i dont really understand how the tcl file should look like for it to work? im new at this so can u help me with that? i want i to logg the nicks an uhost like nick1,nick2,nick3@$uhost everytime somone joins the channel.. or if someone else have an ide.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7525">ipone</a> — Tue Aug 14, 2007 10:00 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[awyeah]]></name></author>
		<updated>2007-07-20T00:26:13-04:00</updated>

		<published>2007-07-20T00:26:13-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=74596#p74596</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=74596#p74596"/>
		<title type="html"><![CDATA[Search and write file.]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=74596#p74596"><![CDATA[
Well then these won't work if you store 2 nicks and then one host, and then follow up, more nicks and so on for the same host.<br><div class="codebox"><p>Code: </p><pre><code>#if nick is already present in list, haltforeach user $datalist { if {[string equal -nocase "[lindex [split $user] 0]" $nick]} {  return 0  }}#check if uhost is present in listforeach host $datalist { if {[string equal -nocase "[lindex [split $host] 1]" $uhost]} {  set host:found 1; break  }}</code></pre></div>Since the database will check the first element for a nick and the second element for a uhost.<br><br>You should have a proper format for all database entries, so that they can be differentiated from nicks and uhosts. But then again maybe you can check for the entry with an @, which will be a uhost and then lsearch the entry number in the list and then lindex the list with that entry and get the uhost and then compare it.<br><br>However a proper differentiated format would be better. Something like:<br><blockquote class="uncited"><div>nick:$uhost<br>nick1,nick2:$uhost<br>nick1,nick2,nick3:$uhost</div></blockquote><div class="codebox"><p>Code: </p><pre><code>#If suppose $data is the total data in the file then read the data as a list#and you can get the nicks and uhosts by:set nicklist [list]foreach entry $data { lappend nicklist [lindex [split $entry :] 0]}set uhostlist [list]foreach entry $data { lappend uhostlist [lindex [split $entry :] 1]}#Then you check if the nick is not already in the list#if nick is already present in list, haltforeach user $nicklist { if {[string match -nocase "*$user*" $nick]} {  set nickfound 1; break  }}if {![info exists nickfound]} { return 0#find the entry in the nicklist and uhostlist} else { set findnick [lsearch -glob [split [string tolower $nicklist]] *$nick*] set finduhost [lsearch -glob [split [string tolower $uhostlist]] *uhost*]}#if everything is ok, then proceedif {$findnick == $finduhost} {##then you can use lreplace to replace the entry however you want#</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4875">awyeah</a> — Fri Jul 20, 2007 12:26 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ipone]]></name></author>
		<updated>2007-07-19T14:43:26-04:00</updated>

		<published>2007-07-19T14:43:26-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=74586#p74586</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=74586#p74586"/>
		<title type="html"><![CDATA[Search and write file.]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=74586#p74586"><![CDATA[
Was almost that i where looking for. I was wondering  something about this code..<div class="codebox"><p>Code: </p><pre><code>#if uhost present in list delete that line write the new nick and uhost to fileif {[info exists host:found]} { set user "$nick $host" set i [lsearch -exact [split [string tolower $datalist]] [split $user]] set datalist [lsort -unique [lreplace $datalist $i $i]] set fp [open $nicklista w] puts $fp [join $nicklista "\n"] close $fp} </code></pre></div>That means that the newest nick are going to be in the database?<br><br>I want it to store the nicks associated whit the users uhost. for exampel<br><br>Iamwithstupid (<a href="mailto:test@some.host.eu.se">test@some.host.eu.se</a>) has joined #Testing<br>then parts and joins with a diffrent nick.<br>Buzz (<a href="mailto:test@some.host.eu.se">test@some.host.eu.se</a>) has joined #Testing<br><br>so it would look something like this i the database:<br>Buzz Iamwithstupid <a href="mailto:test@some.host.eu.se">test@some.host.eu.se</a><br><br>Is it even possible? And thank you awyeah for your help so far, iam going to try the code you just wrote and see if i can change it somehow to store all the nicks and uhost on one line.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7525">ipone</a> — Thu Jul 19, 2007 2:43 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[awyeah]]></name></author>
		<updated>2007-07-19T07:31:46-04:00</updated>

		<published>2007-07-19T07:31:46-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=74566#p74566</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=74566#p74566"/>
		<title type="html"><![CDATA[Search and write file.]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=74566#p74566"><![CDATA[
Let me get this straight, if you have an entries in your database, and someone with a different nick and uhost join the channel (corresponding to an old entry in the database with a different nick but same uhost), then if that is what you want you can do this:<br><div class="codebox"><p>Code: </p><pre><code>#read data from fileset fp [open $nicklista r]set data [read -nonewline $fp]close $fpset datalist [split $data "\n"]#if nick is already present in list, haltforeach user $datalist { if {[string equal -nocase "[lindex [split $user] 0]" $nick]} {  return 0  }}#check if uhost is present in listforeach host $datalist { if {[string equal -nocase "[lindex [split $host] 1]" $uhost]} {  set host:found 1; break  }}#if uhost present in list delete that line write the new nick and uhost to fileif {[info exists host:found]} { set user "$nick $host" set i [lsearch -exact [split [string tolower $datalist]] [split $user]] set datalist [lsort -unique [lreplace $datalist $i $i]] set fp [open $nicklista w] puts $fp [join $nicklista "\n"] close $fp}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4875">awyeah</a> — Thu Jul 19, 2007 7:31 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ipone]]></name></author>
		<updated>2007-07-18T11:21:22-04:00</updated>

		<published>2007-07-18T11:21:22-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=74514#p74514</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=74514#p74514"/>
		<title type="html"><![CDATA[Search and write file.]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=74514#p74514"><![CDATA[
Hey, I've just done a simple little code and It's working as planned. Although I would like to be able to have X host in the nicks.txt file so that if that same X joins the channel the new nickname of that X will be put in the same line. (associated with the old nicknames) BUT! here's the catch, if X joins with a nickname that is already in the list, I don't want it to be logged as a new nick in nicks.txt<br><div class="codebox"><p>Code: </p><pre><code>set nicklista "nicks.txt"bind join - * join_onjoinproc join_onjoin {nick uhost hand chan} { global nicklista  set filename $nicklista  set txt [open $filename "a"]  puts $txt "$nick $uhost"  close $txt}</code></pre></div>Has anyone got an idea?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7525">ipone</a> — Wed Jul 18, 2007 11:21 am</p><hr />
]]></content>
	</entry>
	</feed>
