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

	<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>2007-12-17T20:16:47-04:00</updated>

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

		<entry>
		<author><name><![CDATA[liljim]]></name></author>
		<updated>2007-12-13T00:14:58-04:00</updated>

		<published>2007-12-13T00:14:58-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=79292#p79292</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=79292#p79292"/>
		<title type="html"><![CDATA[Simple allmusic.com trigger]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=79292#p79292"><![CDATA[
Perfect. Thank you very much!<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9537">liljim</a> — Thu Dec 13, 2007 12:14 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[speechles]]></name></author>
		<updated>2007-12-17T20:16:47-04:00</updated>

		<published>2007-12-12T18:50:09-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=79289#p79289</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=79289#p79289"/>
		<title type="html"><![CDATA[Simple allmusic.com trigger]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=79289#p79289"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>setudef flag allmusicbind pubm -|- "*" allmusic:replyproc allmusic:reply {nick uhand hand chan input} {  # simple channel flag return if turned off  if {[lsearch -exact [channel info $chan] +allmusic] == -1} { return 0 }  switch [string tolower [lindex [split $input] 0]] {    !artist { putserv "PRIVMSG $chan :Artist search: http://www.allmusic.com/cg/amg.dll?p=amg&amp;sql=1:[string map -nocase {" ""%20"} [join [lrange [split $input] 1 end]]]" }    !album  { putserv "PRIVMSG $chan :Album search: http://www.allmusic.com/cg/amg.dll?p=amg&amp;sql=2:[string map -nocase {" ""%20"} [join [lrange [split $input] 1 end]]]" }    !song   { putserv "PRIVMSG $chan :Song search: http://www.allmusic.com/cg/amg.dll?p=amg&amp;sql=3:[string map -nocase {" ""%20"} [join [lrange [split $input] 1 end]]]" }    !style  { putserv "PRIVMSG $chan :Style search: http://www.allmusic.com/cg/amg.dll?p=amg&amp;sql=4:[string map -nocase {" ""%20"} [join [lrange [split $input] 1 end]]]" }    !label  { putserv "PRIVMSG $chan :Label search: http://www.allmusic.com/cg/amg.dll?p=amg&amp;sql=5:[string map -nocase {" ""%20"} [join [lrange [split $input] 1 end]]]" }    default { return 0 }  }}#deny-word-wrap###############################################################################################################################################################</code></pre></div>In and of itself, this is a very very basic beginning for you.  You will still need to validate input and formulate some kind of flood protection.<br><br>What you have is the string map to change spaces to %20's which also works like your pipe's | do.. %20 is more logical to use in this case. Keep in mind you will more than likely need to trap bad user input (think people purposely trying to break your bot giving it invalid or special characters) during your input validation part and maybe lengthen the string map i've used in each switch to control them as well.  You also have your switch for the different triggers. I used a single bind to * because it's easier to sort triggers with one proc, than to build several seperate ones.  Not tested but should work, albeit with the minor problems mentioned above because I'm leaving some of the fun up to you in creating the script.  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br>Edit: Added a simple chanset flag +/-allmusic.  This way you can beter refine where this actually produces an output so as your tailoring this script it isn't possible for others to trigger it elsewhere if your bot resides in several channels. A helpful addition. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=";)" title="Wink"><br><br>Remember to <strong class="text-strong">1</strong> source scripts/this-script.tcl in your eggdrop.conf, <strong class="text-strong">2</strong> .rehash, <strong class="text-strong">3</strong> then finally .chanset #yourchan +allmusic for this to work at all.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8138">speechles</a> — Wed Dec 12, 2007 6:50 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[liljim]]></name></author>
		<updated>2007-12-11T19:18:11-04:00</updated>

		<published>2007-12-11T19:18:11-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=79253#p79253</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=79253#p79253"/>
		<title type="html"><![CDATA[Simple allmusic.com trigger]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=79253#p79253"><![CDATA[
I would like a trigger script to return a search string for allmusic.com. The allmusic search string works as follows:<br><br>Artist: <a href="http://www.allmusic.com/cg/amg.dll?p=amg&amp;sql=1:miles%7Cdavis" class="postlink">http://www.allmusic.com/cg/amg.dll?p=am ... iles|davis</a><br>Album: <a href="http://www.allmusic.com/cg/amg.dll?p=amg&amp;sql=2:kind%7Cof%7Cblue" class="postlink">http://www.allmusic.com/cg/amg.dll?p=am ... nd|of|blue</a><br>Song: <a href="http://www.allmusic.com/cg/amg.dll?p=amg&amp;sql=3:freddie%7Cfreeloader" class="postlink">http://www.allmusic.com/cg/amg.dll?p=am ... freeloader</a><br>Style: <a href="http://www.allmusic.com/cg/amg.dll?p=amg&amp;sql=4:jazz" class="postlink">http://www.allmusic.com/cg/amg.dll?p=amg&amp;sql=4:jazz</a><br>Label: <a href="http://www.allmusic.com/cg/amg.dll?p=amg&amp;sql=5:columbia" class="postlink">http://www.allmusic.com/cg/amg.dll?p=amg&amp;sql=5:columbia</a><br><br>As you can see, spaces need to be replaced by | and sql=# changes according to the search type. Ideally I'd like to have a trigger for each search type like this:<br><br>&lt;user&gt; !artist nine inch nails<br>&lt;bot&gt; Artist search: <a href="http://www.allmusic.com/cg/amg.dll?p=amg&amp;sql=1:nine%7Cinch%7Cnails" class="postlink">http://www.allmusic.com/cg/amg.dll?p=am ... inch|nails</a><br>&lt;user&gt; !song hurt<br>&lt;bot&gt; Song search: <a href="http://www.allmusic.com/cg/amg.dll?p=amg&amp;sql=3:hurt" class="postlink">http://www.allmusic.com/cg/amg.dll?p=amg&amp;sql=3:hurt</a><br><br>I've tried to learn how to do this myself and I'm sure it's very simple, but I just can't wrap my mind around it. Help would be greatly appreciated.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9537">liljim</a> — Tue Dec 11, 2007 7:18 pm</p><hr />
]]></content>
	</entry>
	</feed>
