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

	<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>2008-08-31T08:56:54-04:00</updated>

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

		<entry>
		<author><name><![CDATA[ultralord]]></name></author>
		<updated>2008-08-31T08:56:54-04:00</updated>

		<published>2008-08-31T08:56:54-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=84951#p84951</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=84951#p84951"/>
		<title type="html"><![CDATA[Help with one of my script..]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=84951#p84951"><![CDATA[
IT WORKS MANY THNX!!!!!!!!!!!!!!!<br><br><br><br><br><br><br> <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_surprised.gif" width="15" height="15" alt=":o" title="Surprised">  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_surprised.gif" width="15" height="15" alt=":o" title="Surprised">  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_surprised.gif" width="15" height="15" alt=":o" title="Surprised">  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_surprised.gif" width="15" height="15" alt=":o" title="Surprised">  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_surprised.gif" width="15" height="15" alt=":o" title="Surprised">  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_surprised.gif" width="15" height="15" alt=":o" title="Surprised">  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_surprised.gif" width="15" height="15" alt=":o" title="Surprised"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8360">ultralord</a> — Sun Aug 31, 2008 8:56 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ultralord]]></name></author>
		<updated>2008-08-31T08:05:50-04:00</updated>

		<published>2008-08-31T08:05:50-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=84949#p84949</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=84949#p84949"/>
		<title type="html"><![CDATA[Help with one of my script..]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=84949#p84949"><![CDATA[
no errors nothing.. wtf... can someone try it to see if he had that problem?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8360">ultralord</a> — Sun Aug 31, 2008 8:05 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Nor7on]]></name></author>
		<updated>2008-08-31T05:00:38-04:00</updated>

		<published>2008-08-31T05:00:38-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=84945#p84945</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=84945#p84945"/>
		<title type="html"><![CDATA[Help with one of my script..]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=84945#p84945"><![CDATA[
put in partyline.<br><div class="codebox"><p>Code: </p><pre><code>.console +o</code></pre></div>and look if it show some error message.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8762">Nor7on</a> — Sun Aug 31, 2008 5:00 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ultralord]]></name></author>
		<updated>2008-08-31T04:32:15-04:00</updated>

		<published>2008-08-31T04:32:15-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=84943#p84943</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=84943#p84943"/>
		<title type="html"><![CDATA[Help with one of my script..]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=84943#p84943"><![CDATA[
someone knows why the bot not response to script?? :/<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8360">ultralord</a> — Sun Aug 31, 2008 4:32 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ultralord]]></name></author>
		<updated>2008-08-30T12:42:55-04:00</updated>

		<published>2008-08-30T12:42:55-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=84934#p84934</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=84934#p84934"/>
		<title type="html"><![CDATA[Help with one of my script..]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=84934#p84934"><![CDATA[
i edit :<br><div class="codebox"><p>Code: </p><pre><code>set channels "#mychannel"bind join - * machingproc maching {nick host hand chan} {      global g_losestats g_pickupchan g_winstats way1 way2 channels  if { $channels != $g_pickupchan } {return 0}   set findwin 0   set findlose 0   set searchwin [split [read [open $way1 r]] "\n"]   foreach newwin [lindex $searchwin 0] {        if {$newwin == $nick} {incr findwin 1}                      }    set searchlose [split [read [open $way2 r]] "\n"]    foreach newlose [lindex $searchlose 0] {        if {$newlose == $nick} {incr findlose 1}                     }    if {$findwin == 0} {           set findwin 1         }    if {$findlose == 0} {           set findlose 1         }          if {[expr $findwin / $findlose] &gt;= "5" } {             putquick "PRIVMSG $g_pickupchan : \002\00304 $nick\003 You have coefficient\00303 [expr $findwin / $findlose] \003 I give you\00304 +"          putquick "MODE $g_pickupchan +v $nick"    }}</code></pre></div>but no response my nick is "Ultralord" on irc and on txt files.. :/<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8360">ultralord</a> — Sat Aug 30, 2008 12:42 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2008-08-30T12:30:35-04:00</updated>

		<published>2008-08-30T12:30:35-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=84933#p84933</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=84933#p84933"/>
		<title type="html"><![CDATA[Help with one of my script..]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=84933#p84933"><![CDATA[
The way this script is written, all string comparisons are case sensitive, including nicknames and channel names. So, should g_pickupchan be set to "#mychan", and you decide to join "#MyChan", this script will not react. Same if you use ultralord as you nick instead of UltraLord.<br><br>Of course, I assume you've double checked the actual scores, as this script will not perform any actions unless the win/loose ratio is above 5 (as requested)..<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Sat Aug 30, 2008 12:30 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ultralord]]></name></author>
		<updated>2008-08-30T12:22:57-04:00</updated>

		<published>2008-08-30T12:22:57-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=84932#p84932</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=84932#p84932"/>
		<title type="html"><![CDATA[Help with one of my script..]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=84932#p84932"><![CDATA[
i try like.. :<br><div class="codebox"><p>Code: </p><pre><code>set way1 "/home/ultralord/www/dota/g_winstats.txt"set way2 "/home/ultralord/www/dota/g_losestats.txt"bind join - * machingproc maching {nick host hand chan} {      global g_losestats g_pickupchan g_winstats way1 way2   if {$g_pickupchan != $chan} {return 0}   set findwin 0   set findlose 0   set searchwin [split [read [open $way1 r]] "\n"]   foreach newwin [lindex $searchwin 0] {        if {$newwin == $nick} {incr findwin 1}                      }    set searchlose [split [read [open $way2 r]] "\n"]    foreach newlose [lindex $searchlose 0] {        if {$newlose == $nick} {incr findlose 1}                     }    if {$findwin == 0} {           set findwin 1         }    if {$findlose == 0} {           set findlose 1         }          if {[expr $findwin / $findlose] &gt;= "5" } {             putquick "PRIVMSG $g_pickupchan : \002\00304 $nick\003 You have coefficient\00303 [expr $findwin / $findlose] \003 I give you\00304 +"          putquick "MODE $g_pickupchan +v $nick"    }}</code></pre></div>but nothing happened no tcl errors but nothing.. like it doesnt work..<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8360">ultralord</a> — Sat Aug 30, 2008 12:22 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2008-08-30T09:17:02-04:00</updated>

		<published>2008-08-30T09:17:02-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=84929#p84929</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=84929#p84929"/>
		<title type="html"><![CDATA[Help with one of my script..]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=84929#p84929"><![CDATA[
Replace the $g_winstats and $g_losestats with the actual path and filenames of the stats-files, and you should be able to open the files properly.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Sat Aug 30, 2008 9:17 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ultralord]]></name></author>
		<updated>2008-08-30T08:01:31-04:00</updated>

		<published>2008-08-30T08:01:31-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=84928#p84928</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=84928#p84928"/>
		<title type="html"><![CDATA[Help with one of my script..]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=84928#p84928"><![CDATA[
many many thanks for that!!!!!! but when i run it.. i goes to test it.. i make /hop and i saw tcl error on dcc chat<br><br>[14:42:43] &lt;Botnick&gt; [13:43] Tcl error [maching]: couldn't open "uL uL uL Ultralord Ultralord uL uL Ultralord Ultralord uL vlakas eleos mp00 mosxasisisi uL vlakas eleos mp00 mosxasisisi.txt": no such file or directory<br><br><br>the txt's file is on directory<br><br>/home/ultralord/www/dota/g_winstats.txt<br>/home/ultralord/www/dota/g_losestats.txt<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8360">ultralord</a> — Sat Aug 30, 2008 8:01 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2008-08-29T15:07:53-04:00</updated>

		<published>2008-08-29T15:07:53-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=84922#p84922</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=84922#p84922"/>
		<title type="html"><![CDATA[Help with one of my script..]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=84922#p84922"><![CDATA[
Nope, the file handle is still left open. Some systems do allow the same file to be opened by multiple handles given certain conditions. Tcl, however, will not reuse the same file handle, but instead horde system resources... In the long run, you'll use up your process' quota of file handlers, and your eggdrop will be completely unable to open any further files...<br><br><strong class="text-strong">read</strong> will read all the data from the current filepointer up until the end, assuming the file has been accessed in a blocking mode and no <em class="text-italics">numChars</em> argument has been supplied. In other cases, the amount of data read may vary depending on current conditions. However, in none of those cases will <strong class="text-strong">read</strong> try to close the file descriptor.<br><br>In the end, Always close your file handles when you've stopped using them.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Fri Aug 29, 2008 3:07 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[game_over]]></name></author>
		<updated>2008-08-29T14:49:40-04:00</updated>

		<published>2008-08-29T14:49:40-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=84921#p84921</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=84921#p84921"/>
		<title type="html"><![CDATA[Help with one of my script..]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=84921#p84921"><![CDATA[
<blockquote class="uncited"><div>That looks alot better <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br>Personally, I'd find an equation such as win/(win+loss) more intuitive, but since ultralord requested win/loss, your approach to avoid division by zero is reasonable. Could probably skip setting win to 1, as win is the nominator, not the denominator. Though in either case, the end result would be the same.<br><br>One final advice though, once you've read the files, do take the time to close them in order to save system resources, and avoid locking the files for future score-updates.</div></blockquote>for me only when open .... "w" (write) is necessity to close files. When you use open whit "r" (read only) a think command open file read content and close file immediately. For test if we use file with read $file w and don't close and flush it we never open the file whit new stuff if we use open r we don't have to <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile">. On my bot read is in one proc and others call him <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=8946">game_over</a> — Fri Aug 29, 2008 2:49 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2008-08-29T12:45:48-04:00</updated>

		<published>2008-08-29T12:45:48-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=84919#p84919</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=84919#p84919"/>
		<title type="html"><![CDATA[Help with one of my script..]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=84919#p84919"><![CDATA[
That looks alot better <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br>Personally, I'd find an equation such as win/(win+loss) more intuitive, but since ultralord requested win/loss, your approach to avoid division by zero is reasonable. Could probably skip setting win to 1, as win is the nominator, not the denominator. Though in either case, the end result would be the same.<br><br>One final advice though, once you've read the files, do take the time to close them in order to save system resources, and avoid locking the files for future score-updates.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Fri Aug 29, 2008 12:45 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[game_over]]></name></author>
		<updated>2008-08-29T12:31:05-04:00</updated>

		<published>2008-08-29T12:31:05-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=84916#p84916</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=84916#p84916"/>
		<title type="html"><![CDATA[Help with one of my script..]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=84916#p84916"><![CDATA[
I forgot read command  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_lol.gif" width="15" height="15" alt=":lol:" title="Laughing"> but i tell you this i same example. I see you want all. Only insert this<div class="codebox"><p>Code: </p><pre><code>bind join - * machingproc maching {nick host hand chan} {      global g_losestats g_pickupchan g_winstats   if {$g_pickupchan != $chan} {return 0}   set findwin 0   set findlose 0   set searchwin [split [read [open $g_winstats r]] "\n"]   foreach newwin [lindex $searchwin 0] {        if {$newwin == $nick} {incr findwin 1}                      }    set searchlose [split [read [open $g_losestats r]] "\n"]    foreach newlose [lindex $searchlose 0] {        if {$newlose == $nick} {incr findlose 1}                     }    if {$findwin == 0} {           set findwin 1         }    if {$findlose == 0} {           set findlose 1         }     if {[expr $findwin / $findlose] &gt;= "5" } {             putquick "PRIVMSG $g_pickupchan : \002\00304 $nick\003 You have coefficient\00303 [expr $findwin / $findlose] \003 I give you\00304 +" putquick "MODE $g_pickupchan +v $nick"    }}</code></pre></div>this do that<br><img src="http://img5.pictiger.com/14f/16597119.jpg" class="postimage" alt="Image"><br><a href="http://img5.pictiger.com/4e6/16597121.jpg?u=1220027072" class="postlink">http://img5.pictiger.com/4e6/16597121.jpg?u=1220027072</a><br><br>now i say expr 5 / 0 wins and loses is 0 i script if you don't have loses set loses to 1. now 5 / 1 = 5 and voise is up <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"> and 0 / 5 to 1 / 5 <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile">. If want to see nums like this 0.0005 just <br><blockquote class="uncited"><div>[expr $findwin / $findlose]</div></blockquote>to<br><blockquote class="uncited"><div>[expr $findwin. / $findlose.]</div></blockquote><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8946">game_over</a> — Fri Aug 29, 2008 12:31 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2008-08-29T08:41:40-04:00</updated>

		<published>2008-08-29T08:41:40-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=84912#p84912</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=84912#p84912"/>
		<title type="html"><![CDATA[Help with one of my script..]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=84912#p84912"><![CDATA[
@game_over:<br>foreach does'nt understand file-descriptors... foreach only understands lists.<br><br>A file descriptor is simply a short string containing one word that identifies the opened file. But to foreach, it just looks like a list with one single entity, looking something like "file12". Doing a foreach on that will just run the code once, with newwin containing "file12", nothing else...<br><br>As for the file structure, it is a single line with the nicks of the winners in a list. Thus, even if you did fix your code to actually read from the file, your if-conditional makes no sense...<br>First off, newwin would not be a list, but a string - don't use lindex here, that'll break things.<br>Secondly, should the lindex not choke on the data, it would most likely just return a possibly mangled newwin, which most certainly is not a boolean data (required by if). Hence you'd only end up with an error message such as: expected boolean value but got "nickname".<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Fri Aug 29, 2008 8:41 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[game_over]]></name></author>
		<updated>2008-08-29T06:38:13-04:00</updated>

		<published>2008-08-29T06:38:13-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=84911#p84911</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=84911#p84911"/>
		<title type="html"><![CDATA[Help with one of my script..]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=84911#p84911"><![CDATA[
<blockquote class="uncited"><div>Game_over:<br>First off, your file handling is incorrect... Doing a foreach-loop on a filehandle will not yield the result you expect.<br>Next, I can't even imagine the purpose of the lindex commands, or how you expect that code to produce a tally of wins/losses...<br><br>Finally, properly indenting the code would reveal that there is one { missing from one of the if-constructs...</div></blockquote>Because i think the file structure is that:<br><br>nick1 wins<br>nick2 wins<br><br>and wins and loses are writed whit nums <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"> this is more effective way<br>now i am on work when i gather at home i look this files an run on my bot and you have no problems <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=8946">game_over</a> — Fri Aug 29, 2008 6:38 am</p><hr />
]]></content>
	</entry>
	</feed>
