To simplify the use of the script im writing, i want the user to be able to have total control over the output. To make this possible i want the user to able to define how the output should look using a global variable and then simply put some kind of marker (or variable) in the output string where the dynamic data will be put.
An example:
# In this string $dynamic could be placed wherever the user wants, and the rest could be whatever text the user want
set mystring "hello $dynamic eat more eggdrop soup"
proc output_something {some_arg somechan} {
global mystring
set dynamic $some_arg
putserv "$somechan :$mystring"
}
You see the problem. This will of course make the bot to puke. So if i could prevent $dynamic from being evaluated the first time it will work fine.
Im just not sure if its doable. If it is, the solution eludes me.
So can it be done? If not, can someone think of another way to achieve the result i want?
Someone must have spent some mindwork on this kind of problem before...