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

	<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>2003-01-18T14:17:41-04:00</updated>

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

		<entry>
		<author><name><![CDATA[ppslim]]></name></author>
		<updated>2003-01-18T14:17:41-04:00</updated>

		<published>2003-01-18T14:17:41-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=15504#p15504</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=15504#p15504"/>
		<title type="html"><![CDATA[String/list matching]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=15504#p15504"><![CDATA[
You should use somthing like<br><div class="codebox"><p>Code: </p><pre><code>proc per_say {nick host uh args} {  if {[llength $args] == 2} {    if {[validchan [set t [lindex [split [lindex $args 1]] 0]]]} {      set chan $t      set text [join [lrange [split [lindex $args 1]] 1 end]]    } else {      set chan [lindex $args 0]      set text [lindex $args 1]    }  } else {    if {![validchan [set t [lindex [split [lindex $args 0]] 0]]} {      # This was a MSG bind. No channel was given, so don't attempt to send      return    }    set chan $t    set text [lrange [split [lindex $args 0]] 1 end]  }  puthelp "PRIVMSG $chan :$text"}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2">ppslim</a> — Sat Jan 18, 2003 2:17 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[scr0llwheel]]></name></author>
		<updated>2003-01-18T14:05:22-04:00</updated>

		<published>2003-01-18T14:05:22-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=15503#p15503</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=15503#p15503"/>
		<title type="html"><![CDATA[String/list matching]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=15503#p15503"><![CDATA[
That would work for pub commands but I want this to work for both public and msg commands. And with msg commands, the 'chan' argument isn't there!<br><br>That's the problem <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2465">scr0llwheel</a> — Sat Jan 18, 2003 2:05 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[stdragon]]></name></author>
		<updated>2003-01-18T13:31:53-04:00</updated>

		<published>2003-01-18T13:31:53-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=15501#p15501</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=15501#p15501"/>
		<title type="html"><![CDATA[String/list matching]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=15501#p15501"><![CDATA[
2 things: you forgot the 'chan' argument, and you shouldn't use 'args' in this scenario.<br><br>proc whatever {nick uhost hand chan text}<br><br>that's about how it should look.<br><br>Then what you want to do, is use split and lindex to get the first word of text. Then see if it starts with a #, like you already did. From there your script is basically right.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8">stdragon</a> — Sat Jan 18, 2003 1:31 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[scr0llwheel]]></name></author>
		<updated>2003-01-18T02:57:19-04:00</updated>

		<published>2003-01-18T02:57:19-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=15486#p15486</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=15486#p15486"/>
		<title type="html"><![CDATA[String/list matching]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=15486#p15486"><![CDATA[
First off, the code:<div class="codebox"><p>Code: </p><pre><code>proc per_say { nick host hand args } {  if { [string match "#*" $args] } {    puthelp "PRIVMSG [lindex $args 1] :[join [lrange $args 2 end]]"  } else {    puthelp "PRIVMSG [lindex $args 0] :[join [lrange $args 1 end]]"  }}</code></pre></div>Ok, I'm trying to make the bot say something when:<br>a) .say [#channel] &lt;text&gt; ..... this is a pub cmd and [#channel] is optional. If it isn't mentioned, then the proc is executed in the channel where the cmd was run.<br>OR<br>b) /msg bot say &lt;#channel&gt; &lt;text&gt; ..... this is a msg cmd and &lt;#channel&gt; is required.<br><br>Basically, it's not working, <strong class="text-strong">at all</strong>. I think I've got multiple problems wrong with it since when I add a "Text" to the output, it just shows "Text" when messaging a channel. (Yeah, I suck at explaining).<br><br>Anyway, any help/ideas/suggestions would be greatly appreciated.<br>Thanks,<br>scr0llwheel<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2465">scr0llwheel</a> — Sat Jan 18, 2003 2:57 am</p><hr />
]]></content>
	</entry>
	</feed>
