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

	<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>2002-10-26T06:08:37-04:00</updated>

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

		<entry>
		<author><name><![CDATA[egghead]]></name></author>
		<updated>2002-10-26T06:08:37-04:00</updated>

		<published>2002-10-26T06:08:37-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=12386#p12386</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=12386#p12386"/>
		<title type="html"><![CDATA[counting users channel access]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=12386#p12386"><![CDATA[
<blockquote class="uncited"><div>ok thanks, i have this working to an extent now. What i am now trying to do is list the handles of people who have access in a particular channel. So someone types .userlist and gets<br>[snip]<br>Now the problem ive encountered is that if someone has an +n flag for a channel, they appear to also be given +om as well, so when i do a .userlist for a channel i own, i get this:<br><blockquote class="uncited"><div>-E- OWNER - Simon<br>-E- MANAGER - Simon<br>-E- OP - Simon</div></blockquote>because its going through each flag. Is there any way i could overcome this?<br><br>thanks<br>Simon</div></blockquote>Simon, it seems there are several ways to do it. An alternative approach is to iterate on the list of users and within that iteration iterate on the flags. When a matching flag is found, the innermost iteration (i.e. looking for a matching flag) is stopped.<br><br>Example:<div class="codebox"><p>Code: </p><pre><code>   # the flaglist in order of importance!   set flaglist {n m o f v}   # review all users in the userlist   foreach user [userlist] {      foreach flag $flaglist {         # check if user has global or channel access.          if {[matchattr $user $flag $chan]} {             lappend userswithflag($flag) $user            break         }      }   }</code></pre></div>A skeleton demo is <a href="http://members.fortunecity.com/eggheadtcl/chanxs.tcl.txt" class="postlink">http://members.fortunecity.com/eggheadt ... xs.tcl.txt</a><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=282">egghead</a> — Sat Oct 26, 2002 6:08 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[simonbell]]></name></author>
		<updated>2002-10-25T20:34:41-04:00</updated>

		<published>2002-10-25T20:34:41-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=12378#p12378</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=12378#p12378"/>
		<title type="html"><![CDATA[counting users channel access]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=12378#p12378"><![CDATA[
This does not seem to work:<br><blockquote class="uncited"><div>proc pub_olist {nick uhost hand chan text} {<br> foreach ulist [userlist] {<br>  if { [matchattr $ulist -|+o-mn $chan] == 1 } {<br>   putnotc $nick "OP - $ulist"<br>   }<br> }<br>}</div></blockquote>typing .olist on a user with the flags +aom on a channel returns<br><blockquote class="uncited"><div>-E- OP - sajjad</div></blockquote>Simon<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=1696">simonbell</a> — Fri Oct 25, 2002 8:34 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ppslim]]></name></author>
		<updated>2002-10-25T05:06:12-04:00</updated>

		<published>2002-10-25T05:06:12-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=12349#p12349</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=12349#p12349"/>
		<title type="html"><![CDATA[counting users channel access]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=12349#p12349"><![CDATA[
This is simple enough, just expand your matching system. IE, don't simply check for one flag.<br><br>If you want to list +o users, but not +m or +n, somthing like this would work<br><br>matchattr hand "+o-nm" chan<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2">ppslim</a> — Fri Oct 25, 2002 5:06 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[simonbell]]></name></author>
		<updated>2002-10-24T19:39:33-04:00</updated>

		<published>2002-10-24T19:39:33-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=12339#p12339</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=12339#p12339"/>
		<title type="html"><![CDATA[counting users channel access]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=12339#p12339"><![CDATA[
ok thanks, i have this working to an extent now. What i am now trying to do is list the handles of people who have access in a particular channel. So someone types .userlist and gets<br><blockquote class="uncited"><div>OWNER - bob<br>COOWNER - ian<br>MANAGER - spud<br>OP<br>HALFOP<br>VOICE</div></blockquote>etc.<br><br>I know the flag for each level and so wrote this script:<br><blockquote class="uncited"><div>proc pub_userlist {nick uhost hand chan text} {<br> foreach ulist [userlist] {<br>  if { [matchattr $ulist -|n $chan] == 1 } {<br>   putnotc $nick "OWNER - $ulist"<br>   }<br>  if { [matchattr $ulist -|m $chan] == 1 } {<br>   putnotc $nick "MANAGER - $ulist"<br>   }<br>  if { [matchattr $ulist -|o $chan] == 1 } {<br>   putnotc $nick "OP - $ulist"<br>   }<br>  if { [matchattr $ulist -|l $chan] == 1 } {<br>   putnotc $nick "HALFOP - $ulist"<br>   }<br>  if { [matchattr $ulist -|v $chan] == 1 } {<br>   putnotc $nick "VOICE - $ulist"<br>   }<br> }<br>}</div></blockquote>Now the problem ive encountered is that if someone has an +n flag for a channel, they appear to also be given +om as well, so when i do a .userlist for a channel i own, i get this:<br><blockquote class="uncited"><div>-E- OWNER - Simon<br>-E- MANAGER - Simon<br>-E- OP - Simon</div></blockquote>because its going through each flag. Is there any way i could overcome this?<br><br>thanks<br>Simon<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=1696">simonbell</a> — Thu Oct 24, 2002 7:39 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ppslim]]></name></author>
		<updated>2002-10-24T18:09:41-04:00</updated>

		<published>2002-10-24T18:09:41-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=12337#p12337</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=12337#p12337"/>
		<title type="html"><![CDATA[counting users channel access]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=12337#p12337"><![CDATA[
This snippet of code will could how many chans the user has any flag in<br><br>Use it like:<br>countchanflags &lt;hand&gt; &lt;flag&gt;<br>It will return the number of chans, or * for no such hand (as many functions in eggdrop does.<br><div class="codebox"><p>Code: </p><pre><code>proc countchanflags {hand flags} {  if {![validuser $hand]} { return * }  set i 0  foreach a [channels] {    if {[matchattr $chan "|${flags}" $a]} { incr i }  }  return $i}</code></pre></div>Example.<br>countchanflags ppslim n<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2">ppslim</a> — Thu Oct 24, 2002 6:09 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[simonbell]]></name></author>
		<updated>2002-10-24T15:02:13-04:00</updated>

		<published>2002-10-24T15:02:13-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=12316#p12316</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=12316#p12316"/>
		<title type="html"><![CDATA[counting users channel access]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=12316#p12316"><![CDATA[
Hi<br><br>Is it possible to count how many channels a specific handle has +n in? And if so, how can it be done?<br><br>thanks<br>Simon<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=1696">simonbell</a> — Thu Oct 24, 2002 3:02 pm</p><hr />
]]></content>
	</entry>
	</feed>
