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

	<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>2009-05-23T22:35:43-04:00</updated>

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

		<entry>
		<author><name><![CDATA[tomekk]]></name></author>
		<updated>2009-05-21T17:29:10-04:00</updated>

		<published>2009-05-21T17:29:10-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=88860#p88860</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=88860#p88860"/>
		<title type="html"><![CDATA[Trap Bot: delete word on file]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=88860#p88860"><![CDATA[
try:<div class="codebox"><p>Code: </p><pre><code>proc logip {ip} {        if {$ip == "0.0.0.0"} {                return        }        set db_get [open iplog.txt r]        set all_ips [split [read $db_get] "\n"]        close $db_get        if {[lsearch $all_ips $ip] != -1} {                return        }        set file [open iplog.txt a+]        puts $file "$ip"        close $file}</code></pre></div>or, if want with "a+" without extra file reading:<div class="codebox"><p>Code: </p><pre><code>proc logip {ip} {        if {$ip == "0.0.0.0"} {                return        }        set file [open iplog.txt a+]        seek $file 0        set all_ips [split [read $file] "\n"]        if {[lsearch $all_ips $ip] != -1} {                close $file                return        }        seek $file 0 end        puts $file "$ip"        close $file}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10332">tomekk</a> — Thu May 21, 2009 5:29 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Papillon]]></name></author>
		<updated>2009-05-21T17:19:32-04:00</updated>

		<published>2009-05-21T17:19:32-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=88859#p88859</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=88859#p88859"/>
		<title type="html"><![CDATA[Trap Bot: delete word on file]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=88859#p88859"><![CDATA[
try something like this<div class="codebox"><p>Code: </p><pre><code>proc logip {ip} {set file [open iplog.txt a+]set info [split [read $file] \n]]if {$ip != "0.0.0.0" &amp;&amp; [string equal [lsearch -exact $info $ip] "-1"]} {puts $file "$ip"}close $file}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=852">Papillon</a> — Thu May 21, 2009 5:19 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Rapfnny]]></name></author>
		<updated>2009-05-21T14:47:04-04:00</updated>

		<published>2009-05-21T14:47:04-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=88855#p88855</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=88855#p88855"/>
		<title type="html"><![CDATA[Another Issue]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=88855#p88855"><![CDATA[
Thanks! I edited the script and it works fine now. Here's the next thing i need help with.<div class="codebox"><p>Code: </p><pre><code>proc logip {ip} {  set file [open iplog.txt a+]  if {$ip != "0.0.0.0"} {    puts $file "$ip"  } close $file }</code></pre></div>But I would like to know how I can make it search if $ip exists in the file, and if it does, it doesnt write $ip to the file twice.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10660">Rapfnny</a> — Thu May 21, 2009 2:47 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[tomekk]]></name></author>
		<updated>2009-05-21T14:09:00-04:00</updated>

		<published>2009-05-21T14:09:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=88852#p88852</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=88852#p88852"/>
		<title type="html"><![CDATA[Re: Trap Bot: error with # of args]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=88852#p88852"><![CDATA[
<blockquote class="uncited"><div>Here's my script:<blockquote class="uncited"><div>[13:53] Tcl error [userip]: wrong # args: should be "userip nick uhost hand channel txt"</div></blockquote>When its already there. &gt;:\  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_eek.gif" width="15" height="15" alt=":shock:" title="Shocked"> What can I do to fix this?</div></blockquote>from tcl-commands.txt:<blockquote class="uncited"><div>(8)  JOIN (stackable)<br>         bind join &lt;flags&gt; &lt;mask&gt; &lt;proc&gt;<br>         procname &lt;nick&gt; &lt;user@host&gt; &lt;handle&gt; &lt;channel&gt;<br><br>         Description: triggered by someone joining the channel. The mask in<br>           the bind is matched against "#channel nick!user@host" and can<br>           contain wildcards.<br>         Module: irc</div></blockquote>change<div class="codebox"><p>Code: </p><pre><code>proc userip { nick uhost hand channel txt } {</code></pre></div>to<div class="codebox"><p>Code: </p><pre><code>proc userip { nick uhost hand channel } {</code></pre></div><img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=";)" title="Wink"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10332">tomekk</a> — Thu May 21, 2009 2:09 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Rapfnny]]></name></author>
		<updated>2009-05-23T22:35:43-04:00</updated>

		<published>2009-05-21T14:02:15-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=88851#p88851</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=88851#p88851"/>
		<title type="html"><![CDATA[Trap Bot: delete word on file]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=88851#p88851"><![CDATA[
Never mind I decided to finish it. Here's what i need help on next:<br>I decided to make it go by nicks. I wan't the nick to be removed from nicklog.db if it is kicked from the channel heres my current code which isn't working.<div class="codebox"><p>Code: </p><pre><code>bind kick - "#DontJoinItsATrap" unlogproc unlog {nick uhost hand chan reason} {  set input [open nicklog.db]  set output [open nicklog.tmp w]  while {[gets $input line] &gt;= 0} { if {[lsearch $line [string tolower $nick]] &lt; 0} { puts $output $line } }  close $input  close $output  file rename -force nicklog.tmp nicklog.db  putserv "NOTICE $nick You have escaped ^_^"}</code></pre></div>It doesnt do anything at all when i kick someone.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10660">Rapfnny</a> — Thu May 21, 2009 2:02 pm</p><hr />
]]></content>
	</entry>
	</feed>
