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

	<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-06-13T12:45:53-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Dizzle]]></name></author>
		<updated>2005-06-13T12:45:53-04:00</updated>

		<published>2005-06-13T12:45:53-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=50735#p50735</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=50735#p50735"/>
		<title type="html"><![CDATA[Help with writing and checking files]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=50735#p50735"><![CDATA[
thank u guys, its working now <br><br>i really like too thank you guys<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6156">Dizzle</a> — Mon Jun 13, 2005 12:45 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2005-06-13T07:25:34-04:00</updated>

		<published>2005-06-13T07:25:34-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=50728#p50728</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=50728#p50728"/>
		<title type="html"><![CDATA[Help with writing and checking files]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=50728#p50728"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>if {[lsearch -exact $chans $chan] != -1}</code></pre></div>where $chans is the list of channels and $chan is the channel you're searching for in the list (note that case matters).<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Mon Jun 13, 2005 7:25 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Jil Larner]]></name></author>
		<updated>2005-06-13T06:24:04-04:00</updated>

		<published>2005-06-13T06:24:04-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=50726#p50726</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=50726#p50726"/>
		<title type="html"><![CDATA[Help with writing and checking files]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=50726#p50726"><![CDATA[
well, try to change the if statement for <br><br>if {[lsearch -exact $chan $chans] != -1}<br><br>i don't know the real behaviour with ![cmd] == smth. The line above might work better<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5337">Jil Larner</a> — Mon Jun 13, 2005 6:24 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Dizzle]]></name></author>
		<updated>2005-06-12T13:30:56-04:00</updated>

		<published>2005-06-12T13:30:56-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=50641#p50641</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=50641#p50641"/>
		<title type="html"><![CDATA[Help with writing and checking files]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=50641#p50641"><![CDATA[
Well my script, is not givin any more errors, butt one thing is not working <br>When is do a request (testing) he saying at every channel its already in its database <br>I cant see what im doing wrong, here's the piece of code where it al happends <br><div class="codebox"><p>Code: </p><pre><code>set f [open $requestchan] set chan [string tolower $setting(chan)] set chans [string tolower [split [read $f] \n]] if {![lsearch -exact $chan $chans] == -1} { dccbroadcast "$chan was not found in chanfile"set f [open $requestchan a] puts $f "$setting(chan)" close $f} else {set setting(busy) 0 dccbroadcast "$chan was found in chanfile"putquick "NOTICE $setting(nick) : 4REQUEST DENIED 1 : $setting(chan) is already in channel database, if this is not the case contact Dizzle"putquick "PRIVMSG $setting(home) : #pcw.be :: The request from $setting(nick) was denied, $setting(chan) already has a relaybot from #pcw.be"channel remove $setting(chan) unbind RAW -|- 315 request:endofwho return 0 }</code></pre></div>$setting(nick) = the nick of the one requesting <br>$setting(chan) = the channel givin in the request (request #channel) <br>$requestchan = the file where channels should be saved <br><br>What's going wrong ?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6156">Dizzle</a> — Sun Jun 12, 2005 1:30 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Dizzle]]></name></author>
		<updated>2005-06-11T11:49:53-04:00</updated>

		<published>2005-06-11T11:49:53-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=50574#p50574</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=50574#p50574"/>
		<title type="html"><![CDATA[Help with writing and checking files]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=50574#p50574"><![CDATA[
thx didt saw that error, learned something today. <br><br>butt when i request, he saying with every channel, already in bot database, but my bot isnt in that channel. <br><br>why is that ?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6156">Dizzle</a> — Sat Jun 11, 2005 11:49 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Jil Larner]]></name></author>
		<updated>2005-06-11T11:17:31-04:00</updated>

		<published>2005-06-11T11:17:31-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=50573#p50573</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=50573#p50573"/>
		<title type="html"><![CDATA[Help with writing and checking files]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=50573#p50573"><![CDATA[
Look at you error and variable name, you used setting<strong class="text-strong">s</strong> instead of setting.<br>The error occurs in the notice text when the channel is already in the bot database <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=5337">Jil Larner</a> — Sat Jun 11, 2005 11:17 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Dizzle]]></name></author>
		<updated>2005-06-11T06:57:57-04:00</updated>

		<published>2005-06-11T06:57:57-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=50567#p50567</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=50567#p50567"/>
		<title type="html"><![CDATA[Help with writing and checking files]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=50567#p50567"><![CDATA[
well i have put it in both global proc's <br><br>here is the whole code,  its an ajusted code from metroid <br><div class="codebox"><p>Code: </p><pre><code># Configuration # .txt file for channel saving set requestchan "scripts/pcwbe/requestchan.txt"# homechannel where they can request set setting(home) "#Preatorians" # users the channel needs atleast set setting(needed) "1" # deny request if there is no Q or L? set setting(service) "1" # deny request if S is on chanset setting(spamscan) "1"# the flags he wants set setting(flags) "+av" # end of config # don't touch this setting! set setting(busy) 0 bind pub -|- !request request:pub proc request:pub {nick host hand chan arg} { global setting# ignore the request because it isn't the request channel if {![string equal $chan $setting(home)]} { return 0 }if {$setting(busy)} { putquick "NOTICE $nick : 4REQUEST DENIED 1 There is currently already an request in progress, plz wait a minute" return 0 } set channel [lindex [split $arg] 0] # tell him he needs to input a channel first if {$channel == ""} { putquick "NOTICE $nick : Use !request #channel too make the right request, change #channel in your channel name (example !request #pcw.be)" return 0 } if {[validchan $channel]} { return 0; }# activate the busy signal so no other requests can be done bind RAW -|- 315 request:endofwho set setting(busy) 1 set setting(chan) "$channel" set setting(nick) "$nick" channel add $channel } proc request:endofwho {from key arg} { global setting requestchan chanrequestif {$setting(busy)} { if {![onchan $setting(nick) $setting(chan)]} { set setting(busy) 0 putquick "NOTICE $setting(nick) : 4REQUEST DENIED 1 : You aren't on $setting(chan)"putquick "PRIVMSG $setting(home) : #pcw.be :: The request from $setting(nick) was denied, not on $setting(chan)"channel remove $setting(chan) unbind RAW -|- 315 request:endofwho return 0 } }set f [open $requestchan] set chan [string tolower $setting(chan)] set chans [string tolower [split [read $f] \n]] if {[lsearch -exact $chan $chans] == -1} { putquick "NOTICE $setting(nick) : 4REQUEST DENIED 1 : $settings(chan) is already in channel database, if this is not the case contact Dizzle"putquick "PRIVMSG $setting(home) : #pcw.be :: The request from $setting(nick)was denied, $setting(chan)already has a relaybot from #pcw.be"unset $channelchannel remove $setting(chan) close f unbind RAW -|- 315 request:endofwho return 0 } if {![isop $setting(nick) $setting(chan)]} { set setting(busy) 0 putquick "NOTICE $setting(nick) : 4REQUEST DENIED 1 : You aren`t opped on $setting(chan)"putquick "PRIVMSG $setting(home) : #pcw.be :: The request from $setting(nick) was denied, not opped in $setting(chan)"channel remove $setting(chan) unbind RAW -|- 315 request:endofwho return 0 } if {$setting(service)} { if {![onchan L $setting(chan)] &amp;&amp; ![onchan Q $setting(chan)]} { set setting(busy) 0 putquick "NOTICE $setting(nick) : 4REQUEST DENIED 1 : Q or L was not found on $setting(chan)"putquick "PRIVMSG $setting(home) : #pcw.be :: The request from $setting(nick) was denied, no service bots L or Q in $setting(chan)"channel remove $setting(chan) unbind RAW -|- 315 request:endofwho return 0 } } if {$setting(spamscan)} { if {[onchan S $setting(chan)]} { set setting(busy) 0 putquick "NOTICE $setting(nick) : 4REQUEST DENIED 1 : S (Quakenet spamscan) was found on $setting(chan)"putquick "PRIVMSG $setting(home) : #pcw.be :: The request from $setting(nick) was denied, quakenet service bot S was found on $setting(chan)"channel remove $setting(chan) unbind RAW -|- 315 request:endofwho return 0 }}if {[llength [chanlist $setting(chan)]] &lt; $setting(needed)} { set setting(busy) 0 putquick "NOTICE $setting(nick) : 4REQUEST DENIED 1 : Not enough users" putquick "PRIVMSG $setting(home) : #pcw.be :: The request from $setting(nick) was denied, $setting(needed) users needed. $setting(chan) had [llength [chanlist $setting(chan)]] users" channel remove $setting(chan) unbind RAW -|- 315 request:endofwho return 0 } if {![validuser [nick2hand $setting(nick)]]} { adduser $setting(nick) *!*@[lindex [split [getchanhost $setting(nick) $setting(chan)] @] 1] } chattr [nick2hand $setting(nick)] |+n $setting(chan) putquick "PRIVMSG $setting(nick) : 3REQUEST ACCEPTED 1 . A bot will join soon . Please give the bot $setting(flags) on [request:service $setting(chan)] for better results (+m), READ THIS : the bot will leave if your below 15 users" putquick "PRIVMSG $setting(home) : #pcw.be :: The request from $setting(nick) is accepted, $setting(nick) requested me for $setting(chan). The channel has [llength [chanlist $setting(chan)]] users. And they have the service bot : [request:service $setting(chan)]. Hafe fun with our system"set changood [open $requestchan a] puts $changood "$setting(chan)" close $changoodchannel remove $setting(chan) unset setting(chan); unset setting(nick) set setting(busy) 0 unbind RAW -|- 315 request:endofwho return 1 } proc request:service {channel} { if {[onchan L $channel]} { return "L" } elseif {[onchan Q $channel]} { return "Q" } }proc request:spamscan {channel} {if {[onchan S $channel]} {return "S"}}</code></pre></div>Whos can see the problem  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_redface.gif" width="15" height="15" alt=":oops:" title="Embarassed"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6156">Dizzle</a> — Sat Jun 11, 2005 6:57 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[De Kus]]></name></author>
		<updated>2005-06-11T05:55:13-04:00</updated>

		<published>2005-06-11T05:55:13-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=50566#p50566</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=50566#p50566"/>
		<title type="html"><![CDATA[Help with writing and checking files]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=50566#p50566"><![CDATA[
if you defined settings in another procedure, did you make it global in both?<br>if he is claming there is no such var, then there isnt (which is valid for the current procedure) ^-^.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2382">De Kus</a> — Sat Jun 11, 2005 5:55 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Dizzle]]></name></author>
		<updated>2005-06-11T03:45:40-04:00</updated>

		<published>2005-06-11T03:45:40-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=50563#p50563</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=50563#p50563"/>
		<title type="html"><![CDATA[Help with writing and checking files]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=50563#p50563"><![CDATA[
Very much thx for the code, i tried too put it in but its giving an error<br>This is wat i placed <br><div class="codebox"><p>Code: </p><pre><code>set f [open $requestchan] set chan [string tolower $setting(chan)] set chans [string tolower [split [read $f] \n]] if {[lsearch -exact $chan $chans] == -1} { </code></pre></div>He cant read $setting(chan) "can't read "settings(chan)": no such variable"<br><br>Why cant he read this, cant he put a variable between [] <br><br>setting(chan) = the channel wich is requested by the user <br><br>Help plz  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_redface.gif" width="15" height="15" alt=":oops:" title="Embarassed"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6156">Dizzle</a> — Sat Jun 11, 2005 3:45 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[demond]]></name></author>
		<updated>2005-06-09T03:27:43-04:00</updated>

		<published>2005-06-09T03:27:43-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=50449#p50449</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=50449#p50449"/>
		<title type="html"><![CDATA[Help with writing and checking files]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=50449#p50449"><![CDATA[
write (append) channel name to file:<div class="codebox"><p>Code: </p><pre><code>set f [open filename a]puts $f $channelclose $f</code></pre></div>check if it's already there:<div class="codebox"><p>Code: </p><pre><code>set f [open filename]set chan [string tolower $channel]set chans [string tolower [split [read $f] \n]]if {[lsearch -exact $chans $chan] == -1} {# not found} else {# found}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5056">demond</a> — Thu Jun 09, 2005 3:27 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Dizzle]]></name></author>
		<updated>2005-06-08T23:58:06-04:00</updated>

		<published>2005-06-08T23:58:06-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=50446#p50446</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=50446#p50446"/>
		<title type="html"><![CDATA[Help with writing and checking files]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=50446#p50446"><![CDATA[
well, there is one bot : the Mainbot, who does the requests off ppl, if he finds it ok in the channel. He will send a relaybot in there. <br><br>Butt in my old script ppl can request as many relaybots as they want, just too make it idle bots. So i want too make a general request file where all approved channels are written in, so if ppl request an relaybot twice for a channel the bot can cancel the request. That's what i like too acomplish. I know there is a good way too make it work, butt i didnt found it yet. <br><br>So help will be very welcome  <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=6156">Dizzle</a> — Wed Jun 08, 2005 11:58 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[demond]]></name></author>
		<updated>2005-06-08T15:43:14-04:00</updated>

		<published>2005-06-08T15:43:14-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=50426#p50426</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=50426#p50426"/>
		<title type="html"><![CDATA[Help with writing and checking files]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=50426#p50426"><![CDATA[
what are you trying to accomplish? save channel names in a file and check if a channel name is already there? explain in details<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5056">demond</a> — Wed Jun 08, 2005 3:43 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Dizzle]]></name></author>
		<updated>2005-06-08T13:40:28-04:00</updated>

		<published>2005-06-08T13:40:28-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=50422#p50422</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=50422#p50422"/>
		<title type="html"><![CDATA[Help with writing and checking files]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=50422#p50422"><![CDATA[
i know this is not enough, can anybody give me some advice<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6156">Dizzle</a> — Wed Jun 08, 2005 1:40 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Dizzle]]></name></author>
		<updated>2005-06-07T23:52:42-04:00</updated>

		<published>2005-06-07T23:52:42-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=50413#p50413</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=50413#p50413"/>
		<title type="html"><![CDATA[Help with writing and checking files]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=50413#p50413"><![CDATA[
$setting(chan) is the channel name of the requested channel. is see that your using a for opening <br><br>my discription says : <br><br>a   Open the file for writing only. The file must already exist, <br>      and the file is positioned so that new data is appended to the file. <br><br>So that is possible <br><br>then the Code should be <br><br> <div class="codebox"><p>Code: </p><pre><code>set f [open $chanfile a] puts $f "$setting($chan)" close $f </code></pre></div>butt how i will be able too check the if $settingchan doest match a channel written in $chanfile <br><br>this is the part i coded, butt that aint working <br><div class="codebox"><p>Code: </p><pre><code>set chanrequest [open $chanfile r]set info [read $chanrequest]if {([string match "$info"  $setting(chan)])} {putserv "NOTICE $setting(nick) : This channel already excist"</code></pre></div>What am i doing wrong ??<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6156">Dizzle</a> — Tue Jun 07, 2005 11:52 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[demond]]></name></author>
		<updated>2005-06-07T15:57:32-04:00</updated>

		<published>2005-06-07T15:57:32-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=50399#p50399</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=50399#p50399"/>
		<title type="html"><![CDATA[Help with writing and checking files]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=50399#p50399"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>set f [open $chanfile a]puts $f "$chan: $setting($chan)"close $f</code></pre></div>i.e. open the file for appending, and output the channel name along settings<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5056">demond</a> — Tue Jun 07, 2005 3:57 pm</p><hr />
]]></content>
	</entry>
	</feed>
