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

	<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-11-10T17:47:56-04:00</updated>

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

		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2003-11-10T17:47:56-04:00</updated>

		<published>2003-11-10T17:47:56-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=29833#p29833</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=29833#p29833"/>
		<title type="html"><![CDATA[Recruitment Questions script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=29833#p29833"><![CDATA[
<blockquote class="uncited"><div>i want to be able to email the answers to the email address, not just a confirmation, how would i go about doing this?</div></blockquote>Passing the input directly to exec is dangerous. To avoid having to figure out what chars to escape and how, you could write the body of the mail to a file and 'exec cat the_file | sendmail <a href="mailto:bla@bla.bla">bla@bla.bla</a>'<div class="codebox"><p>Code: </p><pre><code>...# completedputserv "PRIVMSG $nick :We're done. Now go away!" putlog "$nick has answered the recruitment questions:"set f [open tmp.file w]puts $f "$nick has answered the recruitment questions at [date] [time]\n"foreach q $surveyQ a $surveyA($uhost) { putlog "Q: $q"putlog "A: $a"puts $f "Q: $q"puts $f "A: $a"}close $fexec cat tmp.file | sendmail mail@emailhere.co.ukfile delete tmp.file...</code></pre></div>...OR you could 'open |sendmail <a href="mailto:bla@bla.bla">bla@bla.bla</a>' and puts directly to the mailer process, but that might not work with the sendmail binary...I don't have one to try it with atm.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2878">user</a> — Mon Nov 10, 2003 5:47 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[]Kami[]]></name></author>
		<updated>2003-11-10T12:14:56-04:00</updated>

		<published>2003-11-10T12:14:56-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=29813#p29813</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=29813#p29813"/>
		<title type="html"><![CDATA[Recruitment Questions script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=29813#p29813"><![CDATA[
Hehe, i made similar scripts for clan <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"> one for memebr one for wars etc..and one which contains all <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=3559">]Kami[</a> — Mon Nov 10, 2003 12:14 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Rusher2K]]></name></author>
		<updated>2003-11-10T11:59:01-04:00</updated>

		<published>2003-11-10T11:59:01-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=29811#p29811</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=29811#p29811"/>
		<title type="html"><![CDATA[Recruitment Questions script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=29811#p29811"><![CDATA[
When you want to send e-mails have al look @ <br><br><a href="http://www.egghelp.org/cgi-bin/tcl_archive.tcl?mode=download&amp;id=108" class="postlink">http://www.egghelp.org/cgi-bin/tcl_arch ... oad&amp;id=108</a><br><br>Allows you to send e-mails through the bot.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3034">Rusher2K</a> — Mon Nov 10, 2003 11:59 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[almighty]]></name></author>
		<updated>2003-11-10T10:56:15-04:00</updated>

		<published>2003-11-10T10:56:15-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=29806#p29806</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=29806#p29806"/>
		<title type="html"><![CDATA[Recruitment Questions script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=29806#p29806"><![CDATA[
Ok, using that other thread, i have come up with this:<div class="codebox"><p>Code: </p><pre><code>....proc recruit:msgm {nick uhost hand args} {    global surveyQ surveyA    if {[info exists surveyA($uhost)]} {       lappend surveyA($uhost) $args       if {[llength $surveyA($uhost)]&lt;[llength $surveyQ]} {          # there are more questions to be asked...          putserv "PRIVMSG $nick :[lindex $surveyQ [llength $surveyA($uhost)]]"       } {          # completed          putserv "PRIVMSG $nick :We're done. Now go away!" exec echo "$nick has answered the recruitment questions at [date] [time] foreach q $surveyQ a $surveyA($uhost) { \"Q: $q\" \"A: $a\" } " | sendmail mail@emailhere.co.uk         putlog "$nick has answered the recruitment questions:"          foreach q $surveyQ a $surveyA($uhost) {             putlog "Q: $q"             putlog "A: $a"          } ....</code></pre></div>I have missed out the other parts as those are working fine.<br>I get this error<div class="codebox"><p>Code: </p><pre><code>Tcl error [recruit:msgm]: can't read "q": no such variable</code></pre></div>I know what this means, but i want to be able to email the answers to the email address, not just a confirmation, how would i go about doing this?[/code]<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2492">almighty</a> — Mon Nov 10, 2003 10:56 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[almighty]]></name></author>
		<updated>2003-11-10T08:30:04-04:00</updated>

		<published>2003-11-10T08:30:04-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=29800#p29800</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=29800#p29800"/>
		<title type="html"><![CDATA[Recruitment Questions script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=29800#p29800"><![CDATA[
yea i changed it to privmsg i just pasted in the older code,<br>thanks for the info and link.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2492">almighty</a> — Mon Nov 10, 2003 8:30 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2003-11-10T07:54:57-04:00</updated>

		<published>2003-11-10T07:54:57-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=29799#p29799</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=29799#p29799"/>
		<title type="html"><![CDATA[Recruitment Questions script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=29799#p29799"><![CDATA[
check this post: <a href="http://forum.egghelp.org/viewtopic.php?t=5085#24041" class="postlink">http://forum.egghelp.org/viewtopic.php?t=5085#24041</a><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2878">user</a> — Mon Nov 10, 2003 7:54 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[stdragon]]></name></author>
		<updated>2003-11-10T00:01:12-04:00</updated>

		<published>2003-11-10T00:01:12-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=29788#p29788</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=29788#p29788"/>
		<title type="html"><![CDATA[Recruitment Questions script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=29788#p29788"><![CDATA[
For starters, shouldn't you send them privmsg's instead of notices? That way they can type in the query window.<br><br>You need a msgm bind to listen for the answers (I assume you want them to message the bot privately, otherwise use pubm.) Bind on * so you get every line. Now, you probably need a global variable to keep track of "state information" such as what questions have been asked, etc. So, when they type recruit, you set the state variable for that person to be "question 1" or whatever. You send them question 1. In the handler for msgm, whenever you get a message, you check to see if that person's state variable is set. If it is, you record the line to some file (maybe $nick.answers) and ask the next one. To be a little nicer, you could have them type whatever they want and type "next" to signify an end to their answer, unless all your questions are one-liners.<br><br>For instance, say the global is called state. It's an array. $state($nick) will say what question the person is answering. If $state($nick) isn't set, the person hasn't typed !recruit yet.<br><br>That should give you some idea. For tcl commands, check out <a href="http://www.tcl.tk/man" class="postlink">www.tcl.tk/man</a><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8">stdragon</a> — Mon Nov 10, 2003 12:01 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[almighty]]></name></author>
		<updated>2003-11-09T15:29:08-04:00</updated>

		<published>2003-11-09T15:29:08-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=29774#p29774</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=29774#p29774"/>
		<title type="html"><![CDATA[Recruitment Questions script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=29774#p29774"><![CDATA[
People enter the channel and if they type the command !recruit the bot notices the person with a question or a few questions.<br>The the person can answer the question and when they have done so the bot gives the person the next question in line. The answer is stored in a file somewhere. This carrys on for a few questions until they get to the end, where all the answers get emailed to a email address.<br>I have the following so far, I know its not much, but i was stuck on how to do this next bit.<div class="codebox"><p>Code: </p><pre><code>putlog "Loading Recruitment Script by Almighty"bind join *|* * msg_join bind pub - !recruit pub:recruitproc msg_join {nick host hand chan} {putserv "NOTICE $nick :Welcome to We Are Now Kings, for the recruitment questions use !recruit. Enjoy your stay!"}proc pub:recruit {nick uhost hand chan args} {global botnickputserv "NOTICE $nick :------\002Recruitment Questions for We Are Now Kings: \002---------"putserv "NOTICE $nick :FIRST QUESTION HERE"putserv "NOTICE $nick :INSERT QUESTIONS HERE"}</code></pre></div>Can anyone shine some light on this for me?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2492">almighty</a> — Sun Nov 09, 2003 3:29 pm</p><hr />
]]></content>
	</entry>
	</feed>
