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

	<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>2002-05-09T18:16:00-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2002-05-09T18:16:00-04:00</updated>

		<published>2002-05-09T18:16:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=6799#p6799</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=6799#p6799"/>
		<title type="html"><![CDATA[Learning tcl for 1 day now]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=6799#p6799"><![CDATA[
do i use ur script the way it is set out i dont mind about it going to be a long haul<br>thats expected with scripting can u help me with setting up random replys also if you have the time<br>i am now at 242 (english) drinks and i have not touched softdrinks, spirts or wins yet not to mention tea or coffe lol<br><br>&lt;font size=-1&gt;[ This Message was edited by: badfreman on 2002-05-09 21:14 ]&lt;/font&gt;<p>Statistics: Posted by Guest — Thu May 09, 2002 6:16 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[stdragon]]></name></author>
		<updated>2002-05-09T16:31:00-04:00</updated>

		<published>2002-05-09T16:31:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=6794#p6794</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=6794#p6794"/>
		<title type="html"><![CDATA[Learning tcl for 1 day now]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=6794#p6794"><![CDATA[
If you have 150 drinks, it's going to be long no matter what. What I showed you was how to elimidate some redundancy: Whether the drink is vodka, rum, jack daniels, or whatever, you can use the same code to have "and coke", "and lime", "and ...".<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8">stdragon</a> — Thu May 09, 2002 4:31 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2002-05-09T07:46:00-04:00</updated>

		<published>2002-05-09T07:46:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=6786#p6786</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=6786#p6786"/>
		<title type="html"><![CDATA[Learning tcl for 1 day now]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=6786#p6786"><![CDATA[
erm i dont know where to start, dont know what has happend to you script i cant imagine an improvment being that long no fault of yours can u clear this up for me please. I have scripted a large amout of drinks so fare say 150+ below is a small exsample but i feel i am over useing code just to respond to a pub or a matched word that is in the script i intend to get every drink there is on the planet into this script <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":smile:" title="Smile"> i intend to have in the  PRIVMSG responce random events with humour as i dont want the bot to keep doing the same thing like give's nick a pint of beer when he could also could respond with  give's $nick a refreshing pint of beer, get my meaning<br><br>#v<br>bind pub - !valkovenalainen valkovenalainen<br> proc valkovenalainen {nick host handle chan text} {<br>    puthelp "PRIVMSG $chan :01ACTION gives 4$nick 12a valkovenalainen cocktail"<br> }<br><br>#w <br>bind pub - !whisky whisky <br> proc whisky {nick host handle chan text} {<br>  if { $text == "sour" } {<br>   puthelp "PRIVMSG $chan :01ACTION gives 4$nick 12a whisky sour cocktail"<br> }<br>}<br><br><br>bind pub - !white white <br> proc white {nick host handle chan text} {<br>  if { $text == "lady" } {<br>   puthelp "PRIVMSG $chan :01ACTION gives 4$nick 12a white lady cocktail"<br>    } elseif { $text == "russian" } {<br>   puthelp "PRIVMSG $chan :01ACTION gives 4$nick 12a white russian cocktail"<br> }<br>}<br><br><br>#v<br>bind pub - !ville ville <br> proc ville {nick host handle chan text} {<br>  if { $text == "vallaton" } {<br>   puthelp "PRIVMSG $chan :01ACTION gives 4$nick 12a !ville vallaton cocktail"<br> }<br>}<br><br><br>bind pub - !violetta violetta<br> proc violetta {nick host handle chan text} {<br>    puthelp "PRIVMSG $chan :01ACTION gives 4$nick 12a violetta cocktail"<br> }<br>bind pub - !vodka vodka <br> proc vodka {nick host handle chan text} {<br>  if { $text == "gimlet" } {<br>   puthelp "PRIVMSG $chan :01ACTION gives 4$nick 12a vodka gimlet cocktail"<br>    } elseif { $text == "martini" } {<br>    puthelp "PRIVMSG $chan :01ACTION gives 4$nick 12a vodka martini cocktail"<br>    } elseif { $text == "polar" } {<br>    puthelp "PRIVMSG $chan :01ACTION gives 4$nick 12a vodka polar cocktail"<br>    } elseif { $text == "and lime" } {<br>    puthelp "PRIVMSG $chan :01ACTION gives 4$nick 12a glass of vodka and lime" <br>    } elseif { $text == "and orange" } {<br>    puthelp "PRIVMSG $chan :01ACTION gives 4$nick 12a glass of vodka and orange"<br>    } elseif { $text == "and coke" } {<br>    puthelp "PRIVMSG $chan :01ACTION gives 4$nick 12a glass of vodka and coke"<br>   } else {<br>  puthelp "PRIVMSG $chan :01ACTION gives 4$nick 12a glass of vodka"<br>}<br>}<br><br><br>&lt;font size=-1&gt;[ This Message was edited by: badfreman on 2002-05-09 06:02 ]&lt;/font&gt;<p>Statistics: Posted by Guest — Thu May 09, 2002 7:46 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[stdragon]]></name></author>
		<updated>2002-05-09T02:12:00-04:00</updated>

		<published>2002-05-09T02:12:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=6778#p6778</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=6778#p6778"/>
		<title type="html"><![CDATA[Learning tcl for 1 day now]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=6778#p6778"><![CDATA[
Erm, it seems to have corrupted my post. I hope you can make it out hehe<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8">stdragon</a> — Thu May 09, 2002 2:12 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[stdragon]]></name></author>
		<updated>2002-05-09T02:11:00-04:00</updated>

		<published>2002-05-09T02:11:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=6777#p6777</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=6777#p6777"/>
		<title type="html"><![CDATA[Learning tcl for 1 day now]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=6777#p6777"><![CDATA[
Here's one possible solution, I don't know if it'll be perfect. You can define all of the extras in a global list:<br><div class="codebox"><p>Code: </p><pre><code>set extras {  "coke"  "orange"  "lime"  ...}</code></pre></div>Then in your bind, you can use a 'foreach' loop to see if any of those things are mentioned in the text:<br><div class="codebox"><p>Code: </p><pre><code>proc vodka {nick host handle chan text} {  global extras  # Go through the whole list  foreach extra $extras {    # See if it's mentioned anywhere    if {[string match "*$extra*" $text]} {      puthelp "PRIVMSG $chan :[1code]proc vodka {nick host handle chan text} {  global extras  # Go through the whole list  foreach extra $extras {    # See if it's mentioned anywhere    if {[string match "*$extra*" $text]} {      puthelp "PRIVMSG $chan :01ACTION gives $nick a glass of vodka and $extra 01"      return 0    }  }  # If we made it this far, none of the extras were mentioned  puthelp "PRIVMSG $chan :01ACTION gives $nick a glass of vodka01"  return 0}[/code1]01ACTION gives $nick a glass of vodka and $extra [1code]proc vodka {nick host handle chan text} {  global extras  # Go through the whole list  foreach extra $extras {    # See if it's mentioned anywhere    if {[string match "*$extra*" $text]} {      puthelp "PRIVMSG $chan :01ACTION gives $nick a glass of vodka and $extra 01"      return 0    }  }  # If we made it this far, none of the extras were mentioned  puthelp "PRIVMSG $chan :01ACTION gives $nick a glass of vodka01"  return 0}[/code1]01"      return 0    }  }  # If we made it this far, none of the extras were mentioned  puthelp "PRIVMSG $chan :[1code]proc vodka {nick host handle chan text} {  global extras  # Go through the whole list  foreach extra $extras {    # See if it's mentioned anywhere    if {[string match "*$extra*" $text]} {      puthelp "PRIVMSG $chan :01ACTION gives $nick a glass of vodka and $extra 01"      return 0    }  }  # If we made it this far, none of the extras were mentioned  puthelp "PRIVMSG $chan :01ACTION gives $nick a glass of vodka01"  return 0}[/code1]01ACTION gives $nick a glass of vodka[1code]proc vodka {nick host handle chan text} {  global extras  # Go through the whole list  foreach extra $extras {    # See if it's mentioned anywhere    if {[string match "*$extra*" $text]} {      puthelp "PRIVMSG $chan :01ACTION gives $nick a glass of vodka and $extra 01"      return 0    }  }  # If we made it this far, none of the extras were mentioned  puthelp "PRIVMSG $chan :01ACTION gives $nick a glass of vodka01"  return 0}[/code1]01"  return 0}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8">stdragon</a> — Thu May 09, 2002 2:11 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2002-05-08T22:26:00-04:00</updated>

		<published>2002-05-08T22:26:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=6776#p6776</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=6776#p6776"/>
		<title type="html"><![CDATA[Learning tcl for 1 day now]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=6776#p6776"><![CDATA[
i may have incounterd a bigger problem <br>with my barman bot its going to have a very large drinking habbit<br>i think im going to be close to 300 binds may be more <br>would this be to much or is there an easyer way of doing this than below<br><br>bind pub - !vodka vodka<br>proc vodka {nick host handle chan text} {<br>  if {$text == "and lime"} {<br> puthelp "PRIVMSG $chan :01ACTION gives 4$nick 12a glass of vodka and lime" <br> } elseif {$text == "and orange"} {<br> puthelp "PRIVMSG $chan :01ACTION gives 4$nick 12a glass of vodka and ornage"<br> } elseif {$text == "and coke"} {<br>  puthelp "PRIVMSG $chan :01ACTION gives 4$nick 12a glass of vodka and coke"<br> } else {<br>  puthelp "PRIVMSG $chan :01ACTION gives 4$nick 12a glass of vodka"<br><p>Statistics: Posted by Guest — Wed May 08, 2002 10:26 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Petersen]]></name></author>
		<updated>2002-05-08T22:10:00-04:00</updated>

		<published>2002-05-08T22:10:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=6774#p6774</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=6774#p6774"/>
		<title type="html"><![CDATA[Learning tcl for 1 day now]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=6774#p6774"><![CDATA[
be very careful about using list commands (eg lrange) on strings as you just did in your examples. go read the tcl manual about the verbs 'split' and 'join'.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=60">Petersen</a> — Wed May 08, 2002 10:10 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2002-05-08T21:46:00-04:00</updated>

		<published>2002-05-08T21:46:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=6773#p6773</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=6773#p6773"/>
		<title type="html"><![CDATA[Learning tcl for 1 day now]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=6773#p6773"><![CDATA[
dont worry peeps i have found out how to<br>if {%text ==""} elseif {%text==""} etc<p>Statistics: Posted by Guest — Wed May 08, 2002 9:46 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2002-05-08T20:41:00-04:00</updated>

		<published>2002-05-08T20:41:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=6772#p6772</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=6772#p6772"/>
		<title type="html"><![CDATA[Learning tcl for 1 day now]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=6772#p6772"><![CDATA[
im creating a barman bot binds are ok no problem there, and im useing lrang where command has more than 1 word<br>if {[lrange $text 0 end] == "and orange"<br> <br>how would i make it work with what is below<br>!vodka<br>!vodka and orange <br>!vodka and coke      <br>!vodka and lime<br>!vodka and lemonade<br>!vodka and blackcurrant<br>where text can be either "and orang", "and coke", or "and lime" etc<p>Statistics: Posted by Guest — Wed May 08, 2002 8:41 pm</p><hr />
]]></content>
	</entry>
	</feed>
