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

	<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-11-04T14:01:36-04:00</updated>

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

		<entry>
		<author><name><![CDATA[ppslim]]></name></author>
		<updated>2002-11-04T14:01:36-04:00</updated>

		<published>2002-11-04T14:01:36-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=12821#p12821</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=12821#p12821"/>
		<title type="html"><![CDATA[Can Someone Tell me what wrong with this script?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=12821#p12821"><![CDATA[
In the first piece of code I posted in my reply (in turn, quoted from your script), you have not properly defined the procedure arguments.<br><br>The proper arguments are shown in tcl-commands.doc.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2">ppslim</a> — Mon Nov 04, 2002 2:01 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2002-11-04T13:52:44-04:00</updated>

		<published>2002-11-04T13:52:44-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=12820#p12820</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=12820#p12820"/>
		<title type="html"><![CDATA[Can Someone Tell me what wrong with this script?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=12820#p12820"><![CDATA[
I was just trying to make a bot react on the bound words and randomly choose one of the pre set choices, I have read the tcl-commands.txt and your post, yet the solution avoids me. Thanks for the help, just seems as thou I can't grasp whats wrong.<p>Statistics: Posted by Guest — Mon Nov 04, 2002 1:52 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ppslim]]></name></author>
		<updated>2002-11-04T05:43:14-04:00</updated>

		<published>2002-11-04T05:43:14-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=12781#p12781</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=12781#p12781"/>
		<title type="html"><![CDATA[Can Someone Tell me what wrong with this script?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=12781#p12781"><![CDATA[
The most noticible thing is<div class="codebox"><p>Code: </p><pre><code>proc pub_xplod {nick uhost hand chan $ranxplod} {</code></pre></div>I know many people new to Tcl have dificulties understanding why this line is like it is, but the goal behind this 1 must be out of eyesight.<br><br>Can you tell me what this was supposed to do?<br><br>The Tcl proc command has the following format<blockquote class="uncited"><div>proc &lt;name&gt; {[argument1] [arguemnt2] [arguementX]} {&lt;body&gt;}</div></blockquote>&lt;item&gt; = required<br>[item] = optional<br><br>When writting code, you break it down into re-usable functions (in Tcl, they are called procedures), so when a often used peice of code is needed, instead of typing it all out, you simply call that needed code.<br><br>When you do this, you will often need to change some fo the items within the code. EG, when you want to remove a certain letter from a string of letters, you need to know the letter that needs removing, and the string to remove it from. There would be no point in making a re-usable function for this, if you are using the same letter and string everytime.<br><br>So, to do this, you need some way of knowing the string, and character to remove. To do this, you pass them as arguments to the procedure.<br><br>EG, I made a procedure called removeletter. so I call it as<br><div class="codebox"><p>Code: </p><pre><code>removeletter "x" i hatxe you"</code></pre></div>When you do this, you need some way, to collect this data inside of a procedure. This is what the first line of the proc command is all about.<br><br>Thus <div class="codebox"><p>Code: </p><pre><code>proc testcode {nick uhost hand chan arg} {</code></pre></div>This allows for 5 arguements to be passed to this procedure. Each one of them, getting there own name. These names, can be whatever you want, so long as you know, what type of information is being passed to the procedure.<br><br>In your example, it is done incorrectly.<br><br>Using the information I have provided, and reading a copy of tcl-commands.doc, you should be able to find out what is wrong with the above code.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2">ppslim</a> — Mon Nov 04, 2002 5:43 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2002-11-03T20:17:42-04:00</updated>

		<published>2002-11-03T20:17:42-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=12772#p12772</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=12772#p12772"/>
		<title type="html"><![CDATA[Can Someone Tell me what wrong with this script?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=12772#p12772"><![CDATA[
<strong class="text-strong">Can Some One tell me what, if anything is wrong with this script, or maybe there is a better way to write it?</strong><br><br><br>### Bot Word Reaction ###<br><br>bind pub -|- Sony pub_xplod<br>bind pub -|- sony pub_xplod<br>bind pub -|- xplod pub_xplod<br>bind pub -|- Xplod pub_xplod<br><br># random responses to the word "sony" or "xplod"<br>set ranxplod {<br>  "I'd rather use Jensen"<br>  "Oh, Not the "S" word !!!"<br>  "Xplod, We go boom"<br>  "Red and white, but burnt all over"<br>  "Once you go Sony, you'll never come back"<br>}<br><br># random sony proc<br>proc pub_xplod {nick uhost hand chan $ranxplod} {<br>  global ranxplod<br>  if [rand 2] {<br>    putchan $chan "[lindex $ranxplod [rand [llength $ranxplod]]]"<br>    }<br>    return 1<br>}<p>Statistics: Posted by Guest — Sun Nov 03, 2002 8:17 pm</p><hr />
]]></content>
	</entry>
	</feed>
