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

	<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>2025-08-19T13:14:24-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Arnold_X-P]]></name></author>
		<updated>2025-08-19T13:14:24-04:00</updated>

		<published>2025-08-19T13:14:24-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=113358#p113358</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=113358#p113358"/>
		<title type="html"><![CDATA[Re: Ai.tcl by KuNgFo0 - Responds to certain words said in the set channels.]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=113358#p113358"><![CDATA[
It worked very well for me, thank you CrazyCat.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8327">Arnold_X-P</a> — Tue Aug 19, 2025 1:14 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[CrazyCat]]></name></author>
		<updated>2025-08-19T02:04:36-04:00</updated>

		<published>2025-08-19T02:04:36-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=113357#p113357</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=113357#p113357"/>
		<title type="html"><![CDATA[Re: Ai.tcl by KuNgFo0 - Responds to certain words said in the set channels.]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=113357#p113357"><![CDATA[
Small error, I left a piece of test, a subst which must not be here.<br><br>Here is the working code:<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/atom-one-dark-reasonable.min.css"> <strong>script</strong>  <strong>script</strong> <div class="codebox"><pre><code class="language-tcl"> #################################### Ai.tcl by KuNgFo0 (#eggfaq@efnet)#VERSION 0.3#DESCRIPTION Responds to certain words said in the set channels.# Set the next lines as the triggers and random responses you want# (wildcards may be used)set ai_data {   {"Hello" "Hi $::botnick" "$::botnick Hey"} {"Hey what's up, $nick?" "Yo" "Hello!"}   {"What time is it?" "What is the time?" "What's the time?" "Anyone have the time?"} {"$nick, it's [clock format [clock seconds]]"}}# Set the next line as the channels you want to run inset ai_chans "#beni2 #trinidad"proc pub_ai {nick uhost hand chan arg} {   global ai_data ai_chans botnick   if {(([lsearch -exact [string tolower $ai_chans] [string tolower $chan]] != -1) || ($ai_chans == "*")) &amp;&amp; (![matchattr $hand b]) &amp;&amp; ($nick != $botnick)} {      foreach {triggers responses} $ai_data {         foreach trigger $triggers {            if {[string match [string tolower [subst $trigger]] [string tolower $arg]]} {               putserv "PRIVMSG $chan :[subst [lindex $responses [rand [llength $responses]]]]"               return            }         }      }   }}bind pubm - * pub_aiputlog "*** Ai.tcl 0.3 by KuNgFo0 loaded"</code></pre></div> <strong>script</strong> <p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=691">CrazyCat</a> — Tue Aug 19, 2025 2:04 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Arnold_X-P]]></name></author>
		<updated>2025-08-18T22:34:51-04:00</updated>

		<published>2025-08-18T22:34:51-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=113356#p113356</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=113356#p113356"/>
		<title type="html"><![CDATA[Re: Ai.tcl by KuNgFo0 - Responds to certain words said in the set channels.]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=113356#p113356"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code> #################################### Ai.tcl by KuNgFo0 (#eggfaq@efnet)#VERSION 0.3#DESCRIPTION Responds to certain words said in the set channels.# Set the next lines as the triggers and random responses you want# (wildcards may be used)set ai_data { {"Hello" "Hi $::botnick" "$::botnick Hey"} {   "Hey what's up, $nick?"  "Yo"  "Hello!" } {"What time is it?" "What is the time?" "What's the time?" "Anyone have the time?"} {  "$nick, it's [clock format [clock seconds]]" }}# Set the next line as the channels you want to run inset ai_chans "#beni2  #trinidad"proc pub_ai {nick uhost hand chan arg} { global ai_data ai_chans botnick if {(([lsearch -exact [string tolower $ai_chans] [string tolower $chan]] != -1) || ($ai_chans == "*")) &amp;&amp; (![matchattr $hand b]) &amp;&amp; ($nick != $botnick)} {  foreach {triggers responses} $ai_data {   foreach trigger $triggers {if {[string match [string tolower [subst $trigger]] [string tolower subst $arg]]} {   putserv "PRIVMSG $chan :[subst [lindex $responses [rand [llength $responses]]]]"; return }   }  } }}bind pubm - * pub_aiputlog "*** Ai.tcl 0.3 by KuNgFo0 loaded"</code></pre></div> <br>When I apply the suggestions it gives me the following error<div class="codebox"><p>Code: </p><pre><code> [22:32:18] Tcl error [pub_ai]: bad index "JulieTh Hey": must be integer?[+-]integer? or end?[+-]integer?</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8327">Arnold_X-P</a> — Mon Aug 18, 2025 10:34 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[CrazyCat]]></name></author>
		<updated>2025-08-18T10:36:45-04:00</updated>

		<published>2025-08-18T10:36:45-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=113355#p113355</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=113355#p113355"/>
		<title type="html"><![CDATA[Re: Ai.tcl by KuNgFo0 - Responds to certain words said in the set channels.]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=113355#p113355"><![CDATA[
Try using <strong class="text-strong">subst</strong> with $trigger too<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/atom-one-dark-reasonable.min.css"> <strong>script</strong>  <strong>script</strong> <div class="codebox"><pre><code class="language-tcl">if {[string match [string tolower [subst $trigger]] [string tolower subst $arg]]} {   putserv "PRIVMSG $chan :[subst [lindex $responses [rand [llength $responses]]]]";   return}</code></pre></div> <strong>script</strong> And in your ai_datas, use $::botnick rather than $botnick<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=691">CrazyCat</a> — Mon Aug 18, 2025 10:36 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Arnold_X-P]]></name></author>
		<updated>2025-08-17T23:54:40-04:00</updated>

		<published>2025-08-17T23:54:40-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=113354#p113354</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=113354#p113354"/>
		<title type="html"><![CDATA[Ai.tcl by KuNgFo0 - Responds to certain words said in the set channels.]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=113354#p113354"><![CDATA[
I found this TCL in the forum, it's very good.<div class="codebox"><p>Code: </p><pre><code> #################################### Ai.tcl by KuNgFo0 (#eggfaq@efnet)#VERSION 0.3#DESCRIPTION Responds to certain words said in the set channels.# Set the next lines as the triggers and random responses you want# (wildcards may be used)set ai_data { {"Hello" "Hi" "Hey"} {  "Hey what's up, $nick?"  "Yo"  "Hello!" } {"What time is it?" "What is the time?" "What's the time?" "Anyone have the time?"} {  "$nick, it's [clock format [clock seconds]]" }}# Set the next line as the channels you want to run inset ai_chans "#testchannel1 #testchannel2"proc pub_ai {nick uhost hand chan arg} { global ai_data ai_chans botnick if {(([lsearch -exact [string tolower $ai_chans] [string tolower $chan]] != -1) || ($ai_chans == "*")) &amp;&amp; (![matchattr $hand b]) &amp;&amp; ($nick != $botnick)} {  foreach {triggers responses} $ai_data {   foreach trigger $triggers {    if {[string match [string tolower $trigger] [string tolower $arg]]} { putserv "PRIVMSG $chan :[subst [lindex $responses [rand [llength $responses]]]]" ; return }   }  } }}bind pubm - * pub_aiputlog "*** Ai.tcl 0.3 by KuNgFo0 loaded"</code></pre></div> <br>But the bot nickname variant is missing.<br>And I'd like to change this.<div class="codebox"><p>Code: </p><pre><code> {"Hello" "Hi" "Hey"} { </code></pre></div> <br>to use $botnick example: line 9<div class="codebox"><p>Code: </p><pre><code> {"Hello" "Hi $botnick" "$botnick Hey"} { </code></pre></div> <br>Could you help me get that variant?<br><br>I tried using this variant, but it doesn't work for me. <div class="codebox"><p>Code: </p><pre><code> regsub -all -- {$botnick} $responses $botnick responses</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8327">Arnold_X-P</a> — Sun Aug 17, 2025 11:54 pm</p><hr />
]]></content>
	</entry>
	</feed>
