You could... write a script for eggdrop that listens for requests for the value of the given variable, and then in php use the socket functions to connect to your script and query whatever values you want and set them as php vars.
But what's wrong with the way you're doing it now?
I don't get it heh. What kind of template are you talking about? Why do you have to use exec? All you're doing is copying the file, use tcl's "file copy" command. Or why don't you have eggdrop create a file with the variables in it, like one per line, and then read it in php?
GodOfSuicide wrote:and how would you do the replacements wcc ?
There are many ways to do it. One way to do it is make a file with on each line the keyword (i.e. the name of the variable) and its value. Every ten minutes or so you read in the file, get the variable name (the keyword) from each line, and then write back the keyword and its up-to-date value back to file.
Btw, it is a good idea to put all variables you want to display under good scrutiny. Many people have variables which contain passwords etc. for use in scripts. Showing *all* the variables will reveal those passwords.
set code "put your code in here"
set code [lreplace [split $code] [lsearch [split $code] "<mybotnick>"] [lsearch [split $code] "<mybotnick>"] $botnick]
puts somefile $code
this is how to replace it in one line..
but if the template is longer i would have to check it line by line, and that one i didn't get...it must be something with while not eof $file ...
well if you put the whole template into $code then it will replace the first occuranse of "<mybotnick>", if it is more than one place in the template you could use regsub -all "<mybotnick>" $code "$botnick" newcode
$newcode will then hold the updated template