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

	<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-01-19T21:06:13-04:00</updated>

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

		<entry>
		<author><name><![CDATA[CosmicD]]></name></author>
		<updated>2005-01-19T21:06:13-04:00</updated>

		<published>2005-01-19T21:06:13-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=45573#p45573</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=45573#p45573"/>
		<title type="html"><![CDATA[cool !learn funcommands idea]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=45573#p45573"><![CDATA[
lol, i can understand <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_razz.gif" width="15" height="15" alt=":P" title="Razz"> its a good script though, i guess i'll find something or someone <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_razz.gif" width="15" height="15" alt=":P" title="Razz"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5772">CosmicD</a> — Wed Jan 19, 2005 9:06 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2005-01-19T20:07:04-04:00</updated>

		<published>2005-01-19T20:07:04-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=45569#p45569</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=45569#p45569"/>
		<title type="html"><![CDATA[cool !learn funcommands idea]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=45569#p45569"><![CDATA[
<blockquote class="uncited"><div>it would be like i wouold do in dcc .binds pub* , but not really getting the types but the procs... hope that makes sens</div></blockquote>That's weird...sounds like you moved a "}" in the save proc or something - or I am really tired and incapable of reading my own code <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_razz.gif" width="15" height="15" alt=":P" title="Razz"><br>Anyway...I'm bored with this topic, so you'll have to wait and see if anyone else feels like making this script for you <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=2878">user</a> — Wed Jan 19, 2005 8:07 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[CosmicD]]></name></author>
		<updated>2005-01-19T08:19:32-04:00</updated>

		<published>2005-01-19T08:19:32-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=45535#p45535</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=45535#p45535"/>
		<title type="html"><![CDATA[cool !learn funcommands idea]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=45535#p45535"><![CDATA[
<blockquote class="uncited"><div>I think it will be better to have all the argument name lists and messages stored in an array and have all the binds invoke a single proc that takes care of the things the now generated procS </div></blockquote>*nods clueless head*.. I'll always be a programming newbie, never got the hang of any langueg excep a bit of pirch scripting a long time ago... <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_razz.gif" width="15" height="15" alt=":P" title="Razz"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5772">CosmicD</a> — Wed Jan 19, 2005 8:19 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[CosmicD]]></name></author>
		<updated>2005-01-18T17:49:21-04:00</updated>

		<published>2005-01-18T17:49:21-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=45522#p45522</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=45522#p45522"/>
		<title type="html"><![CDATA[cool !learn funcommands idea]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=45522#p45522"><![CDATA[
OK, i have now:<br><br>and I try to save, and it always says "nope" <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"> and nothing is being saved. if i leave the file out only one proc that I have called pub_cd is being saved<br><div class="codebox"><p>Code: </p><pre><code>set crapFile "melissa.fun"bind pub n !saveCrap saveCrapproc saveCrap {n u h c a} {   foreach {t f k . C} [join [binds pub]] {    if {$k==$a} {    if {![string match {crap[0-9]*} $C]} {puthelp "PRIVMSG $c :$n: nope."; return}    set f [open $::crapFile a]         puts $f [list bind $t $f $k $C]         puts $f [list proc $C [info args $C] [info body $C]]         close $f         puthelp "PRIVMSG $c :$n: saved."         return       }   }   puthelp "PRIVMSG $c :$n: no such bind."}if {[file exists $crapFile]} {source $crapFile}</code></pre></div>there seems to be going on something weird.. you know when i view the saved file with the previous script, it would be savind procs with the name pub* ... theres only one like that..<br><br>it would be like i wouold do in dcc .binds pub* , but not really getting the types but the procs... hope that makes sens<br><br>I'll never be a programming genious because I don't even understand lots of the structures , so, can anyone help ?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5772">CosmicD</a> — Tue Jan 18, 2005 5:49 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2005-01-18T17:26:22-04:00</updated>

		<published>2005-01-18T17:26:22-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=45520#p45520</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=45520#p45520"/>
		<title type="html"><![CDATA[cool !learn funcommands idea]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=45520#p45520"><![CDATA[
Add "return" below the "saved" message to get rid of the "no such bind" message and add this little snippet above the line opening the file:<div class="codebox"><p>Code: </p><pre><code>if {![string match {crap[0-9]*} $C]} {puthelp "PRIVMSG $c :$n: nope."; return}</code></pre></div>...and you probably want to delete the file to get rid of all the other procs you've saved<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2878">user</a> — Tue Jan 18, 2005 5:26 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[CosmicD]]></name></author>
		<updated>2005-01-18T16:16:41-04:00</updated>

		<published>2005-01-18T16:16:41-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=45517#p45517</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=45517#p45517"/>
		<title type="html"><![CDATA[cool !learn funcommands idea]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=45517#p45517"><![CDATA[
wow, it kinda saves all the pubs, is it also possible to tighten ? to only save the crap* procs ?<br><br>when I do .binds crap* in the dcc chat, it shows all the crap procs that I have , so i wonder why it wont work if i change the binds pub thingy to binds crap* inside the script you provided,<br><br>then it says "no such bind" <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_sad.gif" width="15" height="15" alt=":(" title="Sad"><br><br>i've got a tcl error where it says args should be binds ?type/mask?<br><br>when I type binds pub/crap? it doesnt work, what am i doing wrong ? <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_sad.gif" width="15" height="15" alt=":(" title="Sad"><br><br>if i just execute the script like you wrot it, it first says "saved" and then "no such binds so thatsweird<br><br>when i go look in the file i see all kinds of variables of only certain procs starting with pub_ but not really the ones i need...<br><br>when doing .binds crap* inside dcc chat, i get all the crap procs that are there, why doesn't it save ?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5772">CosmicD</a> — Tue Jan 18, 2005 4:16 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2005-01-18T15:44:52-04:00</updated>

		<published>2005-01-18T15:44:52-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=45516#p45516</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=45516#p45516"/>
		<title type="html"><![CDATA[cool !learn funcommands idea]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=45516#p45516"><![CDATA[
It was not meant to be a complete script...it was just to give you a starting point...a few clues / ideas...if you plan to make alot of commands, I think it will be better to have all the argument name lists and messages stored in an array and have all the binds invoke a single proc that takes care of the things the now generated procS do. (to avoid having MANY almost exact copies of that lame proc code <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_razz.gif" width="15" height="15" alt=":P" title="Razz">)<br><br>To have a message when a command is created, just add it at the end of the proc?<br><br>If you deny overwriting ANY existing bind, it will be a pain in the ass when you screw up. I think it would be better to deny overwriting binds not created by your script.<br><br>I didn't include  the saving part, but that's pretty easy (I think it would be a good idea to have a separate command for that, so you can test the new command first and then decide if you want to keep them.)<div class="codebox"><p>Code: </p><pre><code>set crapFile "saved.crap"bind pub n !saveCrap saveCrapproc saveCrap {n u h c a} {foreach {t f k . C} [join [binds pub]] {if {$k==$a} {set f [open $::crapFile a]puts $f [list bind $t $f $k $C]puts $f [list proc $C [info args $C] [info body $C]]close $fputhelp "PRIVMSG $c :$n: saved."}}puthelp "PRIVMSG $c :$n: no such bind."}if {[file exists $crapFile]} {source $crapFile}</code></pre></div>(not tested)<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2878">user</a> — Tue Jan 18, 2005 3:44 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[CosmicD]]></name></author>
		<updated>2005-01-18T05:58:04-04:00</updated>

		<published>2005-01-18T05:58:04-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=45500#p45500</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=45500#p45500"/>
		<title type="html"><![CDATA[cool !learn funcommands idea]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=45500#p45500"><![CDATA[
thx alot, going to try this <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br>it works very well for the commands, it seems to not accept if you screw up the accolades and not return any (correct) variables so thats good, <br><br>hopefully i'tll survive the translation and my prefference to do every "error message" in notice..<br><br>That be done I have a few "debugging info <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_razz.gif" width="15" height="15" alt=":P" title="Razz">"<br><br>it would be nice if the bot gives a message back when things are entered succesfully  ?<br><br>When a command already exists, could you please add a code that tells the user that the command already exists ?<br><br>Where are the commands supposed to be saved ? I think it should add the procedures to the addcrap tcl file at the bottom ? but it doesnt do that so my bot forgets the commands when I restart <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br>I see the new binds with procs like crap0 en crap1 but they don't appear anything in the tcl, nor do I get any error message about it <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_sad.gif" width="15" height="15" alt=":(" title="Sad"><br><br>thx alot already.. youre having a credit message in the help page of that bot <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=5772">CosmicD</a> — Tue Jan 18, 2005 5:58 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2005-01-17T21:14:18-04:00</updated>

		<published>2005-01-17T21:14:18-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=45496#p45496</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=45496#p45496"/>
		<title type="html"><![CDATA[here's some code to get you started]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=45496#p45496"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>bind pub n !addCrap addCrapproc addCrap {n u h c a} {# check for valid lists of argumentsif {![info complete $a]||![info complete [lindex $a 1]]} {puthelp "PRIVMSG $c :$n: that makes no sense to me."return}# check for valid number of argumentsif {[llength $a]!=3} {puthelp "PRIVMSG $c :$n: usage: $::lastbind !newTrigger {argument names enclosed in braces} {message enclosed in braces}"return}# extract trigger, argument list and messageforeach {trigger args msg} $a break# code creating code ain't pretty :Pset    code "\n"append code "set args \[split \$arg\]\n"append code "if \{\[llength \$args\]!=[llength $args]\} \{\n"append code "puthelp \"PRIVMSG \$chan :\$nick: usage: \$::lastbind $args\"\n"append code "return\n"append code "\}\n"if {[llength $args]} {append code "foreach [list $args] \[split \$arg\] break\n"}append code "if \[catch \{[list subst -noc $msg]\} msg\] \{\n"append code "puthelp \"PRIVMSG \$chan :\$nick: $h screwed up: \$msg\"\n"append code "\} else \{\n"append code "puthelp \"PRIVMSG \$chan :\$msg\"\n"append code "\}\n"# invent a proc name and create bind + procset i -1while {[info commands crap[incr i]]!={}} {}bind pub - $trigger crap$iproc crap$i {nick uhost hand chan arg} $code}</code></pre></div>The usage is a bit different from what you requested: !addCrap trigger {argument list} {message enclosed in braces}<br>eg:<br>!addCrap !test0 {} {Hello $nick!}<br>!addCrap !test1 {victim} {I am testing this thing on $victim}<br>!addCrap !test2 {victim1 victim2} {\001ACTION slaps $victim1 with $victim2\001}<br>I didn't test it, so have fun debugging <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_twisted.gif" width="15" height="15" alt=":twisted:" title="Twisted Evil"><br>The variables that can be used in the message are: nick, uhost, hand, chan and arg + the names you supply when creating the command.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2878">user</a> — Mon Jan 17, 2005 9:14 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[CosmicD]]></name></author>
		<updated>2005-01-17T20:04:51-04:00</updated>

		<published>2005-01-17T20:04:51-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=45494#p45494</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=45494#p45494"/>
		<title type="html"><![CDATA[cool !learn funcommands idea]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=45494#p45494"><![CDATA[
oh well, i was kinda hoping it would exist already <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_sad.gif" width="15" height="15" alt=":(" title="Sad"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5772">CosmicD</a> — Mon Jan 17, 2005 8:04 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[^DooM^]]></name></author>
		<updated>2005-01-17T19:48:36-04:00</updated>

		<published>2005-01-17T19:48:36-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=45493#p45493</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=45493#p45493"/>
		<title type="html"><![CDATA[Re: cool !learn funcommands idea]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=45493#p45493"><![CDATA[
<blockquote class="uncited"><div>Maybe it exists but it would be cool if i'd had the following:<br><br>a "learn" script that can adopt new funcommands.<br><br>Like I would tell the bot to "!learn !certainpubliccommand $botnick thinks that $victim is in love with $posternick. &lt;2 args&gt;<br><br>it would then correctly learn how to use that new command like it's suppowed to and program it in such a way that the user that's going to use this command has to do 2 arguments, the $victim nick or the nick that places the command ..<br><br>the bot would place these new commands in a tcl database or so, and so users can create their own fun commands <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"> (or onwers, depending of the bind)<br><br>I don't know jack about coding really, but it would be cool that those arguements that people could learn to the bot be like $where $what $victim $nick $botnick or something... <br><br>PS: errormessages that tell the user when they do something wrong are welcome, like, when they use too many arguments or soemthing like that, or when arguments cant be understood..<br><br><br>Hope that makes sense....</div></blockquote>You want someone to code this?<br><br>That is a rather large request. I doubt very much anyone here has the time or inclination to write such a script.<br><br>Your best bet would be to read the <a href="http://tcl.tk/man/tcl8.5/TclCmd/contents.htm" class="postlink">TCL Commands Manual</a> and start this script off yourself and ask for help on specific problems you encounter.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3723">^DooM^</a> — Mon Jan 17, 2005 7:48 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[CosmicD]]></name></author>
		<updated>2005-01-17T19:35:58-04:00</updated>

		<published>2005-01-17T19:35:58-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=45492#p45492</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=45492#p45492"/>
		<title type="html"><![CDATA[cool !learn funcommands idea]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=45492#p45492"><![CDATA[
Maybe it exists but it would be cool if i'd had the following:<br><br>a "learn" script that can adopt new funcommands.<br><br>Like I would tell the bot to "!learn !certainpubliccommand $botnick thinks that $victim is in love with $posternick. &lt;2 args&gt;<br><br>it would then correctly learn how to use that new command like it's suppowed to and program it in such a way that the user that's going to use this command has to do 2 arguments, the $victim nick or the nick that places the command ..<br><br>the bot would place these new commands in a tcl database or so, and so users can create their own fun commands <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"> (or onwers, depending of the bind)<br><br>I don't know jack about coding really, but it would be cool that those arguements that people could learn to the bot be like $where $what $victim $nick $botnick or something... <br><br>PS: errormessages that tell the user when they do something wrong are welcome, like, when they use too many arguments or soemthing like that, or when arguments cant be understood..<br><br><br>Hope that makes sense....<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5772">CosmicD</a> — Mon Jan 17, 2005 7:35 pm</p><hr />
]]></content>
	</entry>
	</feed>
