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

	<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>2011-08-01T16:11:50-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Michiellll]]></name></author>
		<updated>2011-08-01T16:11:50-04:00</updated>

		<published>2011-08-01T16:11:50-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=97310#p97310</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=97310#p97310"/>
		<title type="html"><![CDATA[what's wrong with this tcl script ?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=97310#p97310"><![CDATA[
I installed this version of megahal recently, but I don't understand how to apply this learnfile option.<br><br>Does anyone and would you tell me please? It's kind of annoying<br>Thanks in advance ^^<br><br><a href="http://thelastexit.net/megahal/readme.txt" class="postlink">http://thelastexit.net/megahal/readme.txt</a><div class="codebox"><p>Code: </p><pre><code>TCLsavebrain - duhreloadbrain - take a guesstrimbrain &lt;#ofnodes&gt; - same as the public commandlearningmode &lt;on/off&gt; - dittotalkfrequency &lt;#oflines&gt; - dittosetmegabotnick &lt;botnick&gt; - this sets the botnick to look out for in all public                           chatter. The botnick bindings still have to be                           changed separately though (see megahal.tcl).setmaxcontext &lt;size&gt; - use this to change the context size of a brain                       dynamically. Valid values are 1-5. 2 is highly                       recommended, 3 is much more boring but it will also                       produce much more coherent sentences. 1 will make it                       babble incoherently a lot of the time and 4-5 will turn                       it into a parrot instead of a fun AI.reloadphrases - this will reload the brain from scratch but by relearning all                the phrases in the megahal.phr file only. You can edit the phr                file or restore an old one this way and weed out the brain.learnfile &lt;filename&gt; - this will learn all the phrases it finds in the specified                       file and add them to the current brain.</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11743">Michiellll</a> — Mon Aug 01, 2011 4:11 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[3rdBAR]]></name></author>
		<updated>2009-11-15T08:45:13-04:00</updated>

		<published>2009-11-15T08:45:13-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=90918#p90918</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=90918#p90918"/>
		<title type="html"><![CDATA[what's wrong with this tcl script ?]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=90918#p90918"><![CDATA[
Below is the accompanying tcl script that's packaged with the MegaHal v3.5 module. I've attempted to use it after installing the module on eggdrop v1.6.19 but none of the commands defined in the script seems to work.<br><br><strong class="text-strong">the script:</strong><div class="codebox"><p>Code: </p><pre><code># This is an accompanying TCL script to go with the MegaHAL eggdrop module# It is optional but strongly recommended# Should the bot learn what is said to it or only converse? Set to on/off.set learnmode on# What is the max size the brain should grow to?# Set to the max number of nodes not ramset maxsize 100000# Flood protection: how many max lines per how many seconds should it respond to?set floodmega 10:60# Which channels NOT to respond in when the botnick is mentioned (use space delimited list)# Note: this includes the 'botnick: ' learning triggerset respondexcludechans ""# Which keywords besides the botnick should be responded to (use space delimited list)# Examples can include alternative bot nicknames, people's names, special words like hello, music, etcset responsekeywords ""# How often should it talk in response to anything that is said in the channels?# Set to # of lines or to 0 to turn this off.set talkfreq 40# Which channels NOT to talk in in response to all chatter (use space delimited list)set talkexcludechans ""# How often should it learn phrases that are said in the channels?# Set to # of lines or to 0 to turn this off.set learnfreq 100# The following settings change the 'psychotic' level or personality of the AI slightly# Max context size# Valid values are 1-5# 2 is highly recommended, 3 is much more boring but it will also produce much more coherent sentences# 1 will make it babble incoherently a lot of the time and 4-5 will turn it into a parrot instead of a fun AIset maxcontext 2# Surprise mode on or off (0/1)# This changes the way it constructs sentences. # If on, it tries to find unconventional combinations of words which means much more fun but also more incoherent sentences# If off, sentences are safer but more parrot-like so this is only recommended if the brain size is huge )in which case the bot has many safe options to use).set surprise 1# Max reply words# This can help avoid long incoherent sentences that seem to run forever without making sense# It limits the AI to create shorter sentences# Recommended setting is about 25-40, set to 0 to allow unlimited sizeset maxreplywords 30#####################################################################set learningmode $learnmode# bind the botnickcatch "unbind pub - hal: *pub:hal:"bind pub - ${nick}: *pub:hal:catch "unbind dcc - hal *dcc:hal"bind dcc - $nick *dcc:halset megabotnick $nick# Save and trim the brain once every hourbind time - "35 * * * *" auto_brainsaveproc auto_brainsave {min b c d e} {   global maxsize  trimbrain $maxsize  savebrain}bind pub m ".savebrain" pub_savebrainproc pub_savebrain {nick uhost hand chan arg} { savebrain puthelp "PRIVMSG $chan :Brain saved"}bind pub n ".trimbrain" pub_trimbrainproc pub_trimbrain {nick uhost hand chan arg} { global maxsize set arg1 [lindex $arg 0] if {$arg1 == "" || ![isnum $arg1]} {set arg1 $maxsize } trimbrain $arg1 puthelp "PRIVMSG $chan :Brain trimmed"}bind pub n ".lobotomy" pub_lobotomyproc pub_lobotomy {nick uhost hand chan arg} { savebrain file delete megahal.old file copy megahal.brn megahal.old file delete megahal.brn reloadbrain savebrain puthelp "PRIVMSG $chan :Lobotomy completed! Creating a new brain..." }bind pub - ".braininfo" pub_braininfoproc pub_braininfo {nick uhost hand chan arg} {  global learnmode  set for [treesize -1 0]  set back [treesize -1 1]  puthelp "PRIVMSG $chan :My current vocabulary consists of [lindex $for 0] words, my brain size is [expr [lindex $for 1]+[lindex $back 1]] nodes, and learning mode is $learnmode" #  if {[file exists megahal.old]} {#    puthelp "PRIVMSG $chan :This brain has been growing for [duration [expr [unixtime] - [file mtime megahal.old]]]" #  }}bind pub n ".learningmode" pub_learningmodeproc pub_learningmode {nick uhost hand chan arg} {  global learnmode  set arg1 [lindex $arg 0]  if {$arg1 == "" || ($arg1 != "on" &amp;&amp; $arg1 != "off")} {   puthelp "PRIVMSG $chan :Usage: .learningmode on/off"   return  }  set learnmode $arg1  learningmode $learnmode  puthelp "PRIVMSG $chan :Learning mode is now set to $arg1" }bind pub m ".talkfrequency" pub_talkfrequencyproc pub_talkfrequency {nick uhost hand chan arg} {  global talkfreq  set arg1 [lindex $arg 0]  if {$arg1 == ""} {   puthelp "PRIVMSG $chan :Talking frequency is set to $talkfreq lines"    return  }  set talkfreq $arg1  puthelp "PRIVMSG $chan :Talking frequency is now set to $arg1 lines" }bind pub n ".restorebrain" pub_restorebrainproc pub_restorebrain {nick uhost hand chan arg} {  if {[file exists megahal.old]} {    file delete megahal.brn    file copy megahal.old megahal.brn    reloadbrain    puthelp "PRIVMSG $chan :Old brain restored!"  } else {    puthelp "PRIVMSG $chan :Old brain not found!"   }}proc isnum {num} {  for {set x 0} {$x &lt; [string length $num]} {incr x} {  if {[string trim [string index $num $x] 0123456789.] != ""} {return 0}  } return 1}</code></pre></div><strong class="text-strong">the accompanying commands documentation:</strong><div class="codebox"><p>Code: </p><pre><code>COMMANDSNote that many of the following commands are added by the optional megahal.tcl script.Feel free to bind more commands to DCC or public as necessary using the providedTCL commands.PUBLIC (in channels)Any line with the botnick in it will get the bot to respond.To teach it something use - &lt;botnick&gt;: bla bla.braininfo - displays current brain information such as size, etc..megaver - displays version informationBot masters only:.forget &lt;text&gt; - this will try to forget the specified text by finding an                 original phrase that matches the text as closely as possible..forgetword &lt;word&gt; - this will forget all phrases containing that word.savebrain - saves the brain, dictionary and phrase files. Note that the brain             is automatically saved once every hour and when the bot goes down..talkfrequency &lt;#oflines&gt; - sets how often the bot should respond to chatter in                            public channels.Bot owners only:.trimbrain &lt;#ofnodes&gt; - trims the brain down to roughly the specified size..lobotomy - backups the current brain, deletes it and starts a new one..restorebrain - looks for megahal.old and restores it, deleting the current one..learningmode &lt;on/off&gt; - sets whether the bot should learn from &lt;botnick&gt;: etc                         or only converse.DCCTo teach it something (and to get a response) use - .&lt;botnick&gt; bla bla.megaver - displays version informationBot masters only:.forget &lt;text&gt; - this will try to forget the specified text by finding an                 original phrase that matches the text as closely as possible.TCLsavebrain - duhreloadbrain - take a guesstrimbrain &lt;#ofnodes&gt; - same as the public commandlearningmode &lt;on/off&gt; - dittotalkfrequency &lt;#oflines&gt; - dittosetmegabotnick &lt;botnick&gt; - this sets the botnick to look out for in all public                           chatter. The botnick bindings still have to be                           changed separately though (see megahal.tcl).setmaxcontext &lt;size&gt; - use this to change the context size of a brain                       dynamically. Valid values are 1-5. 2 is highly                       recommended, 3 is much more boring but it will also                       produce much more coherent sentences. 1 will make it                       babble incoherently a lot of the time and 4-5 will turn                       it into a parrot instead of a fun AI.reloadphrases - this will reload the brain from scratch but by relearning all                the phrases in the megahal.phr file only. You can edit the phr                file or restore an old one this way and weed out the brain.learnfile &lt;filename&gt; - this will learn all the phrases it finds in the specified                       file and add them to the current brain.The following are only useful for people interested in sticking their fingersinto the brain. They are hacks, not user friendly services!treesize &lt;subbranch&gt; &lt;forwards/backwards&gt; - displays four numbers that give info                                            on the specified branch:                                            1. # of branches                                            2. # of all subbranches/nodes                                            3. the count counter                                            4. the usage counterviewbranch &lt;subbranch&gt; &lt;forwards/backwards&gt; - shows the actual words contained                                              in a branch and all its subranches                                              together with the usage counter                                              for each word. &lt;subbranch&gt; - set this to -1 for the main branch, any other number for a               specified subbranch (it can only go one level down) &lt;forwards/backwards&gt; - 0 for the forward tree, 1 for backward treeTCL VARIABLEStalkfreq - int - see talkfrequency commandlearnfreq - int - how often to learn phrases said in the channelsmaxsize - int - max brain size. see trimbrain commandmaxreplywords - int - max size for replies. This can help keep those endless                incoherent sentences under controlsurprise - int - 0 for off, 1 for on. If on, the AI tries to generate more           surprising replies.talkexcludechans - string - space delimited list of chans to exclude from the                   public chatter (talkfrequency).respondexcludechans - string - space delimited list of chans to exclude from                      the bot responses (all lines with the botnick in them)responsekeywords - string - space delimited list of keywords besides the botnick to respond tofloodmega - couplet - flood settings (how many lines in how many seconds)</code></pre></div>The out-of-package file had two apparent spacing typos and one apparent omission of <strong class="text-strong">set</strong>, which had to be corrected before the script would even load:<br><br>was <strong class="text-strong">setmaxcontext 2</strong> instead of <strong class="text-strong">set maxcontext 2</strong><br><br>was <strong class="text-strong">setmegabotnick $nick</strong> instead of <strong class="text-strong">set megabotnick $nick</strong><br><br>and<br><br>was <strong class="text-strong">learningmode $learnmode</strong> instead of <strong class="text-strong"> set learningmode $learnmode</strong><br><br>Any observations or opinions will be much appreciated.<br><br>TIA<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7757">3rdBAR</a> — Sun Nov 15, 2009 8:45 am</p><hr />
]]></content>
	</entry>
	</feed>
