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

	<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-04-23T11:51:25-04:00</updated>

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

		<entry>
		<author><name><![CDATA[De Kus]]></name></author>
		<updated>2005-04-23T11:51:25-04:00</updated>

		<published>2005-04-23T11:51:25-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=48468#p48468</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=48468#p48468"/>
		<title type="html"><![CDATA[limiting command user per users/user]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=48468#p48468"><![CDATA[
yeah, but im too lazy to rewrite it. if the above code works without bugs it would be a miracle anyway, had no time to debug yet, but if the user doesnt complain so far... maybe it really is one <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy">.<br><br>in my list version, it would be fasted to open the file in a texteditor and search for the handle ^-^.<br><br>[quote="difoo"but how would it check for dates..? as in num/week. can't imagine this is possible.[/quote]<br>the solution would be the same: saving a 7 elemented, space sperated list with values ^^. its no mattter if it is within an XTRA field or an element of an higher list levell.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2382">De Kus</a> — Sat Apr 23, 2005 11:51 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[greenbear]]></name></author>
		<updated>2005-04-22T19:09:29-04:00</updated>

		<published>2005-04-22T19:09:29-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=48445#p48445</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=48445#p48445"/>
		<title type="html"><![CDATA[limiting command user per users/user]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=48445#p48445"><![CDATA[
ya, i like the idea of a daily max limit better too.<br><br>another benefit with using xtra fields is that you can show the info on whois/.match real easy.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=24">greenbear</a> — Fri Apr 22, 2005 7:09 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[De Kus]]></name></author>
		<updated>2005-04-22T11:11:38-04:00</updated>

		<published>2005-04-22T11:11:38-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=48434#p48434</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=48434#p48434"/>
		<title type="html"><![CDATA[limiting command user per users/user]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=48434#p48434"><![CDATA[
the problem of resetting resetting it once week, you would have to wait up to a full week before you can post a news again, once you hit the max, on the other side, you can post 10 news on sunday and 10 on monday, maybe thats a bit much, too <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_biggrin.gif" width="15" height="15" alt=":D" title="Very Happy">. So checking once a day and holding 7 values is more accurate.<br>But you are right, you could have saved it in an XTRA info line instead of a list, but wouldnt have saved much code (only the lsearch and the bind for nkch).<br><br>PS: your time bind triggers on each 1st of a month which is a monday, so will have only a few hits in a year <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> — Fri Apr 22, 2005 11:11 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[greenbear]]></name></author>
		<updated>2005-04-22T18:46:41-04:00</updated>

		<published>2005-04-21T11:41:44-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=48413#p48413</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=48413#p48413"/>
		<title type="html"><![CDATA[limiting command user per users/user]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=48413#p48413"><![CDATA[
I was mostly making suggestions to De Kus' script<br><br>But I suppose something like this will work if you want to reset something once a week<div class="codebox"><p>Code: </p><pre><code>bind time - "00 00 *" whatdayisitproc whatdayisit {mi hr da mo yr} { if {[strftime %a]=="Mon"} {  foreach u [userlist -b] {   setuser $u XTRA count 0  } }}</code></pre></div>Edit: fixed the typo mentioned by De Kus.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=24">greenbear</a> — Thu Apr 21, 2005 11:41 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[difoo]]></name></author>
		<updated>2005-04-21T11:12:45-04:00</updated>

		<published>2005-04-21T11:12:45-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=48412#p48412</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=48412#p48412"/>
		<title type="html"><![CDATA[limiting command user per users/user]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=48412#p48412"><![CDATA[
hi,<br><br>thanks for the reply, much appreciated<br><br>i'll try this when i get home from work in a few, thanks!<br><blockquote class="uncited"><div>you could save the info to the XTRA field in the userlist, that way you get away with alot less code. (assuming only known users can execute commands.)</div></blockquote>but how would it check for dates..? as in num/week. can't imagine this is possible.<br><br>greets difoo<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5153">difoo</a> — Thu Apr 21, 2005 11:12 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[greenbear]]></name></author>
		<updated>2005-04-21T09:36:33-04:00</updated>

		<published>2005-04-21T09:36:33-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=48404#p48404</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=48404#p48404"/>
		<title type="html"><![CDATA[limiting command user per users/user]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=48404#p48404"><![CDATA[
you could save the info to the XTRA field in the userlist, that way you get away with alot less code. (assuming only known users can execute commands.)<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=24">greenbear</a> — Thu Apr 21, 2005 9:36 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[De Kus]]></name></author>
		<updated>2005-04-21T07:30:36-04:00</updated>

		<published>2005-04-21T07:30:36-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=48397#p48397</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=48397#p48397"/>
		<title type="html"><![CDATA[limiting command user per users/user]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=48397#p48397"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>set yourfloodflag "o|o"set yourfloodfile "news.txt"if { [file exists $yourfloodfile] } {set fd [open $yourfloodfile r]gets $fd yourfloodclose $fd} else {close [open $yourfloodfile w]}bind evnt - save yourfloodsavebind time - "00 00 *" yourflooddaybind mkch - "*" yourfloodnkchproc yourproc { ... } {...if { $hand == "*" &amp;&amp; ![matchattr $hand $::yourfloodflag $chan] } {if { [set line [lsearch -glob $::yourflood "all *"]] == -1 } {lappend ::yourflood [list all 1 0 0 0 0 0 0]} elseif { [expr [lindex [set entry [lindex $::yourflood $line]] 1] + [lindex $entry 2] + [lindex $entry 3] + [lindex $entry 4] + [lindex $entry 5] + [lindex $entry 6] + [lindex $entry 7]] &gt;= 21 } {puthelp "NOTICE $nick :Your weekly limit has been reached!"return 0} else {set ::yourflood [lreplace $::yourflood $line $line [lreplace $entry 1 1 [expr [lindex $entry 1] + 1]]}} else {if { [set line [lsearch -glob $::yourflood "$hand *"]] == -1 } {lappend ::yourflood [list $hand 1 0 0 0 0 0 0]} elseif { [expr [lindex [set entry [lindex $::yourflood $line]] 1] + [lindex $entry 2] + [lindex $entry 3] + [lindex $entry 4] + [lindex $entry 5] + [lindex $entry 6] + [lindex $entry 7]] &gt;= 11 } {puthelp "NOTICE $nick :Your weekly limit has been reached!"return 0} else {set ::yourflood [lreplace $::yourflood $line $line [lreplace $entry 1 1 [expr [lindex $entry 1] + 1]]}}...}proc yourfloodday {min h d m y} {global yourfloodset i 0foreach line $yourflood {set linsert $line 1 "0"set line [lreplace $line e e]set yourflood [lreplace $yourflood $i $i $line]incr i}}proc yourfloodnkch {old new} {if { [set line [lsearch -glob $::yourflood "$old *"]] != -1 } {set ::yourflood [lreplace $::yourflood $line $line [lreplace [lindex $::yourflood $line] 0 0 [split $new]]]}return 0}proc yourfloodsave {type} {set fd [open $::yourfloodfile w]puts -nonewline $::yourfloodclose $fdreturn 0}</code></pre></div>just wrote the idea down, haven't had the time to debug it yet.<br>you maybe replace any varnames or proc names, but replace them ALL then <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_razz.gif" width="15" height="15" alt=":P" title="Razz">.<br>the part between ... should be inserted just before the news are actually created. If you add "yourflood" to the global var list, remove the leading :: from it. The flood should be saved for each day in a week and reset daily. The save to file is done when a save is initiated from the bot (so just before it rehashes, restarts, quits) and load it after it again.<br><br>NOTE: the script within ... assumes the nickname is stored in "nick" and the handle is stored in "hand", change it if your script uses diffrent var names! You should not have a user called "all" with the flag (case should matter).<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2382">De Kus</a> — Thu Apr 21, 2005 7:30 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[difoo]]></name></author>
		<updated>2005-04-21T01:56:44-04:00</updated>

		<published>2005-04-21T01:56:44-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=48385#p48385</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=48385#p48385"/>
		<title type="html"><![CDATA[limiting command user per users/user]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=48385#p48385"><![CDATA[
hi,<br><br>i'm looking for a script that limits the usage for a specific proc per users &amp; user.<br>i don't want 300 news added a week and would like to limit it to max 20 for all users in the userfile and max 10 for specific users. i can't think of a way how to do it myself. the limit should still work when the bot rehashes/restarts/dies..so i guess it has to be saved in a file how often each user has issued the command? <br><br>i want to limit the usage of !news &lt;news here&gt; to 20 a week, and the same command for &lt;user-specific&gt; to 10 a week. any help would be greatly appreciated.<br><br>greets difoo<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5153">difoo</a> — Thu Apr 21, 2005 1:56 am</p><hr />
]]></content>
	</entry>
	</feed>
