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

	<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>2002-01-12T01:35:00-04:00</updated>

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

		<entry>
		<author><name><![CDATA[stdragon]]></name></author>
		<updated>2002-01-12T01:35:00-04:00</updated>

		<published>2002-01-12T01:35:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=3736#p3736</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=3736#p3736"/>
		<title type="html"><![CDATA[Auth]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=3736#p3736"><![CDATA[
It's all in the documentation, man. Read about the open command. Hint: You are opening in mode 'w' which is overwriting the file.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8">stdragon</a> — Sat Jan 12, 2002 1:35 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2002-01-11T23:32:00-04:00</updated>

		<published>2002-01-11T23:32:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=3734#p3734</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=3734#p3734"/>
		<title type="html"><![CDATA[Auth]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=3734#p3734"><![CDATA[
Help...<br><br>Though I managed to write data into file auth.data.db, it seems that if a different "handle" auth him/herself, it would overwrite other handles. Which means that the file would only contain 1 handle details. Any solutions?<p>Statistics: Posted by Guest — Fri Jan 11, 2002 11:32 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2002-01-11T04:24:00-04:00</updated>

		<published>2002-01-11T04:24:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=3702#p3702</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=3702#p3702"/>
		<title type="html"><![CDATA[Auth]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=3702#p3702"><![CDATA[
Alright! I've got it. Thanks stdragon. Btw, there's this code<div class="codebox"><p>Code: </p><pre><code>if {[getuser $authhand XTRA auth] == 2} {    puthelp "NOTICE $nick :You are already authenticated."    return 0  }</code></pre></div>This would prevent the user from '/msg $botnick auth &lt;handle&gt; &lt;password&gt;' twice. Is there anyway I can make it such that if the user has already auth and it trying to auth from the same host, the bot would give the above syntax. However if the user is from a different host (clones) and tries to auth, it will allow the user to auth?<br><br>&lt;font size=-1&gt;[ This Message was edited by: stafford on 2002-01-11 02:17 ]&lt;/font&gt;<p>Statistics: Posted by Guest — Fri Jan 11, 2002 4:24 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[stdragon]]></name></author>
		<updated>2002-01-11T02:06:00-04:00</updated>

		<published>2002-01-11T02:06:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=3699#p3699</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=3699#p3699"/>
		<title type="html"><![CDATA[Auth]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=3699#p3699"><![CDATA[
First of all, your "gets" line is incorrect. Read the man page at <a href="http://www.scriptics.com" class="postlink">http://www.scriptics.com</a> or tcl.activestate.com for information on the proper syntax.<br><br>About your question... you could use the "split" command, or you could change the database format. Instead of putting all the data on one line, why not split it up like:<br><br>nick<br>uhost<br>time<br>[blank line]<br>nick<br>uhost<br>time<br><br>Another option would be to separate the fields by tabs instead of spaces, so that you can do [split $line t]. That is preferable to the normal split command, because some of your fields (time) include spaces.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8">stdragon</a> — Fri Jan 11, 2002 2:06 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2002-01-11T01:37:00-04:00</updated>

		<published>2002-01-11T01:37:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=3697#p3697</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=3697#p3697"/>
		<title type="html"><![CDATA[Auth]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=3697#p3697"><![CDATA[
Ok, i've managed to figure it out how should I write into into database. I have a query now... hopefully someone can help. Here's part of the code:<br><div class="codebox"><p>Code: </p><pre><code>set authrec [open "auth.data.db" w]  puts $authrec "$hand $nick!$host [clock format [clock seconds] -format "%a %b %d %I:%M:%S SGT %Y"]"  close $authrec</code></pre></div>That above would write the data to file.<br><div class="codebox"><p>Code: </p><pre><code>bind msg - info msg_infoproc msg_info {nick host hand arg} {  set authrec [open "auth.data.db" r]  gets $authrec  puthelp "NOTICE $nick :Registered Handle: [lindex authrec 0]"  close $authrec  return 0}</code></pre></div>How can I spilt the data such that the data recorded ($hand $nick!$host) and time can be each displayed as:<br><br>Registered Handle: $hand<br>last seen host: $nick!host<br>last time auth: 'time format'<br><br>Any help would be greatly appreciated.<br><br>&lt;font size=-1&gt;[ This Message was edited by: Stafford on 2002-01-10 22:38 ]&lt;/font&gt;<p>Statistics: Posted by Guest — Fri Jan 11, 2002 1:37 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2002-01-10T09:47:00-04:00</updated>

		<published>2002-01-10T09:47:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=3669#p3669</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=3669#p3669"/>
		<title type="html"><![CDATA[Auth]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=3669#p3669"><![CDATA[
Thanks ppslim. I've changed the part proc. Here's the code of '/msg $botnick auth &lt;nick&gt; &lt;pass&gt;'. Is there anyway I can set a database (which is written to a file) and record the exact time the user auth? I'm not sure how to go about doing it.<div class="codebox"><p>Code: </p><pre><code>proc msg_auth {nick host hand arg} {  global botnick auth_clones rms_services  set authhand [lindex $arg 0]  set passwd [lindex $arg 1]  if {([llength [split $arg]]) &gt; 2 || ([llength [split $arg]]) &lt; 2} {    puthelp "NOTICE $nick :SYNTAX: /msg $botnick AUTH &lt;nick&gt; &lt;password&gt;"    return 0  }  if {[validuser $authhand] == 0} {    puthelp "NOTICE $nick :That nick is not registered in my database."    return 0  }  if {[passwdok $authhand $passwd] == 0} {     puthelp "NOTICE $nick :Authentication failed. Incorrect password"    return 0   }  if {[getuser $authhand XTRA auth] == 2} {    puthelp "NOTICE $nick :You are already authenticated."    return 0  }  putcmdlog "AUTH: $nick identified as $authhand"  setuser $authhand XTRA authhost $host  if {$auth_clones == 1} {  setuser $authhand XTRA authnick $nick } if {$hand != $authhand} {# We need to temporarly add $hand's hostmast to $ahand  setuser $authhand HOSTS "*!$host"  setuser $authhand XTRA auth 2  putcmdlog "AUTH: $nick identified as $authhand with temporary hostmask *!$host" } {  setuser $authhand XTRA auth 1  putcmdlog "AUTH: $nick identified as $authhand with known host $host" }   if {[nick2hand $nick] == ""} {   puthelp "NOTICE $nick :Authentication successful."   puthelp "NOTICE $nick :You have $rms_services(joinlimit) minutes to join any channels I'm in or your authentication will expire."   putcmdlog "&lt;$hand&gt; Authenticated at [clock format [clock seconds] -format "%I:%M:%S %p"]"   timer $rms_services(joinlimit) "auth_check $nick $authhand"   return 0 }}</code></pre></div><p>Statistics: Posted by Guest — Thu Jan 10, 2002 9:47 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ppslim]]></name></author>
		<updated>2002-01-09T12:51:00-04:00</updated>

		<published>2002-01-09T12:51:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=3643#p3643</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=3643#p3643"/>
		<title type="html"><![CDATA[Auth]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=3643#p3643"><![CDATA[
Read doc/tcl-commands.doc<br><blockquote class="uncited"><div>proc part_auth {nick host hand chan} {</div></blockquote>Read the section on binds (notible the part on the type PART).<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2">ppslim</a> — Wed Jan 09, 2002 12:51 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2002-01-09T03:30:00-04:00</updated>

		<published>2002-01-09T03:30:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=3623#p3623</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=3623#p3623"/>
		<title type="html"><![CDATA[Auth]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=3623#p3623"><![CDATA[
Ok, i need help with this thing. It gave me this error... TCL error [part_auth]: called "part_auth" with too many arguments<br><br>Here's the code<div class="codebox"><p>Code: </p><pre><code>proc auth:timer {hand} { if {[hand2nick $hand] != ""} {    return 0 } set a [getuser $hand XTRA auth] if {$a != 0} {   setuser $hand XTRA auth 0   putcmdlog "AUTH: $hand didn't (re)join a channel in time." if {$a == 2} {   set tmphost "*![getuser $hand XTRA authhost]"   delhost $hand $tmphost   putcmdlog "AUTH: Temporary hostmask $tmphost removed from $hand."  } }}proc part_auth {nick host hand chan} {  if { $hand == "*" } { return 0 }  set a [getuser $hand XTRA auth]  if { $a &gt;= 1 } {     utimer 10 "auth:timer $hand"  }}</code></pre></div>Hope someone can help me out.<br><br>&lt;font size=-1&gt;[ This Message was edited by: stafford on 2002-01-09 08:13 ]&lt;/font&gt;<p>Statistics: Posted by Guest — Wed Jan 09, 2002 3:30 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ppslim]]></name></author>
		<updated>2002-01-09T01:59:00-04:00</updated>

		<published>2002-01-09T01:59:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=3620#p3620</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=3620#p3620"/>
		<title type="html"><![CDATA[Auth]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=3620#p3620"><![CDATA[
Yes, there are plenty of scripts with this wort of system in.<br><br>Many of which are available in the Tcl archive.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2">ppslim</a> — Wed Jan 09, 2002 1:59 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2002-01-09T01:49:00-04:00</updated>

		<published>2002-01-09T01:49:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=3619#p3619</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=3619#p3619"/>
		<title type="html"><![CDATA[Auth]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=3619#p3619"><![CDATA[
Hi guys, I'm wondering if there's such a script out there or someone has an idea about this:<br><br>'/msg $botnick auth $handle $passwd'<br><br>Any coding for this? The passwd should match that of $handle<p>Statistics: Posted by Guest — Wed Jan 09, 2002 1:49 am</p><hr />
]]></content>
	</entry>
	</feed>
