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

	<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>2008-10-02T11:31:07-04:00</updated>

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

		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2008-10-02T11:31:07-04:00</updated>

		<published>2008-10-02T11:31:07-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=85378#p85378</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=85378#p85378"/>
		<title type="html"><![CDATA[Connect LookUp]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=85378#p85378"><![CDATA[
You'll need some myqsl-package such as mysqltcl for this..<br>Creating the time-stamp would probably be best done something like this:<div class="codebox"><p>Code: </p><pre><code>set now [clock seconds]set time "[clock format $now -format "%k"]-[expr [clock format $now -format "%M"]&lt;30?"0":"3"]0"</code></pre></div>As for your SQL-query, are you using one table (with one row) for each time-period? If so, wouldn't it be more intuitive to just have one table with several rows (not to mention more efficient)?<br>Also, if you only wish to store the statistical data in the database, you could simply use SQL's own facilities to increase values, rather than keeping a duplicate in your eggdrop...<br><br>A few things tho;<br>Why use multiple string match's instead of a single switch structure? If you need case-insensitive matching, you could simply replace $host with [string tolower $host] as switch-string...<br><br>Why this huge block, instead of the very simple incr command?<div class="codebox"><p>Code: </p><pre><code>set newnumber [expr $aussie + 1]set aussie $newnumber#vsincr aussie#or incr aussie 1</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Thu Oct 02, 2008 11:31 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Furbs]]></name></author>
		<updated>2008-10-02T10:36:34-04:00</updated>

		<published>2008-10-02T10:36:34-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=85377#p85377</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=85377#p85377"/>
		<title type="html"><![CDATA[Connect LookUp]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=85377#p85377"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>bind pubm f * check:connectset aussie "0"set kiwis "0"proc check:connect { nick host hand chan arg } {        if {([string match -nocase "*connect*" [lindex $arg 0]])} {                set nick [lindex $arg 5]                regexp "(\[0-9]{1,3})\.(\[0-9]{1,3})\.(\[0-9]{1,3})\.(\[0-9]{1,3})" [lindex $arg 4] all                putserv "PRIVMSG #sl-oceania :$all"                dnslookup $all resolve_rep        }        if {[string match -nocase "*join*" [lindex $arg 2]]} {                putserv "PRIVMSG #sl-oceania :$arg !"        }}proc resolve_rep {ip host status} {        global aussie kiwis        if {!$status} { putlog "Unable to resolve \037\002$ip\017 ."        } else {                if {[string match -nocase "*.au" $host]} {                        set newnumber [expr $aussie + 1]                        set aussie $newnumber                        putserv "privmsg #sl-oceania :Aussie's Connected: $aussie Woah!!!"                } elseif {[string match -nocase "*.nz" $host]} {                        set newnumber [expr $kiwis + 1]                        set kiwis $newnumber                        putserv "privmsg #sl-oceania :Kiwi's Connected: $kiwis Woah!!!!"                }        }}</code></pre></div><img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br>now i want to make it a bit better, and have absolutely no idea if it'll work or how to do it....<br><br>i know its possible, at that much <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br>Connect to a MySQL DB<br>then insert information when it comes in, stored by times<br>i.e. if its 1:30 and it gets the information, it UPDATES a field, named 1-30, the stuff in it and adds for example, "hello"<br><br>an then if its 2:45 it gets the information, it UPDATES the field, 2-30, and yeah.... done in half hour brackets.....<br><br>heres like a PHP Version if thats helpful<br><div class="codebox"><p>Code: </p><pre><code>$qry = "UPDATE `2-30` SET `kiwis`='$kiwis',`aussies`='$aussies'";mysql_query($qry);</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10242">Furbs</a> — Thu Oct 02, 2008 10:36 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2008-10-02T09:26:13-04:00</updated>

		<published>2008-10-02T09:26:13-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=85376#p85376</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=85376#p85376"/>
		<title type="html"><![CDATA[Connect LookUp]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=85376#p85376"><![CDATA[
Use the dnslookup function and appropriate callback. This skeleton code should help you get started.<br><div class="codebox"><p>Code: </p><pre><code>proc dns_callback {ip host status args} { global kiwi aussie if {$status} {  switch -glob $host {   *.nz {incr kiwi}   *.au {incr aussie}  } }}proc yourproc ....... dnslookup $thehost...}</code></pre></div>Also, a comment on both posts: don't use lindex and other list operations on strings. If you have to convert a string into a list, use the split command. It seems you are having problems with control-codes (ctrl+c for colors in this case), consider scrubbing the string using the stripcodes command.<br><br>Both dnslookup and stripcodes are documented in doc/tcl-commands.doc, and lindex and split are documented in the tcl manual ("man n lindex" or <a href="http://www.tcl.tk/man/tcl8.3/TclCmd/lindex.htm" class="postlink">http://www.tcl.tk/man/tcl8.3/TclCmd/lindex.htm</a>)<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Thu Oct 02, 2008 9:26 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Furbs]]></name></author>
		<updated>2008-10-01T22:23:39-04:00</updated>

		<published>2008-10-01T22:23:39-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=85369#p85369</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=85369#p85369"/>
		<title type="html"><![CDATA[Connect LookUp]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=85369#p85369"><![CDATA[
ok i've made some more improvements,<br><br>it catches when Operserv says CONNECT<br><br>so now i just need someone to make it dns the IP and determine where its from <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br>heres what i've got so far<br><div class="codebox"><p>Code: </p><pre><code>bind pubm f * check:connectproc check:connect { nick host hand chan arg } {        if {([string match -nocase "*connect*" [lindex $arg 0]])} {                regexp "(\[0-9]{1,3})\.(\[0-9]{1,3})\.(\[0-9]{1,3})\.(\[0-9]{1,3})" [lindex $arg 4] all first second third fourth                putserv "PRIVMSG #sl-oceania :$all"        }}</code></pre></div>and it msg's the channel with<br><br>[11:52:13] &lt;@Shiela&gt; 123.456.789.011 (Example IP address <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"> )<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10242">Furbs</a> — Wed Oct 01, 2008 10:23 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Furbs]]></name></author>
		<updated>2008-10-01T21:39:59-04:00</updated>

		<published>2008-10-01T21:39:59-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=85367#p85367</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=85367#p85367"/>
		<title type="html"><![CDATA[Connect LookUp]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=85367#p85367"><![CDATA[
Hey all, long time visitor, first time poster <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=";)" title="Wink"><br><br>was wondering if i could get a bit of help<br><br>what i want is, my eggdrop will get a line, example: [03:01] &lt;OperServ&gt; 4CONNECT on server 12nick!host@stuff (ip) and i want it to, dns the IP, and if it resolves to Australian or New Zealand, to increase a variable (Based on the resolution of their IP). Kiwi = New Zealand and aussie = Australian <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br>its pretty simple and that, but just having problems <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_sad.gif" width="15" height="15" alt=":(" title="Sad"><br><br>so far i've got<br><div class="codebox"><p>Code: </p><pre><code>bind pubm f * check:connectproc check:connect { nick host hand chan arg } {        global kiwi,aussie        putlog [lindex $arg 0]        if { "4CONNECT" == [lindex $arg 0] } {                putserv "PRIVMSG #sl-oceania :woahh new increase $counter"        }}</code></pre></div>FYI, the putlog [lindex $arg 0] is returning [03:05] 4CONNECT<br><br>and its not getting pass the if<br><br>Thanks for the help <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10242">Furbs</a> — Wed Oct 01, 2008 9:39 pm</p><hr />
]]></content>
	</entry>
	</feed>
