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

	<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-01-03T09:42:00-04:00</updated>

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

		<entry>
		<author><name><![CDATA[stdragon]]></name></author>
		<updated>2002-01-03T09:42:00-04:00</updated>

		<published>2002-01-03T09:42:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=3400#p3400</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=3400#p3400"/>
		<title type="html"><![CDATA[Replacing flags with access level]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=3400#p3400"><![CDATA[
By the way, let me know if the script actually works, heh. I still haven't tested it.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8">stdragon</a> — Thu Jan 03, 2002 9:42 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[stdragon]]></name></author>
		<updated>2002-01-03T09:39:00-04:00</updated>

		<published>2002-01-03T09:39:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=3399#p3399</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=3399#p3399"/>
		<title type="html"><![CDATA[Replacing flags with access level]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=3399#p3399"><![CDATA[
<blockquote class="uncited"><div>On 2002-01-02 22:14, Stafford wrote:<blockquote class="uncited"><div><br>Yes, here's an idea.. you asked for example code and I gave you some. I don't really want to do all the work for you!<br></div></blockquote><br><br>hehe, Ok, don't take it too hard. Sometimes, humans just ask a little too much <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"> No hard feelings. Thanks for the sample code anyway.</div></blockquote>I'm sorry, I wasn't trying to sound mad or anything, more like funny. I guess my sense of humor isn't the greatest <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=";)" title="Wink"><br><br>Err.. on the previous topic though, there really isn't that much work left for you to do, if you are interested in pursuing this script.<br><br>Add a check to see if the script is already loaded on .rehash, so that it won't re-bind twice and destroy everything.<div class="codebox"><p>Code: </p><pre><code>if {![info exists levels_loaded]} {  set levels_loaded yup  foreach ... blah blah.. all the non-config, non-proc code goes here}</code></pre></div>Then, you basically copy all the dcc stuff and change "dcc" to "msg" for message commands (and change the args to msg_check). And "pub" for public commands.. etc. All the hard work is already done <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br>Oh and you would have to add a check in the other procs to see if the person is a valid user or not. Maybe a "default_level" variable would be good to add, so that if the level isn't found, that is what gets used.<br><br>And finally.. I forget if this is already in there or not.. but there should be "catch {}" around the $old_proc call, so that if there's a tcl error, the user doesn't keep the +n flag.<br><br>And finallly, since "owner" is a read-only variable, there will be some things that you just cannot do with this level checking script. You can't give someone temporary perm-owner status, except maybe by doing some tricky host manipulation stuff, but I don't think that would work, because it wouldn't take effect until the next time the command is used.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8">stdragon</a> — Thu Jan 03, 2002 9:39 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[stdragon]]></name></author>
		<updated>2002-01-03T09:31:00-04:00</updated>

		<published>2002-01-03T09:31:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=3398#p3398</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=3398#p3398"/>
		<title type="html"><![CDATA[Replacing flags with access level]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=3398#p3398"><![CDATA[
<blockquote class="uncited"><div>On 2002-01-02 22:13, ppslim wrote:<br>Wouldn't it be better to be working with the FILT bind anyway.</div></blockquote>If it were only for dcc commands, then maybe yes, but he said msg commands, too, so I used a more general approach. You just need to write a msg_check function and copy the re-bind code, basically. Same for public commands.<br><br>Another problem with FILT is that since the dcc bind table checks for partial commands (i.e. ".+ch" matches ".+chan") you would have to do some fancy matching to catch them all.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8">stdragon</a> — Thu Jan 03, 2002 9:31 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2002-01-03T01:14:00-04:00</updated>

		<published>2002-01-03T01:14:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=3385#p3385</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=3385#p3385"/>
		<title type="html"><![CDATA[Replacing flags with access level]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=3385#p3385"><![CDATA[
<blockquote class="uncited"><div>Yes, here's an idea.. you asked for example code and I gave you some. I don't really want to do all the work for you!</div></blockquote>hehe, Ok, don't take it too hard. Sometimes, humans just ask a little too much <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":smile:" title="Smile"> No hard feelings. Thanks for the sample code anyway.<p>Statistics: Posted by Guest — Thu Jan 03, 2002 1:14 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ppslim]]></name></author>
		<updated>2002-01-03T01:13:00-04:00</updated>

		<published>2002-01-03T01:13:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=3384#p3384</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=3384#p3384"/>
		<title type="html"><![CDATA[Replacing flags with access level]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=3384#p3384"><![CDATA[
Wouldn't it be better to be working with the FILT bind anyway.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2">ppslim</a> — Thu Jan 03, 2002 1:13 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[stdragon]]></name></author>
		<updated>2002-01-03T01:02:00-04:00</updated>

		<published>2002-01-03T01:02:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=3383#p3383</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=3383#p3383"/>
		<title type="html"><![CDATA[Replacing flags with access level]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=3383#p3383"><![CDATA[
<blockquote class="uncited"><div>On 2002-01-02 21:38, Stafford wrote:<blockquote class="uncited"><div>On 2002-01-01 23:15, stdragon wrote:<br>Note, if you .rehash your bot after this script is loaded, everything will break.</div></blockquote>What does that means? Does it means that if I .rehash, everything I've set would be lost? In that case, is there anyway such </div></blockquote>It means that if you rehash, the commands will stop working.<br><blockquote class="uncited"><div>that let's make it more fancy. Let's take it such that $handle and access level are being written to a file. The file works just like userfile and channel file. It will save all details of the $handle, individual access in different channels etc. Any ideas?</div></blockquote>Yes, here's an idea.. you asked for example code and I gave you some. I don't really want to do all the work for you!<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8">stdragon</a> — Thu Jan 03, 2002 1:02 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2002-01-03T00:38:00-04:00</updated>

		<published>2002-01-03T00:38:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=3382#p3382</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=3382#p3382"/>
		<title type="html"><![CDATA[Replacing flags with access level]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=3382#p3382"><![CDATA[
<blockquote class="uncited"><div>On 2002-01-01 23:15, stdragon wrote:<br>Note, if you .rehash your bot after this script is loaded, everything will break.</div></blockquote>What does that means? Does it means that if I .rehash, everything I've set would be lost? In that case, is there anyway such that let's make it more fancy. Let's take it such that $handle and access level are being written to a file. The file works just like userfile and channel file. It will save all details of the $handle, individual access in different channels etc. Any ideas?<p>Statistics: Posted by Guest — Thu Jan 03, 2002 12:38 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[stdragon]]></name></author>
		<updated>2002-01-02T02:15:00-04:00</updated>

		<published>2002-01-02T02:15:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=3347#p3347</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=3347#p3347"/>
		<title type="html"><![CDATA[Replacing flags with access level]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=3347#p3347"><![CDATA[
Here's a quick example. I didn't test it, so it might not work, but maybe it will give you an idea of how I would do it. Note, if you .rehash your bot after this script is loaded, everything will break.<br><br>Do ".level someuser" to see that person's level, or ".level someuser 75" to change that person's level (to 75).<br><div class="codebox"><p>Code: </p><pre><code># the initial person to give level 100 toset super_user stdragon# put the names of dcc commands here# and set the required level for itset dcc_levels(voice) 5set dcc_levels(devoice) 5set dcc_levels(op) 10set dcc_levels(deop) 10# beginning of codesetuser $super_user XTRA level 100foreach cmd [array names $dcc_levels] {  set old [bind dcc - $cmd]  set old_procs($cmd) $old  bind dcc - $cmd [list dcc_check $cmd]}proc dcc_check {cmd hand idx text} {  global dcc_levels old_procs  set level [getuser $hand XTRA level]  if {$level &lt; $dcc_levels($cmd)} {    putdcc $idx "Sorry, your level ($level) is too low to use this command ($dcc_levels($cmd))"    return 0  }  set flags [chattr $hand]  chattr $hand +n  set retval [$old_procs($cmd) $hand $idx $text]  chattr $hand -abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ  chattr $hand +$flags  return $retval}bind dcc - level dcc_levelproc dcc_level {hand idx text} {  set level [getuser $hand XTRA level]  if {$level &lt; 100} {return 0}  set parts [split $text]  set user [lindex $parts 0]  if {[llength $parts] &gt; 1} {    set level [lindex $parts 1]    setuser $user XTRA level $level  } else {    set level [getuser $user XTRA level]    putdcc "$user's level is $level"  }  return 0}</code></pre></div>&lt;font size=-1&gt;[ This Message was edited by: stdragon on 2002-01-01 23:21 ]&lt;/font&gt;<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8">stdragon</a> — Wed Jan 02, 2002 2:15 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ppslim]]></name></author>
		<updated>2002-01-02T00:58:00-04:00</updated>

		<published>2002-01-02T00:58:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=3344#p3344</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=3344#p3344"/>
		<title type="html"><![CDATA[Replacing flags with access level]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=3344#p3344"><![CDATA[
Examples do not come small, especialy in this situation.<br><br>As stated, each time a command is tytped, you would have to use a script to check the access level of a user, check if that command is available to that access level.<br><br>It would be more sensible to learn how to use eggdrops flag system.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2">ppslim</a> — Wed Jan 02, 2002 12:58 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2002-01-02T00:28:00-04:00</updated>

		<published>2002-01-02T00:28:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=3343#p3343</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=3343#p3343"/>
		<title type="html"><![CDATA[Replacing flags with access level]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=3343#p3343"><![CDATA[
Hmm, could you show me an example of the code?<p>Statistics: Posted by Guest — Wed Jan 02, 2002 12:28 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[stdragon]]></name></author>
		<updated>2001-12-31T14:11:00-04:00</updated>

		<published>2001-12-31T14:11:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=3308#p3308</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=3308#p3308"/>
		<title type="html"><![CDATA[Replacing flags with access level]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=3308#p3308"><![CDATA[
Sure, write a tcl that gives everyone the same flags and uses setuser xtra to store an access level. Then rebind all the commands to check for the proper access level.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8">stdragon</a> — Mon Dec 31, 2001 2:11 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2001-12-31T12:23:00-04:00</updated>

		<published>2001-12-31T12:23:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=3307#p3307</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=3307#p3307"/>
		<title type="html"><![CDATA[Replacing flags with access level]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=3307#p3307"><![CDATA[
Hi, I've got this here. Instead of .chattr $handle +flags, is there anyway I can set a system of access level such that it ranges from 10 to 50? Example, if access level 10 is given, it can be used to perform certain specific commands (ie: like some msg commands written in TCL)<br><br>Thanks<br><br>&lt;font size=-1&gt;[ This Message was edited by: Stafford on 2001-12-31 09:24 ]&lt;/font&gt;<p>Statistics: Posted by Guest — Mon Dec 31, 2001 12:23 pm</p><hr />
]]></content>
	</entry>
	</feed>
