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

	<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>2002-10-26T14:14:17-04:00</updated>

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

		<entry>
		<author><name><![CDATA[stdragon]]></name></author>
		<updated>2002-10-26T14:14:17-04:00</updated>

		<published>2002-10-26T14:14:17-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=12416#p12416</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=12416#p12416"/>
		<title type="html"><![CDATA[utimer problem]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=12416#p12416"><![CDATA[
Tcl does not evaluate strings inside { }. So your $arg wasn't being substituted. Use [list putlog "$arg"] as ppslim suggested earlier.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8">stdragon</a> — Sat Oct 26, 2002 2:14 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2002-10-26T13:10:57-04:00</updated>

		<published>2002-10-26T13:10:57-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=12411#p12411</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=12411#p12411"/>
		<title type="html"><![CDATA[utimer problem]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=12411#p12411"><![CDATA[
NOT that i want to say that egghead isn't true, i do need some help on using $var's in a utimer<br><br>when i do: <div class="codebox"><p>Code: </p><pre><code>utimer 10 { putlog "$arg" }</code></pre></div>it tells me that $arg can't be readed...<div class="codebox"><p>Code: </p><pre><code>[18:50] &lt;^BOT^&gt; [18:45] can't read "arg": no such variable</code></pre></div>*) $arg was a var wich is binded to the proc's arguments when using:<div class="codebox"><p>Code: </p><pre><code>bind pub - !test test_procandproc test_proc {nick host hand chan arg}</code></pre></div>thanx in advance... <br>(sorry that i ask this after ur discussion)<p>Statistics: Posted by Guest — Sat Oct 26, 2002 1:10 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ppslim]]></name></author>
		<updated>2002-10-24T09:08:01-04:00</updated>

		<published>2002-10-24T09:08:01-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=12292#p12292</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=12292#p12292"/>
		<title type="html"><![CDATA[utimer problem]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=12292#p12292"><![CDATA[
If we are arguing over tit-for-tat, that is fine by me. <br><br>I could have quoted to heaven and hell on this post.<br><blockquote class="uncited"><div>Initially, two replies followed: one by hah` and one by egghead. <br><br>Then your reply followed where you decided to quote a valid line of tcl out of egghead's reply, which explicitly solved sil0x0000's problem.</div></blockquote>Yes you did, and by admiting this, you have also contradicted yourself.<br><br>In your first reply to the thread, you give 2 examples. The first example shows bad programing practice (using a variable, which I am coming up to in a min). The second, showed a exect solution to that particular problem.<br><br>However, solving one problem like this, can lead to more problems later on. What if he had wanted to use variables? The second solution would have left him stumped with a error, the first would have been bad practice as it could <em class="text-italics">possibily</em> turn into a exploit.<br><br>While I tried to get accross a point regarding variable names, I didn't use a variable in the example. Yes, I should have included one, but it's probably better to forget the variable in the example, than to use a variable in an incorrect way!<br><br>My actual goal, had not been to point out to the original poster. I had actualy replied, with a goal of alerting people giving examples (as you had done), that using such practice is incorrect and potentialy dangerous.<br><br>You state it's extreamly sloppy to post remarks about <em class="text-italics">wrong</em> and <em class="text-italics">exploits</em>. Yes, it msot probably was, but it doesn't chnage my mind regarding what I posted.<br><br>using timer and utimer in such a way, is a potential exploit. If you can teach a user the correct way before they find out there can be a issue, it's far better.<br><br>I have learned several languages in my life. Of which, I learned the proper way to use a certain few commands, that could potentialy lead to exlpoits. Now tell the truth here, if you had learned Tcl, not knowing at all about the issues that timer and utimer (taking eggdrop as an example, it's easier) can cause. One day you would have had the issue of the exlpoit, ok, simpel to replace and fix, but would you have understood why it happens when it's explained to you?<br><br>If your taught the propper way first way, with a warning of a potential exploit, you very quickly learn, how you should handle things later on.<br><br>You say my wording was sloppy, then yes it was. Though, you would have to admit, that if I said your code was sloppy, it is.<br><br>As stated, in your very first example<div class="codebox"><p>Code: </p><pre><code>.tcl utimer 10 "putlog $botnick"</code></pre></div>Now what you didn't know, is his botnick is "[die]" (example, just follow me here). If he used that code to test in the future, he would be back here trying his bot crashed (no offence).<br><br>This is the point I made, even if it was wrong to say it the way I did.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2">ppslim</a> — Thu Oct 24, 2002 9:08 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[egghead]]></name></author>
		<updated>2002-10-24T07:00:19-04:00</updated>

		<published>2002-10-24T07:00:19-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=12284#p12284</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=12284#p12284"/>
		<title type="html"><![CDATA[utimer problem]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=12284#p12284"><![CDATA[
Ppslim,<br><br>sil0x0000 posted a question about ".tcl utimer 30 [putlog "time!"] ". It didn't include variables or a bind PUB context or anything.<br><br>Initially, two replies followed: one by hah` and one by egghead.<br><br>Then your reply followed where you decided to quote a valid line of tcl out of egghead's reply, which explicitly solved sil0x0000's problem. <br><br>No context was given, no other line was quoted.<br><br>Above and below that quoted line you dropped words like "wrong" and "exploit".<br><br>In my view that is a plain incorrect and sloppy thing to do! <br><br>The fact that your second reply was much, much longer, proves this point.<br><br>But now you answered:<br><blockquote class="uncited"><div>It is you that is incorect my friend.<br><br>[snip]<br><br>SO yes, you are correct to point this out to me, but only if that first reply to the thread was not posted.</div></blockquote>Did i mention the first reply? No. What did I say?<br><blockquote class="uncited"><div>Dropping words like "wrong" and "exploits" around a valid line of tcl is plain incorrect and very sloppy. </div></blockquote>Anyway, I think it is good and helpfull to others that you have elaborated on the "wrong"'s and possible "exploit"'s. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_razz.gif" width="15" height="15" alt=":P" title="Razz"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=282">egghead</a> — Thu Oct 24, 2002 7:00 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ppslim]]></name></author>
		<updated>2002-10-24T04:50:55-04:00</updated>

		<published>2002-10-24T04:50:55-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=12270#p12270</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=12270#p12270"/>
		<title type="html"><![CDATA[utimer problem]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=12270#p12270"><![CDATA[
It is you that is incorect my friend.<br><br>While it is true, that using<div class="codebox"><p>Code: </p><pre><code>utimer 10 { putlog "time!" }</code></pre></div>is not wrong. This is value and would work.<br><div class="codebox"><p>Code: </p><pre><code>utimer 10 { putlog "time $testvar" }Encapsulating the - putlog "time!" - within the {&amp;} brackets, makes a manualy created list, in which, variables are not evaluated, before going off for processing by the utimer command. As such, when the timer is eventauly called, the Tcl interpreter will then try and evaluate the variable. If there is no global scope for this var, it cuases an error.Thus, you need to pass a list to the timer command, that isn't effected by this. Ising the list command, will do this for him.The exlpoit I talked of, uses exactly the same priciple, but using a different method of passing arguments to the script.[code]bind pub - "!test" pub:test:proc pub:test {nick uh hand chan arg} {  utimer 10 "putlog $arg"  #or - utimer 10 "putlog [lindex $arg 0]" - as many like to do, when they don't know lists}</code></pre></div>Simply typing "!test [die]" to the channel, will kill this bot. As the [die] command is being passed in excaped.<br><br>Enclosing the command in a list (using list) will prevent this sort of evaluation.<br><br>While the above is not wrong (as you pointed out), it is incorrect.<br><br>Hoever, the following was also posted, and is <strong class="text-strong">wrong</strong><br><blockquote class="uncited"><div>try <br>.tcl utimer 30 "putlog time!" <br>or <br>.tcl utimer 30 \[putlog "time!"\]</div></blockquote>The first one would work, as only one word is being passed to the putlog command. As soon as you add a second, without encapsulating it into one string, in any way, you have a "putlog called with too many arguements" error. This incorrect.<br><br>The wrong item, is the second. It is the equililant of passing 3 arguements (rather than 2) to utimer. You would also receive a "extra characters after close quote" error, because of the last \].<br><br>The differance between wrong and incorrect are large. If it is incorrect, then it allready works, it's just the output may produce undesired effects (the first example wouldn't, but you add a single var to the equasion). Wrong, is simply when it doesn't work, and can't work.<br><br>SO yes, you are correct to point this out to me, but only if that first reply to the thread was not posted.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2">ppslim</a> — Thu Oct 24, 2002 4:50 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[egghead]]></name></author>
		<updated>2002-10-23T17:37:51-04:00</updated>

		<published>2002-10-23T17:37:51-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=12250#p12250</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=12250#p12250"/>
		<title type="html"><![CDATA[utimer problem]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=12250#p12250"><![CDATA[
<blockquote class="uncited"><div>Some of the above examples are wrong, and could lead to exploits if used incorectly.<br><br>Using<div class="codebox"><p>Code: </p><pre><code>.tcl utimer 10 { putlog "time!" }</code></pre></div>While it would work without exploit, it would produce a error, if he tried to use variable names within it.<br><br>You should be using<br><div class="codebox"><p>Code: </p><pre><code>.tcl utimer 10 [list putlog "time!"]</code></pre></div></div></blockquote>Dropping words like "wrong" and "exploits" around a valid line of tcl is plain incorrect and very sloppy.<br><br>It would have helped, if you had pointed out precisely and accurately what is "wrong" or "exploit"able. But now just another unexplained workaround is introduced.<br> <br>Additionally, the point you are trying to make with using "variable names", does not show up in the example you gave.<br><br>Mystifications by dropping words like "wrong" and "exploit" does not help scripters to improve quality of their scripts.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=282">egghead</a> — Wed Oct 23, 2002 5:37 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ppslim]]></name></author>
		<updated>2002-10-23T14:04:54-04:00</updated>

		<published>2002-10-23T14:04:54-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=12239#p12239</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=12239#p12239"/>
		<title type="html"><![CDATA[utimer problem]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=12239#p12239"><![CDATA[
Some of the above examples are wrong, and could lead to exploits if used incorectly.<br><br>Using<div class="codebox"><p>Code: </p><pre><code>.tcl utimer 10 { putlog "time!" }</code></pre></div>While it would work without exploit, it would produce a error, if he tried to use variable names within it.<br><br>You should be using<br><div class="codebox"><p>Code: </p><pre><code>.tcl utimer 10 [list putlog "time!"]</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2">ppslim</a> — Wed Oct 23, 2002 2:04 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2002-10-23T09:53:10-04:00</updated>

		<published>2002-10-23T09:53:10-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=12231#p12231</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=12231#p12231"/>
		<title type="html"><![CDATA[utimer problem]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=12231#p12231"><![CDATA[
Thanx <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><br>Both helped the same way <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br>TCL is still a bit confusing language sometimes....<br><br>Gr Xander...<br><br><br>btw Why does my syntax work on a timer and not on a utimer?<p>Statistics: Posted by Guest — Wed Oct 23, 2002 9:53 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[egghead]]></name></author>
		<updated>2002-10-23T09:46:45-04:00</updated>

		<published>2002-10-23T09:46:45-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=12230#p12230</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=12230#p12230"/>
		<title type="html"><![CDATA[utimer problem]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=12230#p12230"><![CDATA[
In ".tcl utimer 30 [putlog "time!"]", tcl will substitute all variables and execute all commands immediately where appropriate. The result will be used when the timer expires.<br><br>Note that utimer needs a command as the second argument. An example is:<br><div class="codebox"><p>Code: </p><pre><code>.tcl utimer 10 "putlog $botnick"</code></pre></div>or <br><div class="codebox"><p>Code: </p><pre><code>.tcl utimer 10 { putlog "time!" }</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=282">egghead</a> — Wed Oct 23, 2002 9:46 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2002-10-23T09:45:07-04:00</updated>

		<published>2002-10-23T09:45:07-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=12229#p12229</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=12229#p12229"/>
		<title type="html"><![CDATA[Re: utimer problem]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=12229#p12229"><![CDATA[
<blockquote class="uncited"><div>my utimer function seem to act weird<div class="codebox"><p>Code: </p><pre><code>(15:28:18) &lt;Sil0x0000&gt; .tcl utimer 30 [putlog "time!"](15:28:18) &lt;^BOT^&gt; [15:28] time!(15:28:18) &lt;^BOT^&gt; Tcl: timer34</code></pre></div></div></blockquote>well... it acts like you tell it to do <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=";)" title="Wink"><br>... the [] are expanded as they're read, i.e. at the time parsing the line... and the result is used as the command for utimer (which is ""). <br><br>try <br>.tcl utimer 30 "putlog time!"<br>or <br>.tcl utimer 30 \[putlog "time!"\]<p>Statistics: Posted by Guest — Wed Oct 23, 2002 9:45 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2002-10-23T09:34:04-04:00</updated>

		<published>2002-10-23T09:34:04-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=12227#p12227</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=12227#p12227"/>
		<title type="html"><![CDATA[utimer problem]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=12227#p12227"><![CDATA[
my utimer function seem to act weird, i dunno if anyone has notice this before, but my utimer doesn't wait till the time has been past, but executes the proc emidiately. Look at the following piece of my log file, where i start a utimer (30 sec) from the console(dcc).<br><div class="codebox"><p>Code: </p><pre><code>(15:28:18) &lt;Sil0x0000&gt; .tcl utimer 30 [putlog "time!"](15:28:18) &lt;^BOT^&gt; [15:28] time!(15:28:18) &lt;^BOT^&gt; Tcl: timer34</code></pre></div>U see i start a utimer for 30 seconds wich has to put "time!" into the log... but it does respond emediatly as u see at the log time...<br>If anyone has an idea pls help....<br><br>thanx in advance.... <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><p>Statistics: Posted by Guest — Wed Oct 23, 2002 9:34 am</p><hr />
]]></content>
	</entry>
	</feed>
