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

	<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>2010-01-05T20:32:33-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Daedalus]]></name></author>
		<updated>2009-07-29T06:13:10-04:00</updated>

		<published>2009-07-29T06:13:10-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=89695#p89695</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=89695#p89695"/>
		<title type="html"><![CDATA[Complete Newbie - Needing Basic Script With Basic Triggers]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=89695#p89695"><![CDATA[
I have a question.<br><br>How would I make this work with actions? Currently, it does not.<br><br>Basically, I'm making a "character" bot, that replies to some simple, specific stimulus in channel that relates to some very random things she says at random intervals. So if she says<br><br>"How do I get these rhinoes into the jar?"<br><br>a user might say<br><br>"There are no rhinoes!"<br><br>to which she would say<br><br>"sadface:("<br><br>...so basically it's a REALLY simple way of doing "AI" with less chance of having really stupid responses that are out of context.<br><br>Now, the "character" likes having her tummy tickled. But people can't do that, because she doesn't understand<br><br>/me tickles the bot's tummy<br><br>...any ideas?<br><br>I could just write action procs, but this would defeat the object of this script.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9095">Daedalus</a> — Wed Jul 29, 2009 6:13 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Repdientu]]></name></author>
		<updated>2009-07-29T01:50:09-04:00</updated>

		<published>2009-07-29T01:50:09-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=89693#p89693</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=89693#p89693"/>
		<title type="html"><![CDATA[Complete Newbie - Needing Basic Script With Basic Triggers]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=89693#p89693"><![CDATA[
Hi Speechles<div class="codebox"><p>Code: </p><pre><code># Multi-Bind Messaging (the easy way to do this)# AKA, PutServ-O-Matic v1.0# by speechles (w/help from egghelp! yay!)# Construct your triggers|channel|message# here using the format below:# "TRIGGER|#CHANNEL|METHOD AND MESSAGE"# add as little, or as many as you want but you# MUST use the format described above!# You also have a few variables to use# %b - will be replaced with $::botnick (bots current nickname)# %n - will be replaced with $nick (person triggering)# %c - will be replaced with $chan (channel triggered in)# %u - will be replaced with $uhost (person triggering unique host)# %h - will be replaced with $hand (person triggering handle)# %i - will be replaced with user $input (entire thing)# %i1 - will be replaced with user $input (just the first word)# %i2 - will be replaced with user $input (second to last words)# below are merely some examples.variable mycommands {  "*slaps %b*|#test|privmsg %c :\001action blocks the slap and kicks %n in the face.\001"  "!notice*|#test|notice %n :notice message"  "!query*|#test|privmsg %n :query/private message"  "!kickme*|#test|kick %c %n :kick fulfilled.. hehe \037:P\037"  "!voiceme*|*|mode %c +v %n"  "!voiceme*|*|privmsg %c :\002%n\002, feel the \002Power\002 of voice!"  "!repeat*|*|privmsg %c :%n just said \002%i\002 :P"  "!voicenick*|*|mode %c +v %i1"  "!kickbannick*|*|mode %c +b %i1!*@*"  "!kickbannick*|*|kick %c %i1 :%i2 (Requested by %n)"  "!kicknick*|*|kick %c %i1 :%i2 (Requested by %n)"}# Script begins - change nothing below herebind pubm -|- "*" mycommands_procproc mycommands_proc {nick uhand hand chan input} {   foreach item $::mycommands {      set trig [lindex [split $item \|] 0]      regsub -all -nocase {%b} $trig $::botnick trig      if {[string match -nocase $trig $input]} {         if {[string match -nocase [lindex [split $item \|] 1] $chan]} {            set message [join [lrange [split $item \|] 2 end]]            regsub -all -nocase {%b} $message $::botnick message            regsub -all -nocase {%n} $message $nick message            regsub -all -nocase {%c} $message $chan message            regsub -all -nocase {%u} $message $uhand message            regsub -all -nocase {%h} $message $hand message            regsub -all -nocase {%i1} $message [lindex [split $input] 1] message            regsub -all -nocase {%i2} $message [join [lrange [split $input] 2 end]]] message            regsub -all -nocase {%i} $message [join [lrange [split $input] 1 end]]] message            putserv "$message"         }      }   }}putlog "Multi-bind messaging with action missles script loaded."</code></pre></div> <br>can i used file /data/command.txt for variable mycommands ?<br>and can add some command via: !addcmd !mode*|#myroom|mode %c  %i1   to command.txt ?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10625">Repdientu</a> — Wed Jul 29, 2009 1:50 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2008-08-03T10:03:00-04:00</updated>

		<published>2008-08-03T10:03:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=84379#p84379</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=84379#p84379"/>
		<title type="html"><![CDATA[Complete Newbie - Needing Basic Script With Basic Triggers]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=84379#p84379"><![CDATA[
Nice to hear of your progress. If you get stuck on anything, don't hesitate to ask, and we'll gladly do our best to help.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Sun Aug 03, 2008 10:03 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Lanh]]></name></author>
		<updated>2008-08-02T23:17:06-04:00</updated>

		<published>2008-08-02T23:17:06-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=84376#p84376</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=84376#p84376"/>
		<title type="html"><![CDATA[Complete Newbie - Needing Basic Script With Basic Triggers]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=84376#p84376"><![CDATA[
I just want to say thank you to everybody who has contributed to this thread, your help and encouragement has been hugely appreciated and has been invaluable.<br><br>I have been able to not only get the triggers that I would like but also to use a number of other scripts, modify them for our use in our channel which will make things a lot easier in the long run.<br><br>Thank you everybody.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10030">Lanh</a> — Sat Aug 02, 2008 11:17 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2008-07-25T08:05:41-04:00</updated>

		<published>2008-07-25T08:05:41-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=84164#p84164</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=84164#p84164"/>
		<title type="html"><![CDATA[Complete Newbie - Needing Basic Script With Basic Triggers]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=84164#p84164"><![CDATA[
Removing the split of <em class="text-italics">mycommands</em>, as suggested, does improve the behavior of the script. However, given the nature of this forum and the vast range of knowledge (from "what's tcl" to "expert programmer"), it would be advisable to post code that is "theoretically correct"; that is, make no assumptions that whoever is going to use the script has any knowledge 'bout advanced list structures or other. Using the <strong class="text-strong">list</strong> command provides a valid list, no matter of the input (each argument becomes a separate list item), whereas crafting list structures by hand requires a lot of experience.<br><br>Many new coders will search these threads and use code-snippets as learning examples, and in my opinion, it is far better to use proper coding rather than advanced "hacks". I am not questioning your ability to create proper list structures by hand, I'm just saying that you can't expect anyone reading this example to be able to accomplish the same.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Fri Jul 25, 2008 8:05 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[speechles]]></name></author>
		<updated>2010-01-05T20:32:33-04:00</updated>

		<published>2008-07-25T00:05:41-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=84159#p84159</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=84159#p84159"/>
		<title type="html"><![CDATA[Complete Newbie - Needing Basic Script With Basic Triggers]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=84159#p84159"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code># Multi-Bind Messaging (the easy way to do this)# AKA, PutServ-O-Matic v1.0# by speechles (w/help from egghelp! yay!)# Construct your triggers|channel|message# here using the format below:# "TRIGGER|#CHANNEL|METHOD AND MESSAGE"# add as little, or as many as you want but you# MUST use the format described above!# You also have a few variables to use# %b - will be replaced with $::botnick (bots current nickname)# %n - will be replaced with $nick (person triggering)# %c - will be replaced with $chan (channel triggered in)# %u - will be replaced with $uhost (person triggering unique host)# %h - will be replaced with $hand (person triggering handle)# %t - will be replaced with users trigger (very first word)# %i - will be replaced with user $input (entire thing)# %i1 - will be replaced with user $input (just the first word)# %i2 - will be replaced with user $input (second to last words)# below are merely some examples.variable mycommands {  "*slaps %b*|#test|privmsg %c :\001action blocks the slap and kicks %n in the face.\001"  "!notice*|#test|notice %n :notice message"  "!query*|#test|privmsg %n :query/private message"  "!kickme*|#test|kick %c %n :kick fulfilled.. hehe \037:P\037"  "!voiceme*|*|mode %c +v %n"  "!voiceme*|*|privmsg %c :\002%n\002, feel the \002Power\002 of voice!"  "!repeat*|*|privmsg %c :%n just said \002%i\002 :P"  "!voicenick*|*|mode %c +v %i1"  "!kickbannick*|*|mode %c +b %i1!*@*"  "!kickbannick*|*|kick %c %i1 :%i2 (Requested by %n)"  "!kicknick*|*|kick %c %i1 :%i2 (Requested by %n)"}# Script begins - change nothing below herebind pubm -|- "*" mycommands_procproc mycommands_proc {nick uhand hand chan input} {   foreach item $::mycommands {      set trig [lindex [split $item \|] 0]      regsub -all -nocase {%b} $trig $::botnick trig      regsub -all -nocase {%n} $trig $nick trig      regsub -all -nocase {%c} $trig $chan trig      regsub -all -nocase {%u} $trig $uhand trig      regsub -all -nocase {%h} $trig $hand trig      regsub -all -nocase {%t} $trig [lindex [split $input] 0] trig      regsub -all -nocase {%i1} $trig [lindex [split $input] 1] trig      regsub -all -nocase {%i2} $trig [join [lrange [split $input] 2 end]]] trig      regsub -all -nocase {%i} $trig [join [lrange [split $input] 1 end]]] trig      if {[string match -nocase $trig $input]} {         if {[string match -nocase [lindex [split $item \|] 1] $chan]} {            set message [join [lrange [split $item \|] 2 end]]            regsub -all -nocase {%b} $message $::botnick message            regsub -all -nocase {%n} $message $nick message            regsub -all -nocase {%c} $message $chan message            regsub -all -nocase {%u} $message $uhand message            regsub -all -nocase {%h} $message $hand message            regsub -all -nocase {%t} $message [lindex [split $input] 0] message            regsub -all -nocase {%i1} $message [lindex [split $input] 1] message            regsub -all -nocase {%i2} $message [join [lrange [split $input] 2 end]]] message            regsub -all -nocase {%i} $message [join [lrange [split $input] 1 end]]] message            putserv "$message"         }      }   }}putlog "Multi-bind messaging with action missles script loaded."</code></pre></div><blockquote class="uncited"><div>&lt;speechles&gt; !voiceme<br>* bot sets mode: +v speechles<br>&lt;bot&gt; <strong class="text-strong">speechles</strong>, feel the <strong class="text-strong">Power</strong> of voice!<br>&lt;speechles&gt; !kickme<br>you were kicked by bot (kick fulfilled.. hehe <span style="text-decoration:underline">:<strong class="text-strong"></strong>P</span>)<br>&lt;funny&gt; haha.. your own bot kicks you :<strong class="text-strong"></strong>P<br>&lt;speechles&gt; !kick funny haha.. not so funny now is it?<br>funny was kicked by bot (haha.. not so funny now is it? (Requested by speechles))</div></blockquote>**EDIT: The code above requires knowledge of tcl special characters and proper list arrangements.<div class="codebox"><p>Code: </p><pre><code>variable mycommands [list "!notice|#test|notice %n :notice message" \  "!query|#test|privmsg %c :query/private message" \  "!kickme|#test|kick %c %n :kick fulfilled.. hehe \037:P\037" \  "!voiceme|*|mode %c +v %n" \  "!voiceme|*|privmsg %c :\002%n\002, feel the \002Power\002 of voice!" \  "!repeat|*|privmsg %c :you just said \002%i\002" \  "!voicenick|*|mode %c +v %i1" \  "!kickbannick|*|mode %c +b %i1*!*@*" \  "!kickbannick|*|kick %c %i1 :%i2 (Requested by %n)" \  "!kicknick|*|kick %c %i1 :%i2 (Requested by %n)" ] </code></pre></div>This is the correct way to encapsulate the list, without crafting it by hand. Those having issues of any sort should use the correct way (the list method above). Those more experienced can of course, craft the list by hand just fine (it's original state).<br><br><strong class="text-strong">Mycommands Configuration:</strong> (for those new to tcl this should explain it)<br>  "*slaps %b*|#test|privmsg %c :\001action blocks the slap and kicks %n in the face.\001"<br>If anyone slaps the bot, it will block the slap and kick them in the face.<br><br>  "!notice|#test|notice %n :notice message"<br>obvious, it will notice the nickname 'notice message'<br><br>  "!query|#test|privmsg %n :query/private message"<br>another obvious one, will query the nickname 'query/private message'<br><br>  "!kickme|#test|kick %c %n :kick fulfilled.. hehe \037:P\037"<br>kinda obvious. kicks the person requesting a kick.<br><br>  "!voiceme|*|mode %c +v %n"<br>voices you if you ever cared to be voiced.<br><br>  "!voiceme|*|privmsg %c :\002%n\002, feel the \002Power\002 of voice!"<br>this is to show a 2nd handler for a trigger, this will be carried out after the one above it. Basically telling you voice has power or smish..<br><br>  "!repeat|*|privmsg %c :%n just said \002%i\002 <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_razz.gif" width="15" height="15" alt=":P" title="Razz">"<br>basically mirrors whatever you type, to show the variable %i is entire input.<br><br>  "!voicenick|*|mode %c +v %i1"<br>this is to show the power of %i1 the first word of input. Voices a nickname u put.<br><br>  "!kickbannick|*|mode %c +b %i1!*@*"<br>This is to show the power of %n and %i1/%i2 combined. First the mode to ban them is set, using their nickname.<br><br>  "!kickbannick|*|kick %c %i1 :%i2 (Requested by %n)"<br>Now we kick them down here with our message. And for courtesy, the bot is merely the messenger so attched the requested by nickname message.<br><br>  "!kicknick|*|kick %c %i1 :%i2 (Requested by %n)"<br>This was to mirror the kick command above but because it's tied to ban, we need a new name so just the kick part will occur.<br><br>Hope this explains most of how to 'script' the mycommands section. Basically, _anything_ you can have putserv'd can be your message, all of the variables can be used on either<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8138">speechles</a> — Fri Jul 25, 2008 12:05 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Lanh]]></name></author>
		<updated>2008-07-24T22:51:30-04:00</updated>

		<published>2008-07-24T22:51:30-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=84158#p84158</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=84158#p84158"/>
		<title type="html"><![CDATA[Complete Newbie - Needing Basic Script With Basic Triggers]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=84158#p84158"><![CDATA[
Hi,<br><br>Am I right in thinking that the section I have bolded was the change?<blockquote class="uncited"><div>proc mycommands_proc {nick uhand hand chan input} {<br>foreach item $::mycommands {<br>if {[string match -nocase [lindex [split $item \|] 0] [lindex [split $input] 0]]<strong class="text-strong">}</strong> {</div></blockquote>Just trying to understand the scripting.<br><br>The script loads but it is unresponsive in the channel, I am going to try a few things and I'll come back and let you know if I can get it working, hopefully I can make it work correctly without requesting further assistance.<br><br>The other discussion in here, is way beyond my comprehension at the moment, but I will revisit that when I become more familiar with this whole thing.<br><br>I really appreciate the time everyone is taking to monitor and participate in this thread, things are slowly making more sense to me.<br><br>Thank you.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10030">Lanh</a> — Thu Jul 24, 2008 10:51 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[speechles]]></name></author>
		<updated>2008-07-24T21:40:58-04:00</updated>

		<published>2008-07-24T21:40:58-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=84157#p84157</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=84157#p84157"/>
		<title type="html"><![CDATA[Complete Newbie - Needing Basic Script With Basic Triggers]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=84157#p84157"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>foreach item $::mycommands {  puts stdout [split $item \|]}</code></pre></div>In doing it this way, it is assumed we have a list. If we have a list, this works great. If we don't have a list, this can also work great (you just need to do it wisely). Now if we add [split] to either of these, it will actually cause the behavior we are seeing. Adding list doesn't correct it either, because when you added the <ul> <li>you also have removed the [split]. This should be done in either case with or without <ul><li>. ;D<br><br>So simply changing<div class="codebox"><p>Code: </p><pre><code>   foreach item [split $::mycommands] { </code></pre></div> and removing the [split] present would function the same way as actually, erm, having a list. Since the same rules apply regarding escaped special characters and list field element restrictions, even without the use of <ul><li>. Because there is implied use during the foreach, and without the [split] the code will behave the same with or without the use of <ul><li>. Try it yourself. Now using list, and avoiding split like the plague might be perferable, but then it might confuse things with the newlines injected, etc. That is why I chose to keep it a string, up until the point the foreach attempts to make use of it.<div class="codebox"><p>Code: </p><pre><code>variable mycommands {  "!trigger1|#channel|privmsg %c :message"  "!trigger2|#channel|privmsg %c :message"  "!trigger3|#channel|privmsg %c :message"  "!trigger4|#channel|anything etc can go here you can send to a server, a mode, a kick, etc"}# Script begins - change nothing below herebind pub -|- "!test" mycommands_procproc mycommands_proc {nick uhand hand chan input} {   set lne 0   foreach item $::mycommands {      incr lne      set ldx -1      while {$ldx &lt; 2} {         incr ldx 1         set message "privmsg $chan :index 0=[lindex [split $item \|] 0] index 1=[lindex [split $item \|] 1] range 2-end=[join [lrange [split $item \|] 2 end]]"         regsub -all -nocase {%n} $message $nick message         regsub -all -nocase {%c} $message $chan message         putserv $message      }   }}</code></pre></div><blockquote class="uncited"><div>&lt;bot&gt; index 0=!trigger1 index 1=#channel lrange 2-end=privmsg #test :message<br>&lt;bot&gt; index 0=!trigger2 index 1=#channel range 2-end=privmsg #test :message<br>&lt;bot&gt; index 0=!trigger3 index 1=#channel range 2-end=privmsg #test :message<br>&lt;bot&gt; index 0=!trigger4 index 1=#channel range 2-end=anything etc can go here you can send to a server, a mode, a kick, etc</div></blockquote></li></ul></li></ul></li></ul></li></ul><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8138">speechles</a> — Thu Jul 24, 2008 9:40 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2008-07-24T16:48:59-04:00</updated>

		<published>2008-07-24T16:48:59-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=84151#p84151</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=84151#p84151"/>
		<title type="html"><![CDATA[Complete Newbie - Needing Basic Script With Basic Triggers]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=84151#p84151"><![CDATA[
<blockquote class="uncited"><div><blockquote class="uncited"><div>I'm afraid that code will not quite work as intended, as the quotes will end up within the list items, rather than encapsulating them...<br><br>I would recommend storing the triggers in a proper list structure within <em class="text-italics">::mycommands</em> from the beginning...<div class="codebox"><p>Code: </p><pre><code>variable mycommands [list \  "!trigger1|#room|notice %n :message" \  "!trigger2|#room|privmsg %c :message" \]...   foreach item $::mycommands {...</code></pre></div></div></blockquote>It does work as intended (albeit with the full understanding special tcl characters will of course need escaping or else will toss tcl errors), because the unofficial google scripts uses something exactly similar to do vocabulary aversion (swear word replacement). But it is better, agreed, to keep it as a list to begin with (this way there is nothing to understand, the list arrangement guarantees escaping and no tcl errors).<br>...</div></blockquote>I beg to differ, as I even verified the flaw in a native tcl shell..<div class="codebox"><p>Code: </p><pre><code>variable mycommands {  "!trigger1|#room|notice %n :message"  "!trigger2|#room|privmsg %c :message"}foreach item [split $::mycommands] {  puts stdout [split $item \|]}#Output starts here:{"!trigger1} #room notice%n:message"{"!trigger2} #room privmsg%c:message"</code></pre></div>As you can see, there are several empty lines, representing empty list items, and the trigger has a leading ", while the message has a trailing one.<br><br>If you do not specify a specific separator, <strong class="text-strong">split</strong> will use any and all whitespace characters, including newlines, spaces, and tabs. Also, it will not care for "long lines" grouping. Using newline as separator will neither solve the issue, as "" would still not be removed (of course, if <em class="text-italics">mycommands</em> is altered to not include those quotes, things would look better).<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Thu Jul 24, 2008 4:48 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[speechles]]></name></author>
		<updated>2008-07-24T16:13:11-04:00</updated>

		<published>2008-07-24T16:13:11-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=84149#p84149</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=84149#p84149"/>
		<title type="html"><![CDATA[Complete Newbie - Needing Basic Script With Basic Triggers]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=84149#p84149"><![CDATA[
<blockquote class="uncited"><div>I'm afraid that code will not quite work as intended, as the quotes will end up within the list items, rather than encapsulating them...<br><br>I would recommend storing the triggers in a proper list structure within <em class="text-italics">::mycommands</em> from the beginning...<div class="codebox"><p>Code: </p><pre><code>...variable mycommands [list \  "!trigger1|#room|notice %n :message" \  "!trigger2|#room|privmsg %c :message" \]...   foreach item $::mycommands {...</code></pre></div></div></blockquote>It does work as intended (albeit with the full understanding special tcl characters will of course need escaping or else will toss tcl errors), because the unofficial google scripts uses something exactly similar to do vocabulary aversion (swear word replacement). But it is better, agreed, to keep it as a list to begin with (this way there is nothing to understand, the list arrangement guarantees escaping and no tcl errors).<br><blockquote class="uncited"><div>Also... there's no command called <strong class="text-strong">resub</strong>. Maybe <strong class="text-strong">regsub</strong>?</div></blockquote>It could be a command I forgot a procedure.<div class="codebox"><p>Code: </p><pre><code>proc resub {args} {  set condtion [eval regsub $args]  return condition}</code></pre></div>lmao.. that is probably sadly incorrect, but yeah. I forgot the g there, re<strong class="text-strong">g</strong>sub, was sposta substitute text.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8138">speechles</a> — Thu Jul 24, 2008 4:13 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2008-07-24T10:49:20-04:00</updated>

		<published>2008-07-24T10:49:20-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=84141#p84141</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=84141#p84141"/>
		<title type="html"><![CDATA[Complete Newbie - Needing Basic Script With Basic Triggers]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=84141#p84141"><![CDATA[
I'm afraid that code will not quite work as intended, as the quotes will end up within the list items, rather than encapsulating them...<br><br>I would recommend storing the triggers in a proper list structure within <em class="text-italics">::mycommands</em> from the beginning...<br><div class="codebox"><p>Code: </p><pre><code>...variable mycommands [list \  "!trigger1|#room|notice %n :message" \  "!trigger2|#room|privmsg %c :message" \]...   foreach item $::mycommands {...</code></pre></div>Also... there's no command called <strong class="text-strong">resub</strong>. Maybe <strong class="text-strong">regsub</strong>?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Thu Jul 24, 2008 10:49 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[speechles]]></name></author>
		<updated>2008-07-24T10:28:15-04:00</updated>

		<published>2008-07-24T10:28:15-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=84140#p84140</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=84140#p84140"/>
		<title type="html"><![CDATA[Complete Newbie - Needing Basic Script With Basic Triggers]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=84140#p84140"><![CDATA[
<blockquote class="uncited"><div>For some reason, speechles forgot to close the open-brace right before opening a new one.</div></blockquote>Most of that I wrote directly into the reply box and it's sorta, well not sorta, it's very very tiny and word wraps everything..lol <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_rolleyes.gif" width="15" height="15" alt=":roll:" title="Rolling Eyes"> It's almost like notepad but in an extremely crippled way. Next time I'll just whip out notepad and do it. I've had this happen before trying to write code directly into the snippet box.. lmao. It's too easy to overlook something because of the tiny box and word wrap.  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_lol.gif" width="15" height="15" alt=":lol:" title="Laughing"> <br><br>Btw, I fixed the code above at least the problematic line. ;D<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8138">speechles</a> — Thu Jul 24, 2008 10:28 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2008-07-24T10:06:38-04:00</updated>

		<published>2008-07-24T10:06:38-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=84137#p84137</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=84137#p84137"/>
		<title type="html"><![CDATA[Complete Newbie - Needing Basic Script With Basic Triggers]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=84137#p84137"><![CDATA[
For some reason, speechles forgot to close the open-brace right before opening a new one.<div class="codebox"><p>Code: </p><pre><code>if {[string match -nocase [lindex [split $item \|] 0] [lindex [split $input] 0]] { if {[string match -nocase [lindex [split $item \|] 1] $chan] {</code></pre></div>Add a close-brace (}) before the open-brace ({) at the end of each line in the code snippet above.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Thu Jul 24, 2008 10:06 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Lanh]]></name></author>
		<updated>2008-07-24T01:00:07-04:00</updated>

		<published>2008-07-24T01:00:07-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=84131#p84131</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=84131#p84131"/>
		<title type="html"><![CDATA[Complete Newbie - Needing Basic Script With Basic Triggers]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=84131#p84131"><![CDATA[
Thanks guys, I appreciate the encouragement, I have had limited success.<br><br>I have spent a lot of time trying to learn by altering existing scripts, which is the same way that I learned html, and it's slow going, I am cross referencing everything in the manuals and using google, I got a few books from the library regarding IRC that I am also making my way through, so I haven't given up, lol, I will learn this stuff if it kills me.<br><br><strong class="text-strong">Speechles</strong>, thank you for the example, it's appreciated, it throws up the following error, it's very similar to what I have seen before in my testing, I have not yet been able to fix it. The error is below...<div class="codebox"><p>Code: </p><pre><code>[00:48] missing close-brace    while executing"proc mycommands_proc {nick uhand hand chan input} {   foreach item [split $::mycommands] {      if {[string match -nocase [lindex [split $item \|]..."    (file "scripts/triggers.tcl" line 20)</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10030">Lanh</a> — Thu Jul 24, 2008 1:00 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[speechles]]></name></author>
		<updated>2008-07-24T21:45:32-04:00</updated>

		<published>2008-07-16T08:56:07-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=84007#p84007</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=84007#p84007"/>
		<title type="html"><![CDATA[Complete Newbie - Needing Basic Script With Basic Triggers]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=84007#p84007"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code># Multi-Bind Messaging (the easy way to do this)# Construct your triggers|channel|message# here using the format below:# "TRIGGER|#CHANNEL|METHOD AND MESSAGE"# add as little, or as many as you want but you# MUST use the format described above!# You also have two variables to use# %n - will be replaced with $nick# %c - will be replaced with $chanvariable mycommands {  "!trigger1|#room|notice %n :message"  "!trigger2|#room|privmsg %c :message"}# Script begins - change nothing below herebind pubm -|- "*" mycommands_procproc mycommands_proc {nick uhand hand chan input} {foreach item $::mycommands {if {[string match -nocase [lindex [split $item \|] 0] [lindex [split $input] 0]]} {if {[string match -nocase [lindex [split $item \|] 1] $chan]} {set message [join [lrange [split $item \|] 2 end]]resub -all -nocase {%n} $message $nick messageresub -all -nocase {%c} $message $chan messageputserv "$message"}}}}putlog "Multi-bind messaging script loaded."</code></pre></div>This should accomplish what you desire with minimum hassle. It will allow you to use the lists you already have basically. You will need to add a space and colon into your messages like so: "notice %n :message" or "notice %c :message". This does it without having hundreds of procedures. You are allowed to use wildcards in mycommands. So an entry of "!help|*|notice %n :There is no help for %c. %n, you are silly." is totally valid. It will allow use in ANY channel, because of the * (wildcard) in the channel field. This is how you should script things of this nature rather than building tons of stand-alone procedures. You can also have multiple messages as well, just repeat the same !trigger|#channel with the next message you want displayed.<br><br>Edit: try #2, game on.<br>Edit: try #3, game is better. game has finesse.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8138">speechles</a> — Wed Jul 16, 2008 8:56 am</p><hr />
]]></content>
	</entry>
	</feed>
