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

	<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>2012-05-01T01:08:12-04:00</updated>

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

		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2012-05-01T01:08:12-04:00</updated>

		<published>2012-05-01T01:08:12-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=99304#p99304</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=99304#p99304"/>
		<title type="html"><![CDATA[extracting information from text to variables]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=99304#p99304"><![CDATA[
Here is a simple method to get the same thing:<div class="codebox"><p>Code: </p><pre><code>set text [split $text]set nickname [lindex $text 1]scan [string trim [lindex $text 2] {(),}] {%[^@]@%s} ident ispset ip [string trim [lindex $text 4] {[]}]</code></pre></div>where $text is the:<blockquote class="uncited"><div>CONNECT Zet^ (~<a href="mailto:CHAT2ME.c@41-135-29-27.dsl.mweb.co.za">CHAT2ME.c@41-135-29-27.dsl.mweb.co.za</a>, CHAT2ME.co.za) [41.135.29.27] has connected to the network </div></blockquote><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Tue May 01, 2012 1:08 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[err0r]]></name></author>
		<updated>2012-04-30T19:43:15-04:00</updated>

		<published>2012-04-30T19:43:15-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=99298#p99298</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=99298#p99298"/>
		<title type="html"><![CDATA[Re: extracting information from text to variables]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=99298#p99298"><![CDATA[
Not what i really wanted, but it has given me all i needed to get it going, many thanks willyw<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11976">err0r</a> — Mon Apr 30, 2012 7:43 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[willyw]]></name></author>
		<updated>2012-04-22T02:44:18-04:00</updated>

		<published>2012-04-22T02:44:18-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=99235#p99235</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=99235#p99235"/>
		<title type="html"><![CDATA[Re: extracting information from text to variables]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=99235#p99235"><![CDATA[
<blockquote class="uncited"><div>i have this text :<br>CONNECT Zet^ (~<a href="mailto:CHAT2ME.c@41-135-29-27.dsl.mweb.co.za">CHAT2ME.c@41-135-29-27.dsl.mweb.co.za</a>, CHAT2ME.co.za) [41.135.29.27] has connected to the network<br><br>i would like to capture the nickname, in this case its zet^ <br>also the ident which in this case is CHAT2ME.c<br>the isp which is 41-135-29-27.dsl.mweb.co.za in the example <br>and finally : 41.135.29.27 which is wrapped between [ ]<br><br>any help would be usefull, i understand i need lindex <br></div></blockquote><div class="codebox"><p>Code: </p><pre><code>bind pub - "!capture" captureitproc captureit {nick uhost handle chan text} {        set nname [lindex [split $text] 1]        putserv "privmsg $chan :nname is: $nname"        set temp [lindex [split $text] 2]        set temp [string trimleft $temp ~(]        set ident [lindex [split $temp @] 0]        putserv "privmsg $chan :ident is: $ident"        set isp [lindex [split $temp @] 1]        set isp [string trimright $isp ,]        putserv "privmsg $chan :isp is: $isp"        set ip [lindex [split $text] 4]        set ip [string trim $ip \[\]]        putserv "privmsg $chan :ip is: $ip"}</code></pre></div>This could be condensed.<br><br>Do this in the channel with your bot:<div class="codebox"><p>Code: </p><pre><code>!capture CONNECT Zet^ (~CHAT2ME.c@41-135-29-27.dsl.mweb.co.za, CHAT2ME.co.za) [41.135.29.27] has connected to the network</code></pre></div>and it will respond with the data in the manner you described.<br><br>I'm not sure what you are doing with it, but I hope this is enough of an example to get you going.<br><br>Reference :<br><a href="http://www.tcl.tk/man/tcl8.5/TclCmd/contents.htm" class="postlink">http://www.tcl.tk/man/tcl8.5/TclCmd/contents.htm</a><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10420">willyw</a> — Sun Apr 22, 2012 2:44 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[err0r]]></name></author>
		<updated>2012-04-21T21:06:08-04:00</updated>

		<published>2012-04-21T21:06:08-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=99233#p99233</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=99233#p99233"/>
		<title type="html"><![CDATA[extracting information from text to variables]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=99233#p99233"><![CDATA[
i have this text :<br>CONNECT Zet^ (~<a href="mailto:CHAT2ME.c@41-135-29-27.dsl.mweb.co.za">CHAT2ME.c@41-135-29-27.dsl.mweb.co.za</a>, CHAT2ME.co.za) [41.135.29.27] has connected to the network<br><br>i would like to capture the nickname, in this case its zet^ <br>also the ident which in this case is CHAT2ME.c<br>the isp which is 41-135-29-27.dsl.mweb.co.za in the example <br>and finally : 41.135.29.27 which is wrapped between [ ]<br><br>any help would be usefull, i understand i need lindex <br><br>thanks Err0r<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11976">err0r</a> — Sat Apr 21, 2012 9:06 pm</p><hr />
]]></content>
	</entry>
	</feed>
