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

	<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>2003-11-06T19:21:19-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2003-11-06T19:21:19-04:00</updated>

		<published>2003-11-06T19:21:19-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=29670#p29670</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=29670#p29670"/>
		<title type="html"><![CDATA[usercount op/voice-count script.]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=29670#p29670"><![CDATA[
Thanks a lot, now it works just fine. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><p>Statistics: Posted by Guest — Thu Nov 06, 2003 7:21 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2003-11-06T18:40:08-04:00</updated>

		<published>2003-11-06T18:40:08-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=29665#p29665</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=29665#p29665"/>
		<title type="html"><![CDATA[usercount op/voice-count script.]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=29665#p29665"><![CDATA[
<a href="http://tcl.tk/man/tcl8.4/TclCmd/Tcl.htm#M7" class="postlink">http://tcl.tk/man/tcl8.4/TclCmd/Tcl.htm#M7</a><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2878">user</a> — Thu Nov 06, 2003 6:40 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[De Kus]]></name></author>
		<updated>2003-11-06T18:30:45-04:00</updated>

		<published>2003-11-06T18:30:45-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=29663#p29663</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=29663#p29663"/>
		<title type="html"><![CDATA[usercount op/voice-count script.]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=29663#p29663"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>  foreach user [chanlist $chan] {    if {[isop $user $chan]} {      incr op    } elseif {[isvoice $user $chan]} {      incr voice    } else { incr normal }  }</code></pre></div>so it should work ^^<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2382">De Kus</a> — Thu Nov 06, 2003 6:30 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[egghead]]></name></author>
		<updated>2003-11-06T18:24:31-04:00</updated>

		<published>2003-11-06T18:24:31-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=29662#p29662</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=29662#p29662"/>
		<title type="html"><![CDATA[usercount op/voice-count script.]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=29662#p29662"><![CDATA[
<blockquote class="uncited"><div>[snip]<br>I have seen elseif been used in several other tcl-scripts and i don't understand why this wouldn't work. :/</div></blockquote>The location of the braces with respect to the elseif matters. Try following the example of the other tcl-scripts you have seen.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=282">egghead</a> — Thu Nov 06, 2003 6:24 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2003-11-06T18:05:00-04:00</updated>

		<published>2003-11-06T18:05:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=29661#p29661</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=29661#p29661"/>
		<title type="html"><![CDATA[usercount op/voice-count script.]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=29661#p29661"><![CDATA[
yes, I know. I figured out a bit of the code myself. This is how I did it:<br><div class="codebox"><p>Code: </p><pre><code>  foreach user [chanlist $chan] {    if {[isop $user $chan]} { incr op }    elseif {[isvoice $user $chan]} { incr voice }    else { incr normal }  }</code></pre></div>However this gives me this error:<br>[22:57:00] :adaieski: [22:57] Tcl error in script for 'timer36':<br>[22:57:00] :adaieski: [22:57] invalid command name "elseif"<br><br>I have seen elseif been used in several other tcl-scripts and i don't understand why this wouldn't work. :/<p>Statistics: Posted by Guest — Thu Nov 06, 2003 6:05 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[egghead]]></name></author>
		<updated>2003-11-06T17:49:07-04:00</updated>

		<published>2003-11-06T17:49:07-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=29660#p29660</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=29660#p29660"/>
		<title type="html"><![CDATA[usercount op/voice-count script.]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=29660#p29660"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code># number of users, operators and voicesset chanusers [chanlist $channel]set countusers [llength $chanusers]set operators 0set voices 0foreach user $chanusers {   if { [isop $user $channel] } { incr operators }   if { [isvoice $user $channel] } { incr voices }}</code></pre></div>Note that users can have @ *and* +v, so simply subtracting the number of @'s and +v's from the total number of users will not work.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=282">egghead</a> — Thu Nov 06, 2003 5:49 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2003-11-06T17:39:47-04:00</updated>

		<published>2003-11-06T17:39:47-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=29659#p29659</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=29659#p29659"/>
		<title type="html"><![CDATA[usercount op/voice-count script.]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=29659#p29659"><![CDATA[
yes, I understand that. but since i don't know TCL-scripting I need someone to do it for me, so this is more like a script request then a question. don't know your policy about that in here though..<br><br>you are welcome to suggest any script that is already using this code, if you know any.<p>Statistics: Posted by Guest — Thu Nov 06, 2003 5:39 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[egghead]]></name></author>
		<updated>2003-11-06T17:29:52-04:00</updated>

		<published>2003-11-06T17:29:52-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=29657#p29657</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=29657#p29657"/>
		<title type="html"><![CDATA[usercount op/voice-count script.]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=29657#p29657"><![CDATA[
<blockquote class="uncited"><div>chanlist &lt;channel&gt; [flags[&amp;chanflags]]<br>Description: flags are any global flags; the '&amp;' denotes to look for channel specific flags. Examples:<br>    n         (Global Owner)<br>    &amp;n        (Channel Owner)<br>    o&amp;m       (Global Op, Channel Master)<br>[snip]</div></blockquote>If you want to count ops and voiced users you can iterate over the list and perform [isop] and [isvoice] checks.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=282">egghead</a> — Thu Nov 06, 2003 5:29 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2003-11-06T17:22:24-04:00</updated>

		<published>2003-11-06T17:22:24-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=29656#p29656</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=29656#p29656"/>
		<title type="html"><![CDATA[usercount op/voice-count script.]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=29656#p29656"><![CDATA[
hi there.<br><br>I am trying to do a script that uses MySQL to insert the values of users/ops/voices/normal from a certain channel. Now i know absolutley nothing about TCL-scripting so i checked out a few scripts that used MySQL and got the MySQL part up and working. I asked in #egghelp @ EFNet for help with the usercount part. Someone gave me this:<br><div class="codebox"><p>Code: </p><pre><code>set total [llength [chanlist #adaieski]]set op [llength [chanlist #adaieski o]]set voice [llength [chanlist #adaieski v]]set normal [expr $total - $voice - $op]</code></pre></div>In the channel at the time there was 6 users, all opped. But the script returned a bit strange values:<br><br>total: 6 (that's right)<br>op: 1 (um, no, we were 6)<br>voice: 4 (ehh, no, no voices)<br>normal: 1 (yeah right)<br><br>now there can't be anything wrong with the MySQL code because I do a putcmdlog every time it updates and those values are the same as in the DB..<br><br>as i said, i don't know anything about TCL-scripting so if you know the answere please try to explain as much as possible.<br><br>and also, sorry about my bad english, I'm from sweden. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br>EDIT:<br><br>now the script updated the database again, now i got a little better results (using the same code):<br><br>total: 7<br>ops: 0<br>voice: 0<br>normal: 7<br><br>now there were 6 ops and 1 normal, still no voices.<p>Statistics: Posted by Guest — Thu Nov 06, 2003 5:22 pm</p><hr />
]]></content>
	</entry>
	</feed>
