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

	<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-07-08T15:47:13-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Weirdo]]></name></author>
		<updated>2003-07-08T15:47:13-04:00</updated>

		<published>2003-07-08T15:47:13-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=23206#p23206</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=23206#p23206"/>
		<title type="html"><![CDATA[Bit of logic help]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=23206#p23206"><![CDATA[
of course, lists, another something i must play with one day, thanks caesar <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br>and it works, must remember that one <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=1195">Weirdo</a> — Tue Jul 08, 2003 3:47 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2003-07-08T13:09:43-04:00</updated>

		<published>2003-07-08T13:09:43-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=23202#p23202</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=23202#p23202"/>
		<title type="html"><![CDATA[Bit of logic help]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=23202#p23202"><![CDATA[
Right before the foreach place something like: set chanlist "" and after or before the !list place this: lappend chanlist $chan then call the "chanlist" where you want.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=187">caesar</a> — Tue Jul 08, 2003 1:09 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Weirdo]]></name></author>
		<updated>2003-07-08T09:54:54-04:00</updated>

		<published>2003-07-08T09:54:54-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=23195#p23195</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=23195#p23195"/>
		<title type="html"><![CDATA[Bit of logic help]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=23195#p23195"><![CDATA[
Slight Question, its to do with getting the channel. Re-written most of what i have done above, cause of the lack of a testing place, problem is, when it does place a ban, it makes it global. I cannot seem to get it to operate only on the channel where the fserve is, rather than every channel. <br><div class="codebox"><p>Code: </p><pre><code>#This proc voices people :) proc notc:list-ban {nick uhost hand text {dest ""}} {    global botnick; if {$dest == ""} {set dest $botnick}    putlog "list 3" #It asked me to put this in here for compatiability reasons :P #might be nice to make sure that bannee isnt an operator, and give them a polite notice instead   newchanban $::chan $nick "Weirdo" "Fserve Ban" sticky   putlog "list 4"    putnotc $nick "You have an fserve, here is the prezzie &lt;insert meniacal laugh here"    putlog "Owned a silly little fserved operated by $nick in $::chan" } </code></pre></div>Now i know the $::chan variable doesnt exist, its just a space filler, as i have no idea where i can get this variable from, in the above looped procedure. It might be worth adding these channels to another list, where all the channels with +list-ban is enabled on, and then extracting these in the script above. Thats the only idea i can think of, problem is, being on a bind of notices, if i get too many, might just kill the bot <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_razz.gif" width="15" height="15" alt=":P" title="Razz"><br><br>Can someone help me please?<br><br>Thanks<br><br>Weirdo<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=1195">Weirdo</a> — Tue Jul 08, 2003 9:54 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Weirdo]]></name></author>
		<updated>2003-07-06T18:06:53-04:00</updated>

		<published>2003-07-06T18:06:53-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=23152#p23152</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=23152#p23152"/>
		<title type="html"><![CDATA[Bit of logic help]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=23152#p23152"><![CDATA[
edit: Hint, dont test scripts in live channels, woooo that wasnt pretty <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile">. They didnt like me for that one. Looks like the voice script wont be happening for my art distribution channel, looks like just my ban thingy addon for my !list ban script, for the chat only channel now. Well, could set up a spare channel with a !list trigger for testing, banning myself is fun <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br>Well, the script works nicely, she performs additional checks, and only does it on channels. Just sorting out the notice binds now <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><div class="codebox"><p>Code: </p><pre><code>#This is the Proc to run the !list trigger every 20 or so minutesproc time:list-voice {min hour day month year} {foreach list(chan) [channels] {if {[channel get $list(chan) list-voice] == 0} {return 0}putlog "list 1"if {[botonchan $list(chan)] &amp;&amp; [botisop $list(chan)]} {putlog "list 2"putserv "Privmsg $list(chan) :!list" }}}#This proc voices people :)proc notc:list-voice {nick uhost hand text {dest ""}} {global botnick; if {$dest == ""} {set dest $botnick}putlog "list 3"#It asked me to put this in here for compatiability reasons :Pif {[isvoice $nick] || [isop $nick] || [ishalfop $nick]} {return 0}putlog "list 4"putserv "mode $::chan +v $nick"putnotc $nick "You have an fserve, here is the prezzie :P"putlog "Voiced $nick in $::chan"}</code></pre></div>this is the script as it is. Running it in a diff channel, so i can test it, and make it do something nice for the leeching whores, like voice em, cant ban them with a stuffed up script <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_razz.gif" width="15" height="15" alt=":P" title="Razz"><br><br>Only problem i have found, and i am majorly concerned with, is the Channel references. for voicing, and for checking , i need to know what channel its being checked in, and what channel it is checking. Problem is, i dont think this is channel specific. anyways of getting past this? Perhaps setting a variable in the foreach loop?<br><blockquote class="uncited"><div>[00:20:05] &lt;Natsuki-Chan&gt; [00:20] Tcl error [notc:list-voice]: can't read "::chan": no such variable</div></blockquote>And as i feared, it happened, script works, ish<br><br>Is there a pushmode that i can use, to queue up the voices, so as to prevent flooding the server?<br><br>This bit concerns how to remove the fserve "notice spam" from the logs<br>Looks like the log does store all fserve notices, not exacty a bad thing, but i would rather prevent it.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=1195">Weirdo</a> — Sun Jul 06, 2003 6:06 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2003-07-04T06:22:42-04:00</updated>

		<published>2003-07-04T06:22:42-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=23012#p23012</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=23012#p23012"/>
		<title type="html"><![CDATA[Bit of logic help]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=23012#p23012"><![CDATA[
Let's add some pepper and some salt on this. The ingredients should be:<br>a) one proc that will do a !list for the channels that have +list-ban (a timer 20/30 minutes will do fine), using foreach will make it do the !list only on the channels that have the +list-ban.<br>b) one proc that will catch and filter the incoming notices (bind notc will do fine). Also, the ban *feature*  can be included in this proc or can be moved in a separate proc that will handle only the bans.<br><br>Example for the first proc:<div class="codebox"><p>Code: </p><pre><code>foreach chan [channels] {is {[channel get $chan list-ban] &amp;&amp; [botonchan $chan]} {putserv "PRIVMSG $chan :!list"}}</code></pre></div>If you have any questions/sugestion do ask/tell. <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=187">caesar</a> — Fri Jul 04, 2003 6:22 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Weirdo]]></name></author>
		<updated>2003-07-04T06:02:28-04:00</updated>

		<published>2003-07-04T06:02:28-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=23007#p23007</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=23007#p23007"/>
		<title type="html"><![CDATA[Bit of logic help]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=23007#p23007"><![CDATA[
(Bring on the multi CPU utiisation and supreme multitasking i say <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=";)" title="Wink"> )<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=1195">Weirdo</a> — Fri Jul 04, 2003 6:02 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2003-07-04T06:00:29-04:00</updated>

		<published>2003-07-04T06:00:29-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=23006#p23006</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=23006#p23006"/>
		<title type="html"><![CDATA[Bit of logic help]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=23006#p23006"><![CDATA[
<blockquote class="uncited"><div>sounds good, sounds a lot simpler than my idea <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"></div></blockquote>Your idea wouldn't be possible using eggdrop/tcl because when a piece of tcl code is running everything else stops* untill the code is done. <br><br>That's why caesar warned about infinite loops I think... because if you create one, your eggdrop will disappear from irc and spend the rest of its life doing only that one tcl loop. However creating infinite loops using 'foreach' is impossible.<br><br>* Nothing happens simultaneously in eggdrop. Everything is just a big queue of events happening one at a time. (the bot itself is an endless loop (or at least it tries to be ;P))<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2878">user</a> — Fri Jul 04, 2003 6:00 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Weirdo]]></name></author>
		<updated>2003-07-04T05:42:12-04:00</updated>

		<published>2003-07-04T05:42:12-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=23004#p23004</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=23004#p23004"/>
		<title type="html"><![CDATA[Bit of logic help]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=23004#p23004"><![CDATA[
probably 2 procedures then, one to send the signal, using one loop, which checks the channels, and puts out the !list now and again, which is on a time bind to run every, 20/30 mins or so<br><br>and then a notc bind to actually ban them<br><br>sounds good, sounds a lot simpler than my idea <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br>thanks guys, ill post the code later when i written 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=1195">Weirdo</a> — Fri Jul 04, 2003 5:42 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[caesar]]></name></author>
		<updated>2003-07-04T05:34:05-04:00</updated>

		<published>2003-07-04T05:34:05-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=23003#p23003</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=23003#p23003"/>
		<title type="html"><![CDATA[Bit of logic help]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=23003#p23003"><![CDATA[
Basicaly this will be a timer set to how many minutes you want (or something like this anyway) and he will do that !list thing on the channels that have the +list-ban; this is the main proc. Another proc should be one that will *catch* all the notices that he recives and filter them according to your rules and continue to do what you want with them.<br><br>Ps: Looping without returning/stoping/breaking makes it go insane <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=187">caesar</a> — Fri Jul 04, 2003 5:34 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[egghead]]></name></author>
		<updated>2003-07-04T05:31:16-04:00</updated>

		<published>2003-07-04T05:31:16-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=23000#p23000</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=23000#p23000"/>
		<title type="html"><![CDATA[Bit of logic help]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=23000#p23000"><![CDATA[
<blockquote class="uncited"><div>[snip]<br>What i am worried about is the running of 2 loops inside of each other, will the bot lag VERY badly, or will it still be able to function.<br>[snip] </div></blockquote>For each channel that is set +list-ban you do a !list once in a while. This is a small and fast loop.<br><br>You wait for the notices coming in and review them on content and ban where needed. This part is not within in a loop. It is on a first come, first review-ban basis.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=282">egghead</a> — Fri Jul 04, 2003 5:31 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2003-07-04T05:36:11-04:00</updated>

		<published>2003-07-04T05:30:26-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=22999#p22999</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=22999#p22999"/>
		<title type="html"><![CDATA[Bit of logic help]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=22999#p22999"><![CDATA[
'channels' returns a list so you don't have to bother with splitting it.<div class="codebox"><p>Code: </p><pre><code>foreach chan [channels] {  # the block of code contained in here will be executed for each channel in the channel list (or untill you 'break' out of the loop)  # and each time $chan will be the name of the next channel}</code></pre></div><blockquote class="uncited"><div>** then, for each notice recieved in that channel run checks on it</div></blockquote>This does not happen in the same piece of code (inside the foreach loop) replies to your !list query arrive later and should be catched by a notc bind that has its own proc doing the matching against known fserve replies.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2878">user</a> — Fri Jul 04, 2003 5:30 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Weirdo]]></name></author>
		<updated>2003-07-04T05:26:30-04:00</updated>

		<published>2003-07-04T05:26:30-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=22997#p22997</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=22997#p22997"/>
		<title type="html"><![CDATA[Bit of logic help]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=22997#p22997"><![CDATA[
Yes i have read the TCL Commands, i tend to keep it open while i do these sorts of things. <br><br>After doing the experimentation with some bits of it last night, i found that the [channels] command gives me the list i want, in a [#channel1 #channel2] format, which should be easy enough to split. <br><br>Gave it a bit of though, and the way i figured it out logically last night was like this, roughly<br><br>* first loop - for each channel in [channels] run this command<br>&gt;&gt; check the channel modes for +list-ban<br>&gt;&gt;&gt; if it has that mode, then run the in channel !list function, and find the little buggers<br>&gt;&gt;&gt; if not, Ret0<br>** then, for each notice recieved in that channel run checks on it<br>&gt;&gt;&gt; if its an fserve notice i recognise<br>&gt;&gt;&gt;&gt; goto next check<br>&gt;&gt;&gt; if the person is voiced<br>&gt;&gt;&gt;&gt; goto next notice check<br>&gt;&gt;&gt;&gt; else ban the person<br>** end loop 2, go to next check<br>&gt;&gt; do the little logging thing<br>* end loop 1<br><br>What i am worried about is the running of 2 loops inside of each other, will the bot lag VERY badly, or will it still be able to function. Would like it to be as fast as possible, so this script takes at most, 15 seconds to run in its entirety, it might even be worth adding the ban to a big queue, and at the end of it all, banning who needs to be banned from the channel . Also doesnt help that i am reaaaaaly bad with the loop code, not sure how to get it to look at the channels variable, and split it, same problem with the notice bit. <br><br>i think this is the one i have to use...<blockquote class="uncited"><div>The foreach command implements a loop where the loop variable(s) take on values from one or more lists. In the simplest case there is one loop variable, varname, and one list, list, that is a list of values to assign to varname. The body argument is a Tcl script. For each element of list (in order from first to last), foreach assigns the contents of the element to varname as if the lindex command had been used to extract the element, then calls the Tcl interpreter to execute body. </div></blockquote>problem is, i have no idea really, what it is talking about <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_razz.gif" width="15" height="15" alt=":P" title="Razz"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=1195">Weirdo</a> — Fri Jul 04, 2003 5:26 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2003-07-03T21:55:18-04:00</updated>

		<published>2003-07-03T21:55:18-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=22983#p22983</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=22983#p22983"/>
		<title type="html"><![CDATA[Bit of logic help]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=22983#p22983"><![CDATA[
Have you read doc/tcl-commands.doc?<br>Have you tried searching the forum?<br><br>The notc bind should be permanent. That way you don't have to care about lag/time limits, and besides, who would send your bot notices except from those fserves anyway?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2878">user</a> — Thu Jul 03, 2003 9:55 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Weirdo]]></name></author>
		<updated>2003-07-03T10:09:32-04:00</updated>

		<published>2003-07-03T10:09:32-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=22969#p22969</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=22969#p22969"/>
		<title type="html"><![CDATA[Bit of logic help]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=22969#p22969"><![CDATA[
Hi all <br><br>having a bit of a problem getting my mind around a script i have been asked to do. <br><br>making a channel i run, chat only, and i want to make it fserve free. <br><br>So, using a time bind, that will run every 20 minutes. The script also needs some features. Using a Udef flag, and adding a +list-ban tag to each channel i want to be chat only. The way that i figure is, to do it like this, the bot will have to search for this flag in its channel file. <br><br>Question is, how do i do that? I know that once i have it, i can use a loop (foreach i think should do it) which will set off the trigger into the channel, and i think, that i can put a line of code to react to the notices that the bot will recieve, and looking for the various fserve lidentification flags that each script has at the beginning of each trigger, it will kickban when it finds one.<br><br>do i put the notice listening bit inside the loop or not? Can never seem to get my mind around logic <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_razz.gif" width="15" height="15" alt=":P" title="Razz"><br><br>Any help you can provide would be muchly appreciated <br><br>Thanks<br><br>Weirdo<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=1195">Weirdo</a> — Thu Jul 03, 2003 10:09 am</p><hr />
]]></content>
	</entry>
	</feed>
