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

	<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-12-13T13:27:43-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Danielle99]]></name></author>
		<updated>2010-12-13T13:27:43-04:00</updated>

		<published>2010-12-13T13:27:43-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=95338#p95338</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=95338#p95338"/>
		<title type="html"><![CDATA[public command for voice and add user]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=95338#p95338"><![CDATA[
Luminous, <br>Thanks for the help, I'm much farther along than before, there are still somethings here that are not working as expected. <br><br>The <blockquote class="uncited"><div>proc asl_kb {$nick $chan} { </div></blockquote> does not seem to be working after 30 sec. <br><br>and The <blockquote class="uncited"><div>} elseif {[string match -nocase "*/m/*" $text]} { </div></blockquote> seems to be working well. <br><br>however I do not get a +v or added to the bot with a */f/*?<br><br>Any Idea's? i've tried to check different variations of /F/ and /f/ nothing seems to trigger and add.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11426">Danielle99</a> — Mon Dec 13, 2010 1:27 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Luminous]]></name></author>
		<updated>2010-11-29T12:49:47-04:00</updated>

		<published>2010-11-29T12:49:47-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=95222#p95222</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=95222#p95222"/>
		<title type="html"><![CDATA[public command for voice and add user]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=95222#p95222"><![CDATA[
First of all... do you understand how variable setting works? More specifically, do you understand how tcl processes "indices" or "indexes" within a list? If not, then you should learn this before moving on, cause without it, things will be overly hard for you. I can give a quick run down though.<br><br>All lists start at element 0. The next item is element 1, then 2, etc. Most programming languages are similar in this way. So if you have this: <div class="codebox"><p>Code: </p><pre><code>set gender [lindex [split $text] 1]</code></pre></div>and the user types "asl * f *" in the channel, the "f" would be element 1. The "asl" part is what triggers the script, and is not counted as a list item. Element 0 in this case would be whatever that first "*" is. <br><br>Strings and lists are harder to explain, but I think it's best to say that lists can have multiple indexes, and strings do not. Certain commands are list-only or string-only, and it's crucial to understand the difference. <br><br>I don't have a lot of time to test this, but here's what i think might work:<div class="codebox"><p>Code: </p><pre><code>bind join * * aslproc asl {nick host hand chan} { bind pubm * * form   putserv "PRIVMSG $chan :$nick: a/s/l?"   set ::id [utimer 30 [list asl_kb $nick $chan]]}bind pubm * * formproc form {nick host hand chan text} {  if {[string match -nocase "*/f/*" $text]} {    unbind pubm * * form    killutimer $::id    set host [getchanhost $nick $chan]    set user [regsub -all {[^a-z]} $nick ""]    adduser "$user *![join [lrange [split $host @] 0]]@*.[join [lrange [split $host .] end-2 end] .]"    chattr $user |+fg $chan    pushmode $chan +v $nick    } elseif {[string match -nocase "*/m/*" $text]} {    unbind pubm * * form    set host [getchanhost $nick $chan]      putquick "MODE $chan +b *![join [lindex [split $host @] 0]]@*.[join [lrange [split $host .] end-2 end] .]"      putserv "KICK $chan $nick :Wrong response to \"a/s/l\"?"  }}proc asl_kb {$nick $chan} {  unbind pubm * * form  set host [getchanhost $nick $chan]      putquick "MODE $chan +b *![join [lindex [split $host @] 0]]@*.[join [lrange [split $host .] end-2 end] .]"      putserv "KICK $chan $nick :Took too much time to reply to \"a/s/l?\""}</code></pre></div>Biggest flaw I see without testing is that if more than one person joins during that 30 second window, it should screw it badly. To make it more elaborate, you would have to store each nick into either a global list or(my preference) a file. I could do this, but I have to leave you something to do. <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=11101">Luminous</a> — Mon Nov 29, 2010 12:49 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[willyw]]></name></author>
		<updated>2010-11-29T10:15:44-04:00</updated>

		<published>2010-11-29T10:15:44-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=95221#p95221</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=95221#p95221"/>
		<title type="html"><![CDATA[public command for voice and add user]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=95221#p95221"><![CDATA[
<blockquote class="uncited"><div>Ok after a long weekend and trying to make this work, I guess I havent got a clue. Can someone please assist?</div></blockquote>We can try.  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br>Some time has gone by, so it would be best if you posted whatever the "this" is, that you are working with now.   Just post the script here.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10420">willyw</a> — Mon Nov 29, 2010 10:15 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Danielle99]]></name></author>
		<updated>2010-11-29T10:02:38-04:00</updated>

		<published>2010-11-29T10:02:38-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=95220#p95220</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=95220#p95220"/>
		<title type="html"><![CDATA[public command for voice and add user]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=95220#p95220"><![CDATA[
Ok after a long weekend and trying to make this work, I guess I havent got a clue. Can someone please assist?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11426">Danielle99</a> — Mon Nov 29, 2010 10:02 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Danielle99]]></name></author>
		<updated>2010-11-22T10:43:05-04:00</updated>

		<published>2010-11-22T10:43:05-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=95170#p95170</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=95170#p95170"/>
		<title type="html"><![CDATA[public command for voice and add user]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=95170#p95170"><![CDATA[
<blockquote class="uncited"><div>[lindex [split $text] 1 ]</div></blockquote>Was exactly what I ment, Thanks. <br><blockquote class="uncited"><div>Better off I was hoping for a generic Variable/f/variable trigger without a log of data to follow, </div></blockquote>It was a typeo "Lot" is what I ment. <br><br>Its monday, and there isnt enough coffee for me this morning. I cant seem to type at all.  My appologies to all.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11426">Danielle99</a> — Mon Nov 22, 2010 10:43 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[willyw]]></name></author>
		<updated>2010-11-22T10:16:29-04:00</updated>

		<published>2010-11-22T10:16:29-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=95168#p95168</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=95168#p95168"/>
		<title type="html"><![CDATA[public command for voice and add user]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=95168#p95168"><![CDATA[
<blockquote class="uncited"><div>I'm still working mty way through this, Thanks for the links, there is a lot of information, I do understand the bind things, I understand the levels of use (-*nom) After looking at your example I dont understand how this connects.</div></blockquote>Yes, it is a lot, at first.   <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br>"dont' understand how this connects."  ..  What do you mean by, "connects"?<br>I need to understand what you are saying, to be able to try to reply.<br><blockquote class="uncited"><div>from asl to determining the "f" in the script.</div></blockquote>This is not a sentence, so I'm having trouble figuring it out.<br>If you are asking how the script finds the "f",  that is what this:<br>[lindex [split $text] 1 ] <br>does.<br><blockquote class="uncited"><div> Better off I was hoping for a generic Variable/f/variable trigger without a log of data to follow, </div></blockquote>Log?<br>I don't understand...  what log?<br><blockquote class="uncited"><div>As i understanf a extra space or mis-type could result in the script not to trigger.</div></blockquote>True.<br><br>Unfortunately, I'm a bit rushed at the moment, and nothing is coming to mind... other than to remind that was meant to be just an example.  <br>I even referred to it as rudimentary.  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br>Perhaps someone else will jump in here with a better idea, before I can return and think about it properly.<br>It won't upset me at all, if they do.<br><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=10420">willyw</a> — Mon Nov 22, 2010 10:16 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Danielle99]]></name></author>
		<updated>2010-11-22T10:05:22-04:00</updated>

		<published>2010-11-22T10:05:22-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=95167#p95167</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=95167#p95167"/>
		<title type="html"><![CDATA[public command for voice and add user]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=95167#p95167"><![CDATA[
My final concept of this script would be. <br><br>use A/S/L to determine m/f.<br><br>Voice all Females and kick/ban all males. <br><br>Also to require a response to the a/s/l script within lets say 30 sec or it will kick/ban (timed 5 Min) the incomming user onjoin the channel. <br><br>Exception: +f<br><br>Then add the authorized */f/* or */F/* to the bot +fg (friend and autovoice)<br><br><br>It seems to be a lot and I know very little, I'm dragging myself through it. <br><br>I would appreciate all the help I can get.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11426">Danielle99</a> — Mon Nov 22, 2010 10:05 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Danielle99]]></name></author>
		<updated>2010-11-22T09:59:28-04:00</updated>

		<published>2010-11-22T09:59:28-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=95166#p95166</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=95166#p95166"/>
		<title type="html"><![CDATA[public command for voice and add user]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=95166#p95166"><![CDATA[
I'm still working mty way through this, Thanks for the links, there is a lot of information, I do understand the bind things, I understand the levels of use (-*nom) After looking at your example I dont understand how this connects.<br><br>from asl to determining the "f" in the script. Better off I was hoping for a generic Variable/f/variable trigger without a log of data to follow, As i understanf a extra space or mis-type could result in the script not to trigger.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11426">Danielle99</a> — Mon Nov 22, 2010 9:59 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[willyw]]></name></author>
		<updated>2010-11-17T10:50:44-04:00</updated>

		<published>2010-11-17T10:50:44-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=95119#p95119</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=95119#p95119"/>
		<title type="html"><![CDATA[public command for voice and add user]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=95119#p95119"><![CDATA[
Here is a rudimentary example:<br><div class="codebox"><p>Code: </p><pre><code>bind pub - "asl" voice_femproc voice_fem {nick uhost handle chan text} {set gender [lindex [split $text] 1 ]     if {"$gender" == "f"} {   pushmode $chan +v $nick       } }</code></pre></div>if a user types:<blockquote class="uncited"><div>asl x f xxxxx</div></blockquote>it will trigger.<br>x  and xxxxx  can be anything.   But that f there in the middle?.. if it is not an f, then the user is not voiced.<br>If it is an f, then the user that said it, is voiced.<br>Thus: the first thing typed must be <br>asl<br>and the f must appear in the proper location, for the user to be voiced.<br><br>Again, this is a very basic example.<br><br>Once you grasp this, we can move on to adding the user, with flags, etc.<br><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=10420">willyw</a> — Wed Nov 17, 2010 10:50 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[willyw]]></name></author>
		<updated>2010-11-17T10:42:52-04:00</updated>

		<published>2010-11-17T10:42:52-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=95118#p95118</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=95118#p95118"/>
		<title type="html"><![CDATA[Re: public command for voice and add user]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=95118#p95118"><![CDATA[
<blockquote class="uncited"><div>I am trying to figure out how to code a script for my bot. </div></blockquote>Here are three things that are immense help, when beginning with TCL scripts for Eggdrop bots:<br><br><a href="http://suninet.the-demon.de/" class="postlink">http://suninet.the-demon.de/</a><br>Be sure to bookmark this one.<br>It is worth reading, from start to finish.<br>Along the way, stop and do some experimenting and have some fun, too.<br><br><a href="http://www.eggheads.org/support/egghtml/1.6.20/tcl-commands.html" class="postlink">http://www.eggheads.org/support/egghtml ... mands.html</a><br>This is all the Eggdrop specific TCL commands.<br>Having this at your fingertips is essential.<br>This is the online version,  but you already have a copy of it.  Look in your bot's   doc/   directory for a file named  tcl-commands.doc<br><br><a href="http://www.tcl.tk/man/tcl8.5/TclCmd/contents.htm" class="postlink">http://www.tcl.tk/man/tcl8.5/TclCmd/contents.htm</a><br>This is the non-Eggdrop specific commands.<br>Also essential.<br>Be sure to bookmark that too.<br><br><blockquote class="uncited"><div>I would like to have a user give a/s/l in channel and on  */f/*  give voice on that.  I would also like the script to add the user with .chattr +fg <br><br>I have no idea where to begin. Please help.</div></blockquote>As you read the Suninet pages, and skim through tcl-commands.doc , pay close attention to the parts about<br>bind<br>There are many different bind types.<br>It sounds like you will be wanting a <br>bind pub<br>Meaning: your script will have the bot watch for any user to say something specific, and react to it....  a public comment is bound to a procedure....   when "this" happens,  do "that".<br><br>For your specific need, the trick will be in determining exactly what you want the bot to watch for.<br>For example:<br>asl 20 f USA<br>If so, you could have the bot watch for "asl" as the trigger, and then everything that follows can be data that you operate with  in the script....<br>to give voice if f, and to add the user to bot with +fg, etc. etc.<br>(On the Suninet site, it even explains how to do <br>if<br>look for :  7. Running commands under certain conditions   )<br><br>I hope this helps.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10420">willyw</a> — Wed Nov 17, 2010 10:42 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Danielle99]]></name></author>
		<updated>2010-11-16T23:49:15-04:00</updated>

		<published>2010-11-16T23:49:15-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=95113#p95113</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=95113#p95113"/>
		<title type="html"><![CDATA[public command for voice and add user]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=95113#p95113"><![CDATA[
I am trying to figure out how to code a script for my bot. <br><br>I would like to have a user give a/s/l in channel and on  */f/*  give voice on that. I would also like the script to add the user with .chattr +fg <br><br>I have no idea where to begin. Please help.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11426">Danielle99</a> — Tue Nov 16, 2010 11:49 pm</p><hr />
]]></content>
	</entry>
	</feed>
