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

	<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>2009-08-10T12:52:44-04:00</updated>

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

		<entry>
		<author><name><![CDATA[[3-33]]]></name></author>
		<updated>2009-08-10T12:52:44-04:00</updated>

		<published>2009-08-10T12:52:44-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=89827#p89827</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=89827#p89827"/>
		<title type="html"><![CDATA[Help with tcl script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=89827#p89827"><![CDATA[
well, i didnt say to upload your complete bot of course,  i say if u can give me link, or upload the version of that bot u are using <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=10798">[3-33]</a> — Mon Aug 10, 2009 12:52 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2009-08-10T12:35:04-04:00</updated>

		<published>2009-08-10T12:35:04-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=89826#p89826</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=89826#p89826"/>
		<title type="html"><![CDATA[Help with tcl script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=89826#p89826"><![CDATA[
One thing that I thought of, thanks to arfer's mentioning of spaces...<br>It's not uncommon for clients/extensions to add control characters (such as bold, color, underline, etc) when using nick completion.. In this case, the pub binding will undoubtedly fail, as eggdrop does not strip these prior mask/command matching. If this is the case, your best option would be to use a pubm binding and create a suitable pattern/regular expression, possibly along with the use of the <strong class="text-strong">stripcode</strong>s command.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Mon Aug 10, 2009 12:35 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[arfer]]></name></author>
		<updated>2009-08-10T07:53:49-04:00</updated>

		<published>2009-08-10T07:53:49-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=89823#p89823</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=89823#p89823"/>
		<title type="html"><![CDATA[Help with tcl script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=89823#p89823"><![CDATA[
Sorry but I'm not prepared to upload my complete bot, not that it would necessarily do you any good anyway. I very much doubt if this issue has anything to do with your bot version. If you still believe this to be the case simply compile/install the current version.<br><br>I just thought of a possibility. Are you using an IRC client that throws in a spurious space character after typing in part of an onchan nick and using a predefined key (usually tab) for autocompletion? This used to occur with XChat, though I don't know if current versions still do that.<br><br>However, it is possible that the script author has included the following otherwise seemingly improper code segment to get rid of any such character :-<br><div class="codebox"><p>Code: </p><pre><code>proc pub_dotalkz {nick uhost hand chan rest} {set str [lrange $rest 0 end]</code></pre></div>The variable 'rest' is not a list and shouldn't normally be treated as one. Even if it was a list, [lrange $rest 0 end] would return all of it, which sort makes it strange that there would be a need to additionally define 'str'.<br><br>There are other parts of the script that I think look rather ugly. For example :-<br><div class="codebox"><p>Code: </p><pre><code>if {$nick == $botnick} {    return 0}if {$str == ""} {    putchan $chan "$nick: What? ×åãî íàäî ?"    return 0}</code></pre></div>Would look rather better as :-<br><div class="codebox"><p>Code: </p><pre><code>if {[isbotnick $nick]} {    return 0}if {[string length $str] == 0} {    putchan $chan "$nick: What? ×åãî íàäî ?"    return 0}</code></pre></div>Not that this would excuse the cross-over of string and list manipulation functions, which I have maintained by using 'string length' on the list variable 'str' as returned from the 'lrange' statement.<br><br>I'm not saying these corrections and several others in the script would resolve your problem but I am saying that I wouldn't use this script.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5705">arfer</a> — Mon Aug 10, 2009 7:53 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[[3-33]]]></name></author>
		<updated>2009-08-10T03:05:20-04:00</updated>

		<published>2009-08-10T03:05:20-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=89822#p89822</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=89822#p89822"/>
		<title type="html"><![CDATA[Help with tcl script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=89822#p89822"><![CDATA[
Well, if your eggdrop works, and my no, maybe its about what version of eggdrop i have, so would you upload or give me bot like that?<br>I think the problem can be in the eggdrop, also my bot is not uploaded to a shell, i start it from my machine,from a .bat file..so..<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10798">[3-33]</a> — Mon Aug 10, 2009 3:05 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[arfer]]></name></author>
		<updated>2009-08-09T13:19:55-04:00</updated>

		<published>2009-08-09T13:19:55-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=89813#p89813</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=89813#p89813"/>
		<title type="html"><![CDATA[Help with tcl script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=89813#p89813"><![CDATA[
It is from the Tcl archive here at <a href="http://www.egghelp.org/tcl.htm" class="postlink">www.egghelp.org/tcl.htm</a><br><br>No clue what you mean by my bot but that also is the latest version 1.6.19+ctcpfix<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5705">arfer</a> — Sun Aug 09, 2009 1:19 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[[3-33]]]></name></author>
		<updated>2009-08-09T11:35:35-04:00</updated>

		<published>2009-08-09T11:35:35-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=89811#p89811</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=89811#p89811"/>
		<title type="html"><![CDATA[Help with tcl script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=89811#p89811"><![CDATA[
<blockquote class="uncited"><div>I downloaded bottalk.tcl from this site. After loading the script and restarting I was able to get my bot to respond to $nick, $nick; $nick: AND $nick alone.<br><br>[22:41] &lt;@arfer&gt; Osmosis<br>[22:41] &lt;@osmosis&gt; arfer: What? ×åãî íàäî ?<br>[22:41] &lt;@arfer&gt; osmosis<br>[22:41] &lt;@osmosis&gt; arfer: What? ×åãî íàäî ?<br>[22:42] &lt;@arfer&gt; osmosis, hello<br>[22:42] &lt;@osmosis&gt; arfer: Ïèâî åñòü ?<br>[22:42] &lt;@arfer&gt; Osmosis: hello<br>[22:42] &lt;@osmosis&gt; arfer: Ñêîê ãîäèêîâ òåáå ?<br>[22:42] &lt;@arfer&gt; Osmosis; what are you doing?<br>[22:42] &lt;@osmosis&gt; arfer: hello<br><br>I don't have a clue what the original poster did to break it.</div></blockquote>Well, can you upload your bot so, i`ll use this new one and that?:D<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10798">[3-33]</a> — Sun Aug 09, 2009 11:35 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[arfer]]></name></author>
		<updated>2009-08-08T17:44:32-04:00</updated>

		<published>2009-08-08T17:44:32-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=89803#p89803</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=89803#p89803"/>
		<title type="html"><![CDATA[Help with tcl script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=89803#p89803"><![CDATA[
I downloaded bottalk.tcl from this site. After loading the script and restarting I was able to get my bot to respond to $nick, $nick; $nick: AND $nick alone.<br><br>[22:41] &lt;@arfer&gt; Osmosis<br>[22:41] &lt;@osmosis&gt; arfer: What? ×åãî íàäî ?<br>[22:41] &lt;@arfer&gt; osmosis<br>[22:41] &lt;@osmosis&gt; arfer: What? ×åãî íàäî ?<br>[22:42] &lt;@arfer&gt; osmosis, hello<br>[22:42] &lt;@osmosis&gt; arfer: Ïèâî åñòü ?<br>[22:42] &lt;@arfer&gt; Osmosis: hello<br>[22:42] &lt;@osmosis&gt; arfer: Ñêîê ãîäèêîâ òåáå ?<br>[22:42] &lt;@arfer&gt; Osmosis; what are you doing?<br>[22:42] &lt;@osmosis&gt; arfer: hello<br><br>I don't have a clue what the original poster did to break it.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5705">arfer</a> — Sat Aug 08, 2009 5:44 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[speechles]]></name></author>
		<updated>2009-08-08T17:06:07-04:00</updated>

		<published>2009-08-08T17:06:07-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=89802#p89802</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=89802#p89802"/>
		<title type="html"><![CDATA[Help with tcl script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=89802#p89802"><![CDATA[
<blockquote class="uncited"><div>However, it would be fair to say that none of us have managed to address your problem. We cannot see from what you have posted why $nick, $nick; and $nick: should work but not $nick alone. I doubt that it is your eggdrop, though it could be something in the script that we are unaware of.</div></blockquote><blockquote class="uncited"><div><div class="codebox"><p>Code: </p><pre><code>proc pub_dotalkz {nick uhost hand chan rest} {  global botnick  global TalkzStrArray  global TalkzChanArray  global ignore_words  global bad_nicks  set str [lrange $rest 0 end]  if {[lsearch [join $TalkzChanArray] $chan] == -1} { return 0 }    if {$nick == $botnick} {    return 0  }  if {$str == ""} {    putchan $chan "$nick: euh ... quoi ?"    return 0  }  foreach i $bad_nicks {   if {[string match [string tolower $nick] [string tolower $i]]} {     return 0   }  }  foreach i $ignore_words {    foreach j [join $rest] {      if {[string match [string tolower $j] [string tolower $i]]} {        return 0      }    }  }   set nrword [rand [llength $str]]  set nword [lrange $str $nrword $nrword]  set ntalk [lsearch -regexp $TalkzStrArray ".*[FixStrReg $nword].*"]  set n [rand 100]  set m [rand 400]    # si le nom du bot est dans la phrase, on rï¿½pond en indiquant le nom de la personne  # qui nous parle  set tt [lsearch -regexp $str ".*$botnick.*"]  if {$tt != -1} {   if { ($ntalk &gt; 0) &amp;&amp; ([rand 10] &gt; 5) } {    set dit [lindex $TalkzStrArray $ntalk]    while {[lsearch -regexp $dit ".*$botnick.*"] != -1} {      regsub -all "$botnick" $dit "[lindex [chanlist $chan] [rand [llength [chanlist $chan]]]]" dit    }    putchan $chan "$nick: $dit"   } else {    set dit [lindex $TalkzStrArray [expr [rand [llength $TalkzStrArray]]]]    while {[lsearch -regexp $dit ".*$botnick.*"] != -1} {      regsub -all "$botnick" $dit "[lindex [chanlist $chan] [rand [llength [chanlist $chan]]]]" dit    }    putchan $chan "$nick: $dit"   }  # sinon on dit une phrase quelque fois, juste comme ï¿½a  } else {   if {$n &gt; $m} {    set dit [lindex $TalkzStrArray [expr [rand [llength $TalkzStrArray]]]]    while {[lsearch -regexp $dit ".*$botnick.*"] != -1} {      regsub -all "$botnick" $dit "[lindex [chanlist $chan] [rand [llength [chanlist $chan]]]]" dit    }    putchan $chan "$dit"   }  }  set qui [string trimright [lindex $str 0] :]  if {($qui != $botnick) &amp;&amp; ([onchan $qui $chan])} {    set str [lrange $str 1 end]    if {[lindex $str 0] == ":"} { set str [lrange 1 end] }    lappend TalkzStrArray [FixStr $str]  } else {    lappend TalkzStrArray [FixStr $str]  }}</code></pre></div></div></blockquote>This should now shed some light on what is going on. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=";)" title="Wink"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8138">speechles</a> — Sat Aug 08, 2009 5:06 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[arfer]]></name></author>
		<updated>2009-08-08T15:56:58-04:00</updated>

		<published>2009-08-08T15:56:58-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=89799#p89799</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=89799#p89799"/>
		<title type="html"><![CDATA[Help with tcl script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=89799#p89799"><![CDATA[
I'm sorry [3-33] but if you have been reading this thread, then you would know that using $botnick in a bind (which executes before the bot comes online) will probably not work. I was wrong.<br><br>My little test script was manually loaded via a partyline tcl command AFTER the bot was online.<br><br>However, it would be fair to say that none of us have managed to address your problem. We cannot see from what you have posted why $nick, $nick; and $nick: should work but not $nick alone. I doubt that it is your eggdrop, though it could be something in the script that we are unaware of.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5705">arfer</a> — Sat Aug 08, 2009 3:56 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[[3-33]]]></name></author>
		<updated>2009-08-08T15:52:37-04:00</updated>

		<published>2009-08-08T15:52:37-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=89798#p89798</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=89798#p89798"/>
		<title type="html"><![CDATA[Help with tcl script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=89798#p89798"><![CDATA[
<blockquote class="uncited"><div>The problem must be elsewhere in the script you have downloaded. In order to test, I made the following very simple script.<br><div class="codebox"><p>Code: </p><pre><code>bind PUB - $botnick pub_dotalkzproc pub_dotalkz {nick uhost hand chan text} {    putserv "PRIVMSG $chan :$nick, what do you want"    return 0}</code></pre></div>This is the channel output :-<br><br>[15:11] &lt;@arfer&gt; osmosis hello<br>[15:11] &lt;@osmosis&gt; arfer, what do you want<br>[15:11] &lt;@arfer&gt; Osmosis hello<br>[15:11] &lt;@osmosis&gt; arfer, what do you want</div></blockquote>I`v test this and it wasnt work:)<br><br>Maybe its something with my eggdrop ...<br><br>anyway this script i am using: <div class="codebox"><p>Code: </p><pre><code>http://www.egghelp.org/cgi-bin/tcl_archive.tcl?mode=download&amp;id=853</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10798">[3-33]</a> — Sat Aug 08, 2009 3:52 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[arfer]]></name></author>
		<updated>2009-08-08T15:25:36-04:00</updated>

		<published>2009-08-08T15:25:36-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=89795#p89795</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=89795#p89795"/>
		<title type="html"><![CDATA[Help with tcl script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=89795#p89795"><![CDATA[
This should work. A little simpler.<br><div class="codebox"><p>Code: </p><pre><code>bind PUBM - * pubm_checktalkzproc pubm_checktalkz {nick uhost hand chan text} {    global botnick    if {[regexp -nocase -- [subst -nocommands {^$botnick[,;:]?}] $text]} {        set output [join [lrange [split $text] 1 end]]        pub_dotalkz $nick $uhost $hand $chan $output    }    return 0}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5705">arfer</a> — Sat Aug 08, 2009 3:25 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2009-08-08T13:31:27-04:00</updated>

		<published>2009-08-08T13:31:27-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=89785#p89785</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=89785#p89785"/>
		<title type="html"><![CDATA[Help with tcl script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=89785#p89785"><![CDATA[
There's no risk of double evaluation with regsub, the exp argument will never be passed to a second interpreter. A common practise with any regular expression (in tcl), is to encapsulate them with {} rather than "", since they specifically make use of [] as an integral part (same would apply to some glob-style pattern/matching as well, although it's not as common).<br><br>However, doing something like this:<div class="codebox"><p>Code: </p><pre><code>set tmp [list content]utimer 1 [lindex $tmp 0]</code></pre></div>does not protect against double evaluation, as this would be identical to this:<div class="codebox"><p>Code: </p><pre><code>set tmp contentutimer 1 $tmp##or simply:utimer 1 content</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Sat Aug 08, 2009 1:31 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[speechles]]></name></author>
		<updated>2009-08-08T13:23:04-04:00</updated>

		<published>2009-08-08T13:23:04-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=89784#p89784</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=89784#p89784"/>
		<title type="html"><![CDATA[Help with tcl script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=89784#p89784"><![CDATA[
<blockquote class="uncited"><div>speechles,<br>wouldn't it be better to use ${::botnick} than ${::nick}?<br><br>Also, mind if I ask why you create $test as a single-item list, as you only access it using "lindex $test 0" all throughout the script anyway?</div></blockquote>Yep, your 100% correct. $::botnick will cover both $::nick/$::altnick. Meaning using just $::nick will NOT cover when the bot is using it's alternate nickname, but $::botnick will.<br><br>And about the <ul><li>/[lindex] it's because of the [regsub] used to remove the botnick and char used to seperate it from the text. This could cause double evaluation and if the bot's nickname has special characters like [die] the bot may just decide to die. List is a cheap way to escape any potential issues. This is just a precaution I'm not even sure is needed.</li></ul><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8138">speechles</a> — Sat Aug 08, 2009 1:23 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2009-08-08T13:15:18-04:00</updated>

		<published>2009-08-08T13:15:18-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=89783#p89783</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=89783#p89783"/>
		<title type="html"><![CDATA[Help with tcl script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=89783#p89783"><![CDATA[
speechles,<br>wouldn't it be better to use ${::botnick} than ${::nick}?<br><br>Also, mind if I ask why you create $test as a single-item list, as you only access it using "lindex $test 0" all throughout the script anyway?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Sat Aug 08, 2009 1:15 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[speechles]]></name></author>
		<updated>2009-08-08T13:21:09-04:00</updated>

		<published>2009-08-08T13:09:56-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=89782#p89782</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=89782#p89782"/>
		<title type="html"><![CDATA[Help with tcl script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=89782#p89782"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>variable nickchars " :,;"bind pubm - * pub_shouldwetalkproc pub_shouldwetalk {nick uhost hand chan text} {   foreach entry $::nickchars {      set test [list "${::botnick}${entry}"]      if {[string match "[lindex $test 0]*" $text]} {         regsub "[lindex $test 0]" $text "" output         pub_dotalkz $nick $uhost $hand $chan $output      }   }}</code></pre></div>Something like this should work, and would just act as a "stub" to detect should the bot talk and if so passes execution along to the normal procedure pub_dotalkz. This is the easiest way to accomplish it. <ul> <li>and [lindex] is used to avoid possible conflicts with special tcl characters during the regsub with evaluated variable contents.</li></ul><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8138">speechles</a> — Sat Aug 08, 2009 1:09 pm</p><hr />
]]></content>
	</entry>
	</feed>
