Code: Select all
(15:28:18) <Sil0x0000> .tcl utimer 30 [putlog "time!"]
(15:28:18) <^BOT^> [15:28] time!
(15:28:18) <^BOT^> Tcl: timer34
If anyone has an idea pls help....
thanx in advance....

Code: Select all
(15:28:18) <Sil0x0000> .tcl utimer 30 [putlog "time!"]
(15:28:18) <^BOT^> [15:28] time!
(15:28:18) <^BOT^> Tcl: timer34
well... it acts like you tell it to doSil0x0000 wrote:my utimer function seem to act weirdCode: Select all
(15:28:18) <Sil0x0000> .tcl utimer 30 [putlog "time!"] (15:28:18) <^BOT^> [15:28] time! (15:28:18) <^BOT^> Tcl: timer34
Code: Select all
.tcl utimer 10 "putlog $botnick"
Code: Select all
.tcl utimer 10 { putlog "time!" }
Code: Select all
.tcl utimer 10 { putlog "time!" }
Code: Select all
.tcl utimer 10 [list putlog "time!"]
Dropping words like "wrong" and "exploits" around a valid line of tcl is plain incorrect and very sloppy.ppslim wrote:Some of the above examples are wrong, and could lead to exploits if used incorectly.
UsingWhile it would work without exploit, it would produce a error, if he tried to use variable names within it.Code: Select all
.tcl utimer 10 { putlog "time!" }
You should be using
Code: Select all
.tcl utimer 10 [list putlog "time!"]
Code: Select all
utimer 10 { putlog "time!" }
Code: Select all
utimer 10 { putlog "time $testvar" }
Encapsulating the - putlog "time!" - within the {&} 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
}
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.try
.tcl utimer 30 "putlog time!"
or
.tcl utimer 30 \[putlog "time!"\]
Did i mention the first reply? No. What did I say?ppslim wrote:It is you that is incorect my friend.
[snip]
SO yes, you are correct to point this out to me, but only if that first reply to the thread was not posted.
Anyway, I think it is good and helpfull to others that you have elaborated on the "wrong"'s and possible "exploit"'s.Dropping words like "wrong" and "exploits" around a valid line of tcl is plain incorrect and very sloppy.
Yes you did, and by admiting this, you have also contradicted yourself.egghead wrote: Initially, two replies followed: one by hah` and one by egghead.
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.
Code: Select all
.tcl utimer 10 "putlog $botnick"
Code: Select all
utimer 10 { putlog "$arg" }
Code: Select all
[18:50] <^BOT^> [18:45] can't read "arg": no such variable
Code: Select all
bind pub - !test test_proc
and
proc test_proc {nick host hand chan arg}