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

	<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>2006-02-26T13:03:04-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Sir Edward]]></name></author>
		<updated>2006-02-26T13:03:04-04:00</updated>

		<published>2006-02-26T13:03:04-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=60664#p60664</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=60664#p60664"/>
		<title type="html"><![CDATA[My first script - need some assistance.]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=60664#p60664"><![CDATA[
Thank you for the reply. I did my best attempt to fix the variable problem here, albeit I do not know if it's completely correct (It doesn't function correctly, so it's easy to assume that):<br><div class="codebox"><p>Code: </p><pre><code>proc html_stat {} {   set htmlfile [open "index.html" w]    upvar magus magusstat maes maesstat gendo gendostat cid cidstat lol lolstat   puts $htmlfile "&lt;HTML&gt;&lt;HEAD&gt;&lt;TITlE&gt;BNC Stat&lt;/TITLE&gt;&lt;/HEAD&gt;&lt;BODY&gt;"   puts $htmlfile "Magus: $magusstat"   puts $htmlfile "Maes_Hughes: $maesstat"   puts $htmlfile "Gendo_Ikari: $gendostat"   puts $htmlfile "Cid_Highwind: $cidstat"   puts $htmlfile "LOL: $lolstat &lt;/BODY&gt;&lt;/HTML&gt;"} </code></pre></div><div class="codebox"><p>Code: </p><pre><code>source ./scripts/database.tclsource ./scripts/htmlstat.tcltimer 5 updatemagustimer 5 updatemaesputlog "Trying timers"timer 5 updategendotimer 5 updatecidtimer 5 "set lol [expr rand()]"timer 6 updatepageset statchan \#vservicesputlog $statchanproc updatemagus {} {   global botnick $statchan magus lol   if {[onchan Magus $statchan]} {      set magus Yes   } else {      set magus No   }   upvar magus magustat}proc updatemaes {} {   global botnick $statchan gendo   if {[onchan Maes_Hughes $statchan]} {      set maes Yes   } else {      set maes No   }   upvar maes maesstat}proc updategendo {} {   global botnick $statchan gendo   if {[onchan Gendo_Ikari $statchan]} {      set gendo Yes   } else {      set gendo No   }   upvar gendo gendostat}proc updatecid {} {   global botnick $statchan cid   if {[onchan Cid_Highwind $statchan]} {      set cid Yes   } else {      set cid No   }   upvar cid cidstat}proc updatepage {} {   set datafile [open "database.tcl" w]   puts $datafile "set magusstat $magus"   puts $datafile "set maesstat $maes"   puts $datafile "set gendostat $gendo"   puts $datafile "set cidstat $cid"   puts $datafile "set lolstat $lol"   upvar magus magusstat maes maesstat gendo gendostat cid cidstat lol lolstat   html_stat}putlog "loaded"</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7412">Sir Edward</a> — Sun Feb 26, 2006 1:03 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[De Kus]]></name></author>
		<updated>2006-02-26T10:54:36-04:00</updated>

		<published>2006-02-26T10:54:36-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=60661#p60661</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=60661#p60661"/>
		<title type="html"><![CDATA[My first script - need some assistance.]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=60661#p60661"><![CDATA[
proc html_stat needs rework. 1 major problems I can use on first sight:<br>- you cannot use file names with puts, but you must use file handles (like in proc updatepage)<br><br>then I see a general problem:<br>- you cannot use $var from procs which are higher/lower levels. you must explicitly make them global, catch them via upvar or give them as parameters.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2382">De Kus</a> — Sun Feb 26, 2006 10:54 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sir Edward]]></name></author>
		<updated>2006-02-26T06:53:14-04:00</updated>

		<published>2006-02-26T06:53:14-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=60657#p60657</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=60657#p60657"/>
		<title type="html"><![CDATA[My first script - need some assistance.]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=60657#p60657"><![CDATA[
Hello. I have just recently learned Tcl and started modifying scripts and decided to build my own. What this does is check if the BNCs are in my logging channel and is suppose to post it to an HTML document.. but nothing seems to be working. Any help would be greatly appreciated.<br><br>This is the main script, bncstat.tcl:<div class="codebox"><p>Code: </p><pre><code>source ./scripts/database.tclsource ./scripts/htmlstat.tcltimer 5 updatemagustimer 5 updatemaesputlog "Trying timers"timer 5 updategendotimer 5 updatecidtimer 5 "set lol [expr rand()]"timer 6 updatepageset statchan \#vservicesputlog $statchanproc updatemagus {} {global botnick $statchan magus lolif {[onchan Magus $statchan]} {set magus Yes} else {set magus No}}proc updatemaes {} {global botnick $statchan gendoif {[onchan Maes_Hughes $statchan]} {set maes Yes} else {set maes No}}proc updategendo {} {global botnick $statchan gendoif {[onchan Gendo_Ikari $statchan]} {set gendo Yes} else {set gendo No}}proc updatecid {} {global botnick $statchan cidif {[onchan Cid_Highwind $statchan]} {set cid Yes} else {set cid No}}proc updatepage {} {set datafile [open "database.tcl" w]puts $datafile "set magusstat $magus"puts $datafile "set maesstat $maes"puts $datafile "set gendostat $gendo"puts $datafile "set cidstat $cid"puts $datafile "set lolstat $lol"global magusstat maesstat gendostat cidstat lolstathtml_stat}putlog "loaded"</code></pre></div>And this is the htmlstat.tcl used to edit the html file.<br><div class="codebox"><p>Code: </p><pre><code>proc html_stat {} {global cid magus maes gendo cidstat magusstat maesstat gendostat lol lolstat statchanputs index.html "&lt;HTML&gt;&lt;HEAD&gt;&lt;TITlE&gt;BNC Stat&lt;/TITLE&gt;&lt;/HEAD&gt;&lt;BODY&gt;"puts index.html "Magus: $magusstat"puts index.html "Maes_Hughes: $maesstat"puts index.html "Gendo_Ikari: $gendostat"puts index.html "Cid_Highwind: $cidstat"puts index.html "LOL: $lolstat&lt;/BODY&gt;&lt;/HTML&gt;"}</code></pre></div>Thanks.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=7412">Sir Edward</a> — Sun Feb 26, 2006 6:53 am</p><hr />
]]></content>
	</entry>
	</feed>
