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

	<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>2005-07-02T09:50:32-04:00</updated>

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

		<entry>
		<author><name><![CDATA[LiquidZoo]]></name></author>
		<updated>2005-07-02T09:50:32-04:00</updated>

		<published>2005-07-02T09:50:32-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=51658#p51658</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=51658#p51658"/>
		<title type="html"><![CDATA[Voice script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=51658#p51658"><![CDATA[
Still giving me a strange error about the number of args, but it works now.  Thanks a lot.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5651">LiquidZoo</a> — Sat Jul 02, 2005 9:50 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2005-07-01T10:51:22-04:00</updated>

		<published>2005-07-01T10:51:22-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=51614#p51614</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=51614#p51614"/>
		<title type="html"><![CDATA[Voice script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=51614#p51614"><![CDATA[
It's<div class="codebox"><p>Code: </p><pre><code>if {$key1 == $key2} {</code></pre></div>without the brackets [].<br><br>And unlike C, in tcl we initialize a variable like this:<div class="codebox"><p>Code: </p><pre><code>set variable &lt;data&gt;</code></pre></div>so <div class="codebox"><p>Code: </p><pre><code>$::voiceVar = 1</code></pre></div>should be<div class="codebox"><p>Code: </p><pre><code>set ::voiceVar 1</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Fri Jul 01, 2005 10:51 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[LiquidZoo]]></name></author>
		<updated>2005-07-01T10:40:15-04:00</updated>

		<published>2005-07-01T10:40:15-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=51613#p51613</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=51613#p51613"/>
		<title type="html"><![CDATA[Voice script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=51613#p51613"><![CDATA[
I've almost fot it, but it keeps giving me this error:<br><br>[10:36] Tcl error [voiceon]: invalid command name "0"<br><br>Like I'm trying to pass the zero as a command...<br><br>Here's what I've got:<br><div class="codebox"><p>Code: </p><pre><code>set ufile scripts/ufile.txtset tchan "#musb-trivia"set voiceVar 0bind msg - voiceon voiceonbind msg - voiceoff voiceoffproc voiceon {nick uhost hand arg} {        $::voiceVar = 1        dovoice}bind pub - * dovoiceproc dovoice {nick host hand chan arg} {        global ufile tchan        if {[$::voiceVar == 1] &amp;&amp; [$chan == $tchan]} {                set fs [open $ufile a+]                puts $fs "$nick"                pushmode $tchan +v $nick                close $fs        }}proc voiceoff {args} {        global ufile tchan        set fs [open $ufile r]        while {![eof $fs]} {                  gets $fs line                  pushmode $tchan -v $line          }          close $fs          set fs [open $ufile w]          puts $fs ""          close $fs          $::voiceVar = 0}putlog "Voice! Loaded"</code></pre></div>I can't for the life of me figure out why it is reading it as a command and not as a value.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5651">LiquidZoo</a> — Fri Jul 01, 2005 10:40 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2005-07-01T05:40:09-04:00</updated>

		<published>2005-07-01T05:40:09-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=51601#p51601</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=51601#p51601"/>
		<title type="html"><![CDATA[Voice script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=51601#p51601"><![CDATA[
Yeah, that's it but you have some syntax errors.<div class="codebox"><p>Code: </p><pre><code>bind pub * voice:on proc voice:on {nick host hand chan arg} {  if {$::variable == 1} {   (add nick to file and voice nick in channel)  } }</code></pre></div>When using the pub bind, * means the character '*' and not a wildcard (to match with wildcards use pubm) and don't use args in a proc as it has a special meaning, instead use arg for example. Also $variable should be global since you're gonna use it in diferent procs, that's why I used $::variable but you can simply add 'global variable' at the beginning of each proc and normally use $variable.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Fri Jul 01, 2005 5:40 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[LiquidZoo]]></name></author>
		<updated>2005-06-30T17:55:44-04:00</updated>

		<published>2005-06-30T17:55:44-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=51590#p51590</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=51590#p51590"/>
		<title type="html"><![CDATA[Voice script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=51590#p51590"><![CDATA[
Ok, I think I see what you're saying.  Let me see if I got it right:<br><br>bind the msg to voiceon to start the script, then inside that set a variable to 1 that is default set to 0, and have another proc look for the trigger in the channel, but only if the variable is set to 1<br><br>So do I have the second bind check for the trigger? IE:<br><br>bind pub \* voice:on<br><br>proc voice:on { nick host hand chan args } {<br>if [$variable == 1] {<br>(add nick to file and voice nick in channel)<br>}<br>}<br><br>Something like that, right?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5651">LiquidZoo</a> — Thu Jun 30, 2005 5:55 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2005-06-30T16:31:45-04:00</updated>

		<published>2005-06-30T16:31:45-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=51584#p51584</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=51584#p51584"/>
		<title type="html"><![CDATA[Voice script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=51584#p51584"><![CDATA[
Well, I still don't understand what exactly you're asking for? If you mean you want the bot to voice those who say * in a channel only when you have voice set to on, then you can bind msg to voiceon for example, and set a variable to 1, then set it to 0 if voiceoff is sent. In the pub bind check if the variable is set to 1 then voice the nick.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Thu Jun 30, 2005 4:31 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[LiquidZoo]]></name></author>
		<updated>2005-06-30T14:18:45-04:00</updated>

		<published>2005-06-30T14:18:45-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=51572#p51572</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=51572#p51572"/>
		<title type="html"><![CDATA[Voice script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=51572#p51572"><![CDATA[
That would make it so that everyone who sends a /msg to the bot with the trigger would be voiced, right?  That's not exactly what I want.  I want to turn on the script with a message to the bot, but have the trigger be something that is said in the channel text, not as a /msg<br><br>Is this even possible to do?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5651">LiquidZoo</a> — Thu Jun 30, 2005 2:18 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2005-06-30T12:09:58-04:00</updated>

		<published>2005-06-30T12:09:58-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=51568#p51568</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=51568#p51568"/>
		<title type="html"><![CDATA[Voice script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=51568#p51568"><![CDATA[
If you want to voice every user that msgs the bot with * in your channel then use something like this:<div class="codebox"><p>Code: </p><pre><code>set thevoicechan "#channel"bind msg - * voice:userproc voice:user {nick uhost hand arg} { if {[onchan $nick $::thevoicechan] &amp;&amp; [botisop $::thevoicechan]} {  pushmode $::thevoicechan +v $nick }}</code></pre></div>and add whatever other stuff you wanted to (i.e. add the nick to a file...etc)<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Thu Jun 30, 2005 12:09 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[LiquidZoo]]></name></author>
		<updated>2005-06-30T10:20:08-04:00</updated>

		<published>2005-06-30T10:20:08-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=51563#p51563</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=51563#p51563"/>
		<title type="html"><![CDATA[Voice script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=51563#p51563"><![CDATA[
I only want to voice those that use the trigger in the channel, how do I go about doing that?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5651">LiquidZoo</a> — Thu Jun 30, 2005 10:20 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2005-06-30T03:54:22-04:00</updated>

		<published>2005-06-30T03:54:22-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=51545#p51545</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=51545#p51545"/>
		<title type="html"><![CDATA[Voice script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=51545#p51545"><![CDATA[
If you mean voice all nicks in the channel, the use:<div class="codebox"><p>Code: </p><pre><code>foreach trigger [chanlist $tchan] {</code></pre></div>and to put each nick into the file and voice it use the variable $trigger instead of $nick.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Thu Jun 30, 2005 3:54 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[LiquidZoo]]></name></author>
		<updated>2005-06-30T03:32:56-04:00</updated>

		<published>2005-06-30T03:32:56-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=51543#p51543</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=51543#p51543"/>
		<title type="html"><![CDATA[Voice script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=51543#p51543"><![CDATA[
Ok, I want to have a script that will activate on a /msg $botnick but look in a channel for the trigger phrase (well, character), when the users give that character (a single ' * ', I think I defined that right) it will voice that user and put their nick in a file to be used later, then on /msg $botnick voiceoff, it will read each of those users out of that file and devoice them.  I think I have the second part right, but I can't get the first part to work correctly.  Can anyone help me out?  Here is the script that I have so far:<br><div class="codebox"><p>Code: </p><pre><code> set ufile scripts/ufile.txtset trigger "\*"set tchan "#testchan"bind msg - voiceon voiceonbind msg - voiceoff voiceoffproc voiceon {nick host hand chan args} {global ufile trigger tchanset fs [open $ufile a+]foreach $trigger $tchan {puts $fs "$nick"pushmode $tchan +v $nick}close $fs}proc voiceoff {args} {global ufile trigger tchanset fs [open $ufile r]while {![eof $fs]} {   gets $fs line   pushmode $tchan -v $line  }  close $fs  set fs [open $ufile w]  puts $fs ""  close $fs}putlog "Voice! Loaded"</code></pre></div>Aside from the part that there aren't any comments there, can anyone help me get the voiceon proc to work the way I want it to?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5651">LiquidZoo</a> — Thu Jun 30, 2005 3:32 am</p><hr />
]]></content>
	</entry>
	</feed>
