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

	<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-28T11:11:56-04:00</updated>

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

		<entry>
		<author><name><![CDATA[De Kus]]></name></author>
		<updated>2005-01-28T11:11:56-04:00</updated>

		<published>2005-01-28T11:11:56-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=45895#p45895</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=45895#p45895"/>
		<title type="html"><![CDATA[A problem with a channel named #x²]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=45895#p45895"><![CDATA[
<blockquote class="uncited"><div>This particular script doesn't create seperate data files for each channel it stores the joins all in one file as it does for kicks but it copies the originals to a temp file, deletes the original, alters the data as needed and then moves it all back to a permanent file and this is where the channel name(s) get screwed up. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"></div></blockquote><blockquote class="uncited"><div>if you intent to use channames as filenames <strong class="text-strong">next time</strong>,...</div></blockquote>reading rulez <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=2382">De Kus</a> — Fri Jan 28, 2005 11:11 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Alchera]]></name></author>
		<updated>2005-01-27T19:10:54-04:00</updated>

		<published>2005-01-27T19:10:54-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=45867#p45867</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=45867#p45867"/>
		<title type="html"><![CDATA[A problem with a channel named #x²]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=45867#p45867"><![CDATA[
<blockquote class="uncited"><div>if you intent to use channames as filenames next time, you should phrase the channel name with something like:<div class="codebox"><p>Code: </p><pre><code>set chanfile [string trim $chan "\\/:*?"&lt;&gt;|"]</code></pre></div>you can expand the list as neccessary to erase all trouble making characters <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile">. These file name will still be unique as long as you are not in #x and #x² at the same time <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy">.</div></blockquote>This particular script doesn't create seperate data files for each channel it stores the joins all in one file as it does for kicks but it copies the originals to a temp file, deletes the original, alters the data as needed and then moves it all back to a permanent file and this is where the channel name(s) get screwed up. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br>***<strong class="text-strong">Edited</strong>***<br>You can get the full version of dcounter from <a href="http://www.ballarat.us/downloads/dcounter.tcl" class="postlink">here</a> if you want to look at it in its' entirety.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3646">Alchera</a> — Thu Jan 27, 2005 7:10 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[awyeah]]></name></author>
		<updated>2005-01-27T07:40:13-04:00</updated>

		<published>2005-01-27T07:40:13-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=45861#p45861</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=45861#p45861"/>
		<title type="html"><![CDATA[A problem with a channel named #x²]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=45861#p45861"><![CDATA[
Yeew are seckzi De Kus :p I mean the avatar!<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4875">awyeah</a> — Thu Jan 27, 2005 7:40 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[De Kus]]></name></author>
		<updated>2005-01-27T06:35:51-04:00</updated>

		<published>2005-01-27T06:35:51-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=45860#p45860</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=45860#p45860"/>
		<title type="html"><![CDATA[A problem with a channel named #x²]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=45860#p45860"><![CDATA[
if you intent to use channames as filenames next time, you should phrase the channel name with something like:<div class="codebox"><p>Code: </p><pre><code>set chanfile [string trim $chan "\\/:*?\"&lt;&gt;|"]</code></pre></div>you can expand the list as neccessary to erase all trouble making characters <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile">. These file name will still be unique as long as you are not in #x and #x² at the same time <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy">.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2382">De Kus</a> — Thu Jan 27, 2005 6:35 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Alchera]]></name></author>
		<updated>2005-01-27T06:01:54-04:00</updated>

		<published>2005-01-27T06:01:54-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=45859#p45859</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=45859#p45859"/>
		<title type="html"><![CDATA[A problem with a channel named #x²]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=45859#p45859"><![CDATA[
Thanks, you just saved me a lot of bother. LOL<br><br>I've been busy with two scripts of mine (one a bit complex and the other dealing with regexp and consonant nicks) past few days and I've had little time for much else. <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=3646">Alchera</a> — Thu Jan 27, 2005 6:01 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[awyeah]]></name></author>
		<updated>2005-01-27T05:49:16-04:00</updated>

		<published>2005-01-27T05:49:16-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=45858#p45858</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=45858#p45858"/>
		<title type="html"><![CDATA[A problem with a channel named #x²]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=45858#p45858"><![CDATA[
Okay then use this: (for kick only)<br><div class="codebox"><p>Code: </p><pre><code>### KICK COUNTER INTIALIZATION #### In what file do you want the kicks to be stored?set kickno "kicknum.dat"if {![file exists $kickno]} { putlog "KICK COUNTER:\002 $kickno \002file \002does not exist\002, *creating file*: \002$kickno\002" set file [open $kickno "w"]; puts $file 0; close $file}proc kick:counter {nick uhost handle chan victim arg} { global botnick kickno  if {[string equal -nocase $victim $botnick]} { return 0 }  if {[isbotnick $nick]} {  if {![file exists $kickno]} {   putlog "KICK COUNTER: $kickno file does not exist, creating file $kickno."   set file [open $kickno w]   puts $file 0   close $file   }   set file [open $kickno r]   set currentkicks [gets $file]   close $file   set file [open $kickno w]   puts $file [expr $currentkicks + 1]   close $file   } return 0}#To read the total number kicks you can use these:#Set the variable to global in the procglobal kickno#Open the file, read it and closeset file [open $kickno r]set currentkicks [gets $file]close $file#Total kicks stored in the fileset totalkicks [expr $currentkicks]</code></pre></div>You can do the same for join by storing number of joins in another file, by replacing bind kick with bind join and modifying a bit here and there. You can also store both of them in the same file and retrieve them via lindex.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4875">awyeah</a> — Thu Jan 27, 2005 5:49 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Alchera]]></name></author>
		<updated>2005-01-27T03:44:31-04:00</updated>

		<published>2005-01-27T03:44:31-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=45850#p45850</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=45850#p45850"/>
		<title type="html"><![CDATA[A problem with a channel named #x²]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=45850#p45850"><![CDATA[
<blockquote class="uncited"><div>Why do you need a temp file? Just write no of kicks and joins into a file and overwrite it each time, that is pretty simple.</div></blockquote>Ummm .... That's because I didn't write it? <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_lol.gif" width="15" height="15" alt=":lol:" title="Laughing"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3646">Alchera</a> — Thu Jan 27, 2005 3:44 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[awyeah]]></name></author>
		<updated>2005-01-27T02:58:01-04:00</updated>

		<published>2005-01-27T02:58:01-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=45847#p45847</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=45847#p45847"/>
		<title type="html"><![CDATA[A problem with a channel named #x²]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=45847#p45847"><![CDATA[
Why do you need a temp file? Just write no of kicks and joins into a file and overwrite it each time, that is pretty simple.<br><br>You can use 1 file for both the kick and join numbers, or you can use 2 files, meaning seperate for each. Alternatively you can set an arrays to incr for the kick and join seperately, for bind join and bind kick, and it wouldn't reset even if the bot restarts. <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=4875">awyeah</a> — Thu Jan 27, 2005 2:58 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Alchera]]></name></author>
		<updated>2005-01-27T01:01:48-04:00</updated>

		<published>2005-01-27T01:01:48-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=45843#p45843</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=45843#p45843"/>
		<title type="html"><![CDATA[A problem with a channel named #x²]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=45843#p45843"><![CDATA[
Thanks for the response awyeah <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br>The code is a little hard to fathom but it's the only one I've yet stumbled across that has an option to set multiple channels that you don't want to save information for. It simply notifies on entry the count and records kicks which is stored in 2 files (one for joins and one for kicks). I think the problem with the unusual channel names comes about because a temporary file is written, the original deleted, and the temp file is moved back.<div class="codebox"><p>Code: </p><pre><code>exec rm -f $dcounter(joinfile) ; exec mv $dcounter(tmpfile) $dcounter(joinfile)</code></pre></div>The script hase proved popular with the channel founders I've loaned bots to because of the join count and kick counts:<blockquote class="uncited"><div> Almy was the 5191st person to get kicked from #Ballarat<br>Magoo- You're the 4778th person to join #absar.</div></blockquote>So, if you've got something along those lines I'll gladly use it. Just give me the link to it. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3646">Alchera</a> — Thu Jan 27, 2005 1:01 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[awyeah]]></name></author>
		<updated>2005-01-26T21:23:34-04:00</updated>

		<published>2005-01-26T21:23:34-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=45842#p45842</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=45842#p45842"/>
		<title type="html"><![CDATA[A problem with a channel named #x²]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=45842#p45842"><![CDATA[
I would suggest the file name of the kick/join counter files not to be the channel name, x² which can cause problems. Secondly I see this script is very messy and long if you want I can give you my kick counter script just a few lines of code. (writes to a file on bind kick, and reads it when ever you want, e.g. in a kick msg showing the total no of kicks etc)<br><br>And if you have the kick counter, you can simply do a duplicate of it for join, by changing bind kick to bind join and changing necessary variables.<br><br>If you want a channel stat script which shows on the channel how many joins, parts, kicks, mode changes, topic changes, ops, voices were in the channel (seperate for each channel) I have the script for you! Let me know if you need it, I download it from somewhere I remember. <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=4875">awyeah</a> — Wed Jan 26, 2005 9:23 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Alchera]]></name></author>
		<updated>2005-01-24T09:29:26-04:00</updated>

		<published>2005-01-24T09:29:26-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=45785#p45785</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=45785#p45785"/>
		<title type="html"><![CDATA[A problem with a channel named #x²]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=45785#p45785"><![CDATA[
This one really defeats me. lol<br><br>I am using a channel join/kick counter in a bot I have loaned and the script is having dramas with the channel name. I've tried a few things and still cannot resolve the problem.<div class="codebox"><p>Code: </p><pre><code>proc dcounter_join {nick host hand chan} {global dcounterset chan [string tolower $chan] ; set counter 0if {[isvalidchan $chan] == 1} {return 0}if {[isbotnick $nick] || [matchattr $hand b]} {return}set fx [open $dcounter(joinfile) r] ; set fx2 [open $dcounter(tmpfile) w]while {![eof $fx]} {set tmp [gets $fx]if {$tmp != ""} {if {[lindex $tmp 0] == "$chan"} {set counter [expr [lindex $tmp 1] +1] ; puts $fx2 "$chan $counter"} else {puts $fx2 $tmp}}}if {$counter == 0} {set counter 1 ; puts $fx2 "$chan $counter"}close $fx ; close $fx2exec rm -f $dcounter(joinfile) ; exec mv $dcounter(tmpfile) $dcounter(joinfile)if {$dcounter(njoin) == 1} {puthelp "NOTICE $nick :Vous êtes la [convert $counter] personne à joindre $chan."}return 0}proc dcounter_kick {nick host hand chan target reason} {global dcounterset chan [string tolower $chan] ; set counter 0if {[isvalidchan $chan] == 1} {return 0}set fx [open $dcounter(kickfile) r] ; set fx2 [open $dcounter(tmpfile) w]while {![eof $fx]} {set tmp [gets $fx]if {$tmp != ""} {if {[lindex $tmp 0] == "$chan"} {set counter [expr [lindex $tmp 1] +1] ; puts $fx2 "$chan $counter"} else {puts $fx2 $tmp}}}if {$counter == 0} {set counter 1 ; puts $fx2 "$chan $counter"}close $fx ; close $fx2exec rm -f $dcounter(kickfile) ; exec mv $dcounter(tmpfile) $dcounter(kickfile)if {$dcounter(nkick) == 1} {puthelp "NOTICE $target :Vous êtes la [convert $counter] personne kicker de $chan"}if {$dcounter(nonotice) == 1} {puthelp "NOTICE @$chan :$target est la [convert $counter] personne à être kicker de $chan"}return 0}proc dcounter_see {nick host hand chan text} {global dcounterset chan [string tolower $chan] ; set joins 0 ; set kicks 0if {[isvalidchan $chan] == 1} {puthelp "NOTICE $nick :I don't save join/kick stats for this channel" ; return 0}set fx1 [open $dcounter(joinfile) r] ; set fx2 [open $dcounter(kickfile) r]while {![eof $fx1]} {set tmp [gets $fx1]if {$chan == "[lindex $tmp 0]"} {set joins [lindex $tmp 1] ; break}}while {![eof $fx2]} {set tmp [gets $fx2]if {$chan == "[lindex $tmp 0]"} {set kicks [lindex $tmp 1] ; break}}puthelp "NOTICE $nick :$chan have $joins joins and $kicks kicks"return 0}</code></pre></div>It's not a new script (2 yrs old) and the author cannot be contacted. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_sad.gif" width="15" height="15" alt=":(" title="Sad"><br><br>The problem is the saved join/kick data files have never ending lines of #x? 1 (in this particular case).<br><br>Except for channels with unusual characters in their name this script works perfectly for any channel a bot is in.<br><br>Any assistance will be greatly appreciated. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br>*Edited*<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3646">Alchera</a> — Mon Jan 24, 2005 9:29 am</p><hr />
]]></content>
	</entry>
	</feed>
