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

	<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>2015-08-06T11:31:18-04:00</updated>

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

		<entry>
		<author><name><![CDATA[COBRa]]></name></author>
		<updated>2015-08-06T11:31:18-04:00</updated>

		<published>2015-08-06T11:31:18-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=104343#p104343</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=104343#p104343"/>
		<title type="html"><![CDATA[Lindex help]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=104343#p104343"><![CDATA[
Hi using similar code to the previous post in trying to capture this line via the regex method and wondered if you guys could assist me plz i think its the regex line thts wrong anyhow heres my first draught<br><div class="codebox"><p>Code: </p><pre><code>proc rls:spec {nick host hand chan arg} {   global chann_ sitebot_ ftp_     if { $chan == $chann_(spam) &amp;&amp; $nick == $sitebot_(nick) } {         set pattern {([^&gt;]+)? &gt; Codec: ([^&gt;]+)? FPS: ([^fps][0-9]+)? Res:([0-9]+)? AR: ([0-9]+)? &gt; Audio: ([^&gt;]+)? BitRate: ([^kbps][0-9]+)? Freq: ([^KHz][0-9]+)? Channels: ([^ch][0-9]+)?}         if { [regexp $pattern $arg match rlsname videocodec fps ar audiocodec audiobitrate audiofreq channels] } {      if {[string trim $videocodec] == ""} { set videocodec "-" }         if {[string trim $fps] == ""} { set fps "-" }         if {[string trim $ar] == ""} { set ar "-" }         if {[string trim $audiocodec] == ""} { set audiocodec "-" }         if {[string trim $audiobitrate] == ""} { set audiobitrate "-" }         if {[string trim $audiofreq] == ""} { set audiofreq "-" }         if {[string trim $channels] == ""} { set channels "-" }         if { $rlsname == "" } {               putquick "PRIVMSG $chann_(add) :\0034 Error!! Release Name Empty\003"               return 0            }         } else {            putserv "PRIVMSG $chann_(add) :$arg didn't match"            return 0         }            putquick "PRIVMSG $chann_(add) :!addvideoinfo $rlsname $videocodec $fps $ar $audiocodec $audiobitrate $audiofreq $channels"            putquick "PRIVMSG $chann_(add) :\[\0035SAMPLE-SPEC\003\] $rlsname"   }}        </code></pre></div>and this is the line im trying to capture<br><div class="codebox"><p>Code: </p><pre><code>SPEC &gt; At.Midnight.2015.08.05.HDTV.x264-TASTETV &gt; Codec: AVC FPS: 29.970fps Res: 720x404 AR: 16:9 &gt; Audio: AAC BitRate: 124Kbps Freq: 48.0KHz Channels: 2ch</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12170">COBRa</a> — Thu Aug 06, 2015 11:31 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[COBRa]]></name></author>
		<updated>2014-07-08T13:23:53-04:00</updated>

		<published>2014-07-08T13:23:53-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=102975#p102975</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=102975#p102975"/>
		<title type="html"><![CDATA[Lindex help]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=102975#p102975"><![CDATA[
Many thanks to all that helped me sort the code out it now works fine<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12170">COBRa</a> — Tue Jul 08, 2014 1:23 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2014-07-03T13:06:27-04:00</updated>

		<published>2014-07-03T13:06:27-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=102965#p102965</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=102965#p102965"/>
		<title type="html"><![CDATA[Lindex help]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=102965#p102965"><![CDATA[
Sorry for the late answer.<br><br>Since you are using the "pub" binding, "id3" is considered the command, and thus removed from the text-argument ($arg). Thus, the regular expression needs to be adjusted accordingly:<div class="codebox"><p>Code: </p><pre><code>set pattern {([^&gt;]+)? &gt; ([^&gt;]+)? from ([0-9]+)? at ([0-9]+)? Hz}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Thu Jul 03, 2014 1:06 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[COBRa]]></name></author>
		<updated>2014-07-03T12:15:13-04:00</updated>

		<published>2014-07-03T12:15:13-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=102963#p102963</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=102963#p102963"/>
		<title type="html"><![CDATA[Lindex help]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=102963#p102963"><![CDATA[
The !addid3c is announced in a specific channel and another bot which is linked adds the info into a database so yes its part of this code<br><br>so when the line !addid3c some_release some_genre etc hits the channel another bot picks up the !addid3c line and enter it into the database<br><br>the error im getting is this <br><br>Deine_Freunde-Heile_Welt-DE-2014-CARDiNALS &gt; Pop from 2014 at 44100 Hz didn't match<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12170">COBRa</a> — Thu Jul 03, 2014 12:15 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[CrazyCat]]></name></author>
		<updated>2014-07-02T06:42:07-04:00</updated>

		<published>2014-07-02T06:42:07-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=102962#p102962</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=102962#p102962"/>
		<title type="html"><![CDATA[Lindex help]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=102962#p102962"><![CDATA[
Ok, so the "!addid3c" command has no relation with this part of the script.<br><br>Can you give me an example of non-matching command ? (paste the complete irc log without any modification).<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=691">CrazyCat</a> — Wed Jul 02, 2014 6:42 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[COBRa]]></name></author>
		<updated>2014-07-01T12:44:49-04:00</updated>

		<published>2014-07-01T12:44:49-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=102958#p102958</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=102958#p102958"/>
		<title type="html"><![CDATA[Lindex help]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=102958#p102958"><![CDATA[
the bind is this <div class="codebox"><p>Code: </p><pre><code>bind pub - iD3 rls:id3</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12170">COBRa</a> — Tue Jul 01, 2014 12:44 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[CrazyCat]]></name></author>
		<updated>2014-06-30T06:01:43-04:00</updated>

		<published>2014-06-30T06:01:43-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=102952#p102952</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=102952#p102952"/>
		<title type="html"><![CDATA[Lindex help]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=102952#p102952"><![CDATA[
Here's a small correction : added a debug advert when regexp didn't matches.<div class="codebox"><p>Code: </p><pre><code>proc rls:id3 {nick host hand chan arg} {   global chann_ sitebot_ ftp_    if { $chan == $chann_(spam) &amp;&amp; $nick == $sitebot_(nick) } {         set pattern {iD3 &gt; ([^&gt;]+)? &gt; ([^&gt;]+)? from ([0-9]+)? at ([0-9]+)? Hz}         if { [regexp $pattern $arg match rlsname genre year sampling] } {            if {[string trim $genre] == ""} { set genre "-" }            if {[string trim $year] == ""} { set year "-" }            if {[string trim $sampling] == ""} { set sampling "-" }            if { $rlsname == "" } {               putquick "PRIVMSG $chann_(echo) :\0034 Error!! Release Name Empty\003"               return 0            }         } else {            putserv "PRIVMSG $chann_(echo) :$arg didn't match"            return 0         }         putquick  "PRIVMSG $chann_(echo) :!addid3c $rlsname $genre $year $sampling"    }}</code></pre></div>I noticed something strange in your code:<div class="codebox"><p>Code: </p><pre><code>putquick  "PRIVMSG $chann_(echo) :!addid3c $rlsname $genre $year $sampling"</code></pre></div>Is !addid3c the bind for the rls:id3 proc ? If it is, the "command line" is not what is expected in the regexp.<br><br>If you really want help, I think you have to give us your complete code and not just bits of it.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=691">CrazyCat</a> — Mon Jun 30, 2014 6:01 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[COBRa]]></name></author>
		<updated>2014-06-27T12:41:16-04:00</updated>

		<published>2014-06-27T12:41:16-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=102943#p102943</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=102943#p102943"/>
		<title type="html"><![CDATA[Lindex help]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=102943#p102943"><![CDATA[
I've checked the pattern and it seems ok i dont understand where the error is coming from is it the code ive posted plz ?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12170">COBRa</a> — Fri Jun 27, 2014 12:41 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2014-06-27T11:47:42-04:00</updated>

		<published>2014-06-27T11:47:42-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=102942#p102942</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=102942#p102942"/>
		<title type="html"><![CDATA[Lindex help]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=102942#p102942"><![CDATA[
Hello,<br>Worth keeping in mind, when it comes to regexp and regular expressions:<br>The variables listed in the command line, will only be set if there is a match for the pattern within the text string. The regexp command will return 1 if a match was found, otherwise 0.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Fri Jun 27, 2014 11:47 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[COBRa]]></name></author>
		<updated>2014-06-27T10:21:22-04:00</updated>

		<published>2014-06-27T10:21:22-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=102941#p102941</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=102941#p102941"/>
		<title type="html"><![CDATA[Lindex help]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=102941#p102941"><![CDATA[
thx bud added the code but im getting an error<br><br>[16:14:13] Tcl error [cmdencryptedincominghandler]: can't read "genre": no such variable<br><br>this is my code<br><div class="codebox"><p>Code: </p><pre><code>proc rls:id3 {nick host hand chan arg} {global chann_ sitebot_ ftp_    if { $chan == $chann_(spam) &amp;&amp; $nick == $sitebot_(nick) } {                 set pattern {iD3 &gt; ([^&gt;]+)? &gt; ([^&gt;]+)? from ([0-9]+)? at ([0-9]+)? Hz}                  regexp $pattern $arg match rlsname genre year sampling                  if {[string trim $genre] == ""} { set genre "-" } if {[string trim $year] == ""} { set year "-" } if {[string trim $sampling] == ""} { set sampling "-" }                       if { $rlsname == "" } {  putquick "PRIVMSG $chann_(echo) :\0034 Error!! Release Name Empty\003"  return    } putquick  "PRIVMSG $chann_(echo) :!addid3c $rlsname $genre $year $sampling"          }    }</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12170">COBRa</a> — Fri Jun 27, 2014 10:21 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[CrazyCat]]></name></author>
		<updated>2014-06-27T08:46:09-04:00</updated>

		<published>2014-06-27T08:46:09-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=102940#p102940</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=102940#p102940"/>
		<title type="html"><![CDATA[Lindex help]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=102940#p102940"><![CDATA[
Just a small question before answering you: even if a field is blank, is it mentionned, like:<div class="codebox"><p>Code: </p><pre><code>iD3 &gt; Express_Viviana_Ft._Natt_-_Feel_The_Soul-(HC0045)-WEB-2014-SRG &gt; from 2014 at 44100 Hz</code></pre></div>I hope it is, and you have to change the pattern into:<div class="codebox"><p>Code: </p><pre><code>set pattern {iD3 &gt; ([^&gt;]+)? &gt; ([^&gt;]+)? from ([0-9]+)? at ([0-9]+)? Hz}</code></pre></div>And to set an empty field to "-", just do:<div class="codebox"><p>Code: </p><pre><code>if {[string trim $genre]==""]} { set genre "-" }</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=691">CrazyCat</a> — Fri Jun 27, 2014 8:46 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[COBRa]]></name></author>
		<updated>2014-06-27T03:48:56-04:00</updated>

		<published>2014-06-27T03:48:56-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=102939#p102939</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=102939#p102939"/>
		<title type="html"><![CDATA[Lindex help]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=102939#p102939"><![CDATA[
Ok many thx I understand just one last question if one of the fields is blank ie genre for example how could I show it as a - for example<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12170">COBRa</a> — Fri Jun 27, 2014 3:48 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[CrazyCat]]></name></author>
		<updated>2014-06-27T03:39:48-04:00</updated>

		<published>2014-06-27T03:39:48-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=102938#p102938</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=102938#p102938"/>
		<title type="html"><![CDATA[Lindex help]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=102938#p102938"><![CDATA[
...<br><br>the regexp line assigns the values to rlsname, genre, year and sampling.<br>It's an alternative to the affectations using the lindex. It replaces your 4-lines code and do exactly the same.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=691">CrazyCat</a> — Fri Jun 27, 2014 3:39 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[COBRa]]></name></author>
		<updated>2014-06-27T00:00:49-04:00</updated>

		<published>2014-06-27T00:00:49-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=102937#p102937</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=102937#p102937"/>
		<title type="html"><![CDATA[Lindex help]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=102937#p102937"><![CDATA[
So I could use something like <br><div class="codebox"><p>Code: </p><pre><code>$rlsname=""             $genre=""</code></pre></div>As I'm not sure<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12170">COBRa</a> — Fri Jun 27, 2014 12:00 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[CrazyCat]]></name></author>
		<updated>2014-06-26T15:02:15-04:00</updated>

		<published>2014-06-26T15:02:15-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=102936#p102936</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=102936#p102936"/>
		<title type="html"><![CDATA[Lindex help]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=102936#p102936"><![CDATA[
If you use the code posted by nml375, all variables are setted.<br>You just have to use $rlsname, $genre, ..., without any set.<br><br>Have a look on <a href="http://wiki.tcl.tk/986" class="postlink">http://wiki.tcl.tk/986</a><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=691">CrazyCat</a> — Thu Jun 26, 2014 3:02 pm</p><hr />
]]></content>
	</entry>
	</feed>
