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

	<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-22T13:25:07-04:00</updated>

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

		<entry>
		<author><name><![CDATA[r0t3n]]></name></author>
		<updated>2005-06-22T13:25:07-04:00</updated>

		<published>2005-06-22T13:25:07-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=51232#p51232</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=51232#p51232"/>
		<title type="html"><![CDATA[cupbot]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=51232#p51232"><![CDATA[
arrh, thanks Sir_fz and Demond, i will try and fix them myself, but im going thro a rough time atm. I got exams at school, and a relative died 3 weeks ago, and so im really busy. I dont have much time for my tcl scripting, but im trying to make this script for my channel asap, as they have been waiting for this script to be finished. So im underpressure. Thanks for your help!!<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6300">r0t3n</a> — Wed Jun 22, 2005 1:25 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[demond]]></name></author>
		<updated>2005-06-22T13:12:23-04:00</updated>

		<published>2005-06-22T13:12:23-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=51230#p51230</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=51230#p51230"/>
		<title type="html"><![CDATA[cupbot]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=51230#p51230"><![CDATA[
<blockquote class="uncited"><div>if {![matchattr $handle C|C $chan} &amp;&amp; ![matchattr $handle o|o $chan] { </div></blockquote>missing close brace<br><br>why don't you stop posting already such questions and try to concentrate on fixing your syntax errors yourself?<br><br>you are becoming a nuisance<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5056">demond</a> — Wed Jun 22, 2005 1:12 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Sir_Fz]]></name></author>
		<updated>2005-06-22T13:13:13-04:00</updated>

		<published>2005-06-22T13:08:55-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=51229#p51229</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=51229#p51229"/>
		<title type="html"><![CDATA[cupbot]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=51229#p51229"><![CDATA[
I don't know what's your understanding of balanced braces, but you should really understand how braces should be used. Try:<div class="codebox"><p>Code: </p><pre><code>proc make:prize {nick host handle chan text} {  set newprize $text  if {![matchattr $handle C|C $chan] &amp;&amp; ![matchattr $handle o|o $chan]} {   putserv "PRIVMSG $chan :Error: You dont not have access to this command $nick."  } elseif {($cup(cup,$chan) == off) || ($cup(cup,$chan) == "")} {   putserv "PRIVMSG $chan :Error: no cup is running."  } elseif {($newprize == "")} {   putserv "PRIVMSG $chan :Error: no prize was set, use ./!/?setprize prize."  } elseif {[matchattr $handle C|C $chan] || [matchattr $handle o|o $chan] &amp;&amp; ($cup(cup,$chan) == on)} {   set cup(prize,$chan) $newprize   putserv "PRIVMSG $chan :The prize is now: $cup(prize,$chan)   putserv "NOTICE $nick :Done."  } }</code></pre></div>And use spacing when writing a code.<br><br>PS: aside from the invalid structure of the code, it seems that you're using variables that do not exist in the proc. Perhaps they're global, if so then don't forget to globalize them.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3085">Sir_Fz</a> — Wed Jun 22, 2005 1:08 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[r0t3n]]></name></author>
		<updated>2005-06-22T12:46:30-04:00</updated>

		<published>2005-06-22T12:46:30-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=51227#p51227</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=51227#p51227"/>
		<title type="html"><![CDATA[cupbot]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=51227#p51227"><![CDATA[
i made this script earlier today and have been testing it, but there is a error, which i cant seem to fix. The code:<br><div class="codebox"><p>Code: </p><pre><code>proc make:prize {nick host handle chan text} {set newprize $textif {![matchattr $handle C|C $chan} &amp;&amp; ![matchattr $handle o|o $chan] {putserv "PRIVMSG $chan :Error: You dont not have access to this command $nick."} elseif {($cup(cup,$chan) == off)} || ($cup(cup,$chan) == "")} {putserv "PRIVMSG $chan :Error: no cup is running."} elseif {($newprize == "")} {putserv "PRIVMSG $chan :Error: no prize was set, use ./!/?setprize prize."} elseif {[matchattr $handle C|C $chan] || [matchattr $handle o|o $chan] &amp;&amp; ($cup(cup,$chan) == on) {set cup(prize,$chan) $newprizeputserv "PRIVMSG $chan :The prize is now: $cup(prize,$chan)putserv "NOTICE $nick :Done."}}</code></pre></div>The error: <br><br><br>[17:44] CUPBOT.TCL SCRIPT LOADED!!<br>[17:44] Tcl error in file 'eggdrop.conf':<br>[17:44] wrong # args: should be "proc name args body"<br>    while executing<br>"proc make:prize {nick host handle chan text} {<br>set newprize $text<br>if {![matchattr $handle C|C $chan} &amp;&amp; ![matchattr $handle o|o $chan] {<br>putserv "PRIV..."<br>    (file "scripts/cupbot.tcl" line 116)<br>    invoked from within<br>"source scripts/cupbot.tcl"<br>    (file "eggdrop.conf" line 1329)<br>[17:44] * CONFIG FILE NOT LOADED (NOT FOUND, OR ERROR)<br><br>C:\Documents and Settings\Chris\Desktop\eggdrops\eggy2&gt;pause<br>Press any key to continue . . .<br><br>I cant seem to fix it, please help!!<br><br>Thanks in advance!! <br><br>also as you can see, the file system for the cupbot seemed to hard, so i went to vars.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6300">r0t3n</a> — Wed Jun 22, 2005 12:46 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[demond]]></name></author>
		<updated>2005-06-21T17:22:25-04:00</updated>

		<published>2005-06-21T17:22:25-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=51212#p51212</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=51212#p51212"/>
		<title type="html"><![CDATA[cupbot]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=51212#p51212"><![CDATA[
extract the list element you need, using [lindex]<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5056">demond</a> — Tue Jun 21, 2005 5:22 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[r0t3n]]></name></author>
		<updated>2005-06-21T17:12:52-04:00</updated>

		<published>2005-06-21T17:12:52-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=51210#p51210</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=51210#p51210"/>
		<title type="html"><![CDATA[cupbot]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=51210#p51210"><![CDATA[
i read that basic file operations, and what you said about not using the internal "get" command or whatever that is. The script i made worked, but replyed to the channel as: {#channel prize here}<br>How can i make it so it replies without the brackets and the channel name.<br>Thanks in advance!!<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6300">r0t3n</a> — Tue Jun 21, 2005 5:12 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[demond]]></name></author>
		<updated>2005-06-21T13:22:35-04:00</updated>

		<published>2005-06-21T13:22:35-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=51193#p51193</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=51193#p51193"/>
		<title type="html"><![CDATA[cupbot]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=51193#p51193"><![CDATA[
you didn't bother to read my remarks on your approach to Tcl scripting, or did you?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5056">demond</a> — Tue Jun 21, 2005 1:22 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[r0t3n]]></name></author>
		<updated>2005-06-21T13:01:24-04:00</updated>

		<published>2005-06-21T13:01:24-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=51190#p51190</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=51190#p51190"/>
		<title type="html"><![CDATA[cupbot]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=51190#p51190"><![CDATA[
erm, rather good, got most of it working, just need help on this !prize script, there is a error, and it does find the prize in the cupprize.db, my mate on irc said the script is correct, but he doesnt know the problem.<br>Can anyone help make a script to read a certain line from cupprize.db which a -string match *$chan* blah blah etc. Erm, i would post the !prize script, but i deleted it because it didnt work. Please help!!<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6300">r0t3n</a> — Tue Jun 21, 2005 1:01 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[fajja]]></name></author>
		<updated>2005-06-20T14:57:51-04:00</updated>

		<published>2005-06-20T14:57:51-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=51125#p51125</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=51125#p51125"/>
		<title type="html"><![CDATA[cupbot]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=51125#p51125"><![CDATA[
hello, hows the cupbot coming along? come across anymore problems? i can test itfor u if u want<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6205">fajja</a> — Mon Jun 20, 2005 2:57 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Galadhrim]]></name></author>
		<updated>2005-06-18T11:45:30-04:00</updated>

		<published>2005-06-18T11:45:30-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=51015#p51015</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=51015#p51015"/>
		<title type="html"><![CDATA[cupbot]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=51015#p51015"><![CDATA[
nor the way to ask for help. RTFM  <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_eek.gif" width="15" height="15" alt=":shock:" title="Shocked"><br><br>its like asking ur mom for presents she cant even afford.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2999">Galadhrim</a> — Sat Jun 18, 2005 11:45 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[demond]]></name></author>
		<updated>2005-06-17T22:26:04-04:00</updated>

		<published>2005-06-17T22:26:04-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=50992#p50992</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=50992#p50992"/>
		<title type="html"><![CDATA[cupbot]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=50992#p50992"><![CDATA[
you expect someone to run and debug that for you, without you bothering to test it yourself first? heh<br><br>that's not the way to learn Tcl/eggdrop scripting dude<br><br>anyway, some hints:<ul><li> \$prize means your bind command is '$prize', which is probably not what you had in mind ($prize as variable)</li><li> your 'while' command is incorrect, use curly braces to enclose condition, not parenthesis</li><li> don't use built-in command's name ([gets]) as variable, this is bad practice</li><li> you try to use the file descriptor variable itself ([lindex $fs 0]) as data, which is nonsense</li><li> format your scripts using indentation, one statement per line</li></ul>IMO, you are too lazy to bother trying to learn Tcl starting with simple and basic things first - you want to somehow jump writing complete and functional scripts, with others testing and debugging your stuff while you wait - as I said, this is not the way of becoming a scripter<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5056">demond</a> — Fri Jun 17, 2005 10:26 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[r0t3n]]></name></author>
		<updated>2005-06-17T19:00:44-04:00</updated>

		<published>2005-06-17T19:00:44-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=50988#p50988</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=50988#p50988"/>
		<title type="html"><![CDATA[cupbot]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=50988#p50988"><![CDATA[
so<br><div class="codebox"><p>Code: </p><pre><code>bind pub - \$prize get:prizeproc get:prize {nick host hand chan args} {set fs [open "cupprize.db" r]set prize ""while (![eof $fs]) { set gets [gets $fs]if {[lindex $fs 0] = "$chan"} { set prize [lrange $fs 1 end] } } if {($prize == "")} { putserv "PRIVMSG $chan :No Prize Is Set..." } else { putserv "PRIVMSG $chan :The Cup Prize Is: $prize." }}</code></pre></div>Would that work, please check, Thanks!!<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6300">r0t3n</a> — Fri Jun 17, 2005 7:00 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[De Kus]]></name></author>
		<updated>2005-06-17T18:14:13-04:00</updated>

		<published>2005-06-17T18:14:13-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=50976#p50976</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=50976#p50976"/>
		<title type="html"><![CDATA[cupbot]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=50976#p50976"><![CDATA[
you can read it like you wrote it. however if you want to save more than 1 price at the same time, I would recommned you use a list which you can read and write to you file.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2382">De Kus</a> — Fri Jun 17, 2005 6:14 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[r0t3n]]></name></author>
		<updated>2005-06-17T17:55:48-04:00</updated>

		<published>2005-06-17T17:55:48-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=50972#p50972</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=50972#p50972"/>
		<title type="html"><![CDATA[cupbot]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=50972#p50972"><![CDATA[
ok, i know how to write to cupprize.db but i dont know how to read from it.<br>i made a custom C flag for cupadmin<br><div class="codebox"><p>Code: </p><pre><code>bind pub oC|oC !setprize cup:prizeproc cup:prize {nick host handle chan text} {global lastbindset cupprize [lindex [split $text] end]if {![matchattr $handle o|o $chan] &amp;&amp; ![matchattr $handle C|C $chan]} {putserv "NOTICE $nick :Error: You dont not have access to this command, +o or +C flag needed on $chan."} elseif {[$cupprize == ""]} {putserv "NOTICE $nick :Error: No prize was set, use $lastbind prize"} elseif {[matchattr $handle o|o $chan] || [matchattr $handle C|C $chan] &amp;&amp; [$cupprize != ""]} {set fs [open "cupprize.db" w]puts $fs "$chan $cupprize"close $fsputserv "NOTICE $nick :Done, Cupprize set to: $cupprize."putserv "PRIVMSG $chan :Cupprize has been set by $nick, Prize: $cupprize."}}</code></pre></div>I hope that works, please check. But how can i read that info and display it to a channel from a !prize proc ;p please help, thanks!!<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=6300">r0t3n</a> — Fri Jun 17, 2005 5:55 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[demond]]></name></author>
		<updated>2005-06-17T16:38:20-04:00</updated>

		<published>2005-06-17T16:38:20-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=50967#p50967</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=50967#p50967"/>
		<title type="html"><![CDATA[cupbot]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=50967#p50967"><![CDATA[
this is a help forum for people who bother to search and read (for example <a href="http://forum.egghelp.org/viewtopic.php?t=6885" class="postlink">Basic File Operations</a>) before crying out loud for help<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=5056">demond</a> — Fri Jun 17, 2005 4:38 pm</p><hr />
]]></content>
	</entry>
	</feed>
