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

	<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-01-06T05:32:29-04:00</updated>

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

		<entry>
		<author><name><![CDATA[hide]]></name></author>
		<updated>2005-01-06T05:32:29-04:00</updated>

		<published>2005-01-06T05:32:29-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=45047#p45047</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=45047#p45047"/>
		<title type="html"><![CDATA[merge 2 TCLs into one]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=45047#p45047"><![CDATA[
Thanks a lot again!! It works <strong class="text-strong"><em class="text-italics"><span style="text-decoration:underline">perfectly.</span></em></strong><em class="text-italics"><span style="text-decoration:underline"></span></em><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4290">hide</a> — Thu Jan 06, 2005 5:32 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[demond]]></name></author>
		<updated>2005-01-03T22:03:20-04:00</updated>

		<published>2005-01-03T22:03:20-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=44908#p44908</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=44908#p44908"/>
		<title type="html"><![CDATA[merge 2 TCLs into one]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=44908#p44908"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>set sent {} set file /some/file set save /some/savefile bind join - * myjoin bind time - "% % % % %" mysave bind sent - * mysentif ![catch {set f [open $save]}] {   while {![eof $f]} {lappend sent [gets $f]}   close $f } proc myjoin {n u h c} {   scan $u %\[^@\]@%s user host   if [regexp ^~?(cht-v3\\.1|off)$ $user] {     set host [string tolower $host]     if {[lsearch $::sent $host] == -1} {       dccsend $::file $n     }   } } proc mysent {h n p} {  scan [getchanhost $n] %\[^@\]@%s user host   set host [string tolower $host]   lappend ::sent $host}proc mysave {m h d mn y} {   set f [open $::save w]   foreach h $::sent {puts $f $h}   close $f } </code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5056">demond</a> — Mon Jan 03, 2005 10:03 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[hide]]></name></author>
		<updated>2005-01-03T14:22:29-04:00</updated>

		<published>2005-01-03T14:22:29-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=44885#p44885</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=44885#p44885"/>
		<title type="html"><![CDATA[modifying a tcl script..]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=44885#p44885"><![CDATA[
Hello everyone.. I have a problem. This is a TCL script I have:<br><div class="codebox"><p>Code: </p><pre><code>set sent {} set file /home/hide/public_html/vkt.ini set save /home/hide/public_html/sent.txt bind join - * myjoin bind time - "% % % % %" mysave if ![catch {set f [open $save]}] {   while {![eof $f]} {lappend sent [gets $f]}   close $f } proc myjoin {n u h c} {   scan $u %\[^@\]@%s user host   if [regexp ^~?(cht-v3\\.1|off)$ $user] {     set host [string tolower $host]     if {[lsearch $::sent $host] == -1} {       lappend ::sent $host       dccsend $::file $n     }   } } proc mysave {m h d mn y} {   set f [open $::save w]   foreach h $::sent {puts $f $h}   close $f }</code></pre></div>but the problem is that my eggdrop bot puts the remote host entry into the file despite the file was sended successfully or sending failed.. Could anybody fix me that script so it would only write that hosts to file, that have successfuly dcc send completed (if sending failes I will not write anything to that file..).<br><br>I guess in the last block (mysave) there should be something like: if dccsend is successful then write the host to file, esle if dcc sending timed out-do nothing.. However, I dunno how to write that.. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_sad.gif" width="15" height="15" alt=":(" title="Sad"><br><br>Thanks. <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=4290">hide</a> — Mon Jan 03, 2005 2:22 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[hide]]></name></author>
		<updated>2004-11-11T15:12:26-04:00</updated>

		<published>2004-11-11T15:12:26-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=42664#p42664</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=42664#p42664"/>
		<title type="html"><![CDATA[merge 2 TCLs into one]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=42664#p42664"><![CDATA[
script seems to work perfectly. A <strong class="text-strong">*GREAT*</strong> thanks for You.  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=":wink:" title="Wink"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4290">hide</a> — Thu Nov 11, 2004 3:12 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[demond]]></name></author>
		<updated>2004-11-11T14:44:50-04:00</updated>

		<published>2004-11-11T14:44:50-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=42663#p42663</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=42663#p42663"/>
		<title type="html"><![CDATA[merge 2 TCLs into one]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=42663#p42663"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>set sent {}set file /some/fileset save /some/savefilebind join - * myjoinbind time - "% % % % %" mysaveif ![catch {set f [open $save]}] {  while {![eof $f]} {lappend sent [gets $f]}  close $f}proc myjoin {n u h c} {  scan $u %\[^@\]@%s user host  if [regexp ^~?(cht-v3\\.1|off)$ $user] {    set host [string tolower $host]    if {[lsearch $::sent $host] == -1} {      lappend ::sent $host      dccsend $::file $n    }  }}proc mysave {m h d mn y} {  set f [open $::save w]  foreach h $::sent {puts $f $h}  close $f}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5056">demond</a> — Thu Nov 11, 2004 2:44 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[hide]]></name></author>
		<updated>2004-11-11T14:09:05-04:00</updated>

		<published>2004-11-11T14:09:05-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=42662#p42662</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=42662#p42662"/>
		<title type="html"><![CDATA[merge 2 TCLs into one]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=42662#p42662"><![CDATA[
I've fixed my regexp line thanks.<br><br>But still: how can I manipulate the hostlist in *real time*? I mean, those 'special' people joing channels quite often so I don't think there'll help a periodic timer. It should be something more quicker than that.<br><br>I'm verry sorry but I'm still very lame in tcl scripts, I don't script by myself. Could anybody write me an example-script which does both mentioned checks (ident chech and then it verifies if the file wasn't already sent to certain hostmask)? Please note that from time to time I'll need to flush all entries (all hostmasks from the list), so the list should be kept in human-readable file or something near that. Thank You.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4290">hide</a> — Thu Nov 11, 2004 2:09 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[demond]]></name></author>
		<updated>2004-11-11T13:47:17-04:00</updated>

		<published>2004-11-11T13:47:17-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=42661#p42661</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=42661#p42661"/>
		<title type="html"><![CDATA[Re: merge 2 TCLs into one]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=42661#p42661"><![CDATA[
<blockquote class="uncited"><div>Hello all!<br>Firstly, I'll try to explain what type of script do I need:<br><br>"When a user having ident "cht-v3.1" or "off" joins any channel, bot DCC sends him/her file "vkt.ini" and puts his hostmask (for example: *!*@user.domain.com) into a file, so when users from the same hostmask joins to channel again, the file won't be sent again".<br><br><strong class="text-strong">Please note that bot should send that file only for people having idents "cht-v3.1" or "off" but not any other!</strong><br><br>I've two skripts here:<br><br>This script sends the file only for cht-v3.1 or off ident owners but it doesn't check if that file was sent for a certain hostmask in the past, so it send it to user every time (s)he joins a channel:<br><div class="codebox"><p>Code: </p><pre><code>set sendfile "/home/hide/_stuff/vkt.ini" bind join - * join:send proc join:send {nick uhost hand chan} {   if {[isbotnick $nick]} {     return   }   set ident [lindex [split $uhost @] 0]   if {![regexp -all {cht-v3.1|off} $ident]} {     return   }   dccsend $::sendfile $nick } </code></pre></div></div></blockquote>your regexp is incorrect, it should be ^~*(cht-v3\\.1|off)$<br><blockquote class="uncited"><div>here I have another script but <strong class="text-strong"> it doesn't work</strong> due to unknown reason but I give it You anyway (maybe it'll help).<br><div class="codebox"><p>Code: </p><pre><code>set myfile "/home/hide/send.txt" bind join - * join:pub proc join:pub {nick host hand chan} {   global myfile   set read [open "myfile" r]   while {[gets $read line] != -1} {     if {[string equal -nocase "$line" "$nick"]} {       close $read       return 1     }   }   dccsend /home/hide/vkt.ini $nick   set file [open "$myfile" a]   puts $file "$nick"   close $file   close $read }</code></pre></div>Could anybody merge me these two scripts into ane according to my needs I mentioned in the beginning? It would be glad to get help. I'm looking forward to it. Thanks.[/b]</div></blockquote>inefficient &amp; poorly written<br><br>you should keep hostnames in a list, and [lsearch] through that list; save the list in a file (on timer or by command) and load the list from a file on script load<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5056">demond</a> — Thu Nov 11, 2004 1:47 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[hide]]></name></author>
		<updated>2004-11-11T13:19:54-04:00</updated>

		<published>2004-11-11T13:19:54-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=42658#p42658</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=42658#p42658"/>
		<title type="html"><![CDATA[merge 2 TCLs into one]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=42658#p42658"><![CDATA[
Hello all!<br>Firstly, I'll try to explain what type of script do I need:<br><br>"When a user having ident "cht-v3.1" or "off" joins any channel, bot DCC sends him/her file "vkt.ini" and puts his hostmask (for example: *!*@user.domain.com) into a file, so when users from the same hostmask joins to channel again, the file won't be sent again".<br><br><strong class="text-strong">Please note that bot should send that file only for people having idents "cht-v3.1" or "off" but not any other!</strong><br><br>I've two skripts here:<br><br>This script sends the file only for cht-v3.1 or off ident owners but it doesn't check if that file was sent for a certain hostmask in the past, so it send it to user every time (s)he joins a channel:<br><div class="codebox"><p>Code: </p><pre><code>set sendfile "/home/hide/_stuff/vkt.ini" bind join - * join:send proc join:send {nick uhost hand chan} {   if {[isbotnick $nick]} {     return   }   set ident [lindex [split $uhost @] 0]   if {![regexp -all {cht-v3.1|off} $ident]} {     return   }   dccsend $::sendfile $nick } </code></pre></div><br>here I have another script but <strong class="text-strong"> it doesn't work</strong> due to unknown reason but I give it You anyway (maybe it'll help).<br><div class="codebox"><p>Code: </p><pre><code>set myfile "/home/hide/send.txt" bind join - * join:pub proc join:pub {nick host hand chan} {   global myfile   set read [open "myfile" r]   while {[gets $read line] != -1} {     if {[string equal -nocase "$line" "$nick"]} {       close $read       return 1     }   }   dccsend /home/hide/vkt.ini $nick   set file [open "$myfile" a]   puts $file "$nick"   close $file   close $read }</code></pre></div>Could anybody merge me these two scripts into ane according to my needs I mentioned in the beginning? It would be glad to get help. I'm looking forward to it. Thanks.[/b]<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=4290">hide</a> — Thu Nov 11, 2004 1:19 pm</p><hr />
]]></content>
	</entry>
	</feed>
