| View previous topic :: View next topic |
| Author |
Message |
cimeran Voice
Joined: 04 Mar 2011 Posts: 9
|
Posted: Thu Mar 10, 2011 5:50 pm Post subject: Outputting color codes in a dictionary type script |
|
|
Please note: I fixed this error by stripping curly braces from the definitions before they were output by the bot....
Howdy all. I'm using this http://www.egghelp.org/tclhtml/3478-4-0-0-1-eggdb.htm script to do simple getting/setting of messages. Trying like the dickens to set a message to use some color like so:
!learn test One word is \002bold\002 and \00312some are in\003 color.
But when it gets echoed back it literally prints the backslashes and numbers rather than formatting the message. The script speaks thusly:
putserv "privmsg $target :$msg"
So it seems like it should end up bolded, in color, whatever. Any ideas?
Thanks in advance. |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Thu Mar 10, 2011 6:13 pm Post subject: |
|
|
There is no substitution done on the entered text, neither is there of the contents of $msg in that line of code you posted. Thus, \002 will be printed literally, and not the control-codes you expected.
You could use the "subst" command to force another iteration of substitutions, though you'll have to be careful to not introduce remote exploits (make sure you use -nocommands -novariables for starters).
Also, this script has a few issues with mixed lists and strings, though I don't think these will affect the use of "subst". _________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
cimeran Voice
Joined: 04 Mar 2011 Posts: 9
|
Posted: Thu Mar 10, 2011 11:17 pm Post subject: |
|
|
Thanks for the information. I've solved the problem, but as I get more comfy in tcl I'll try to address the issues you mention.
| nml375 wrote: | There is no substitution done on the entered text, neither is there of the contents of $msg in that line of code you posted. Thus, \002 will be printed literally, and not the control-codes you expected.
You could use the "subst" command to force another iteration of substitutions, though you'll have to be careful to not introduce remote exploits (make sure you use -nocommands -novariables for starters).
Also, this script has a few issues with mixed lists and strings, though I don't think these will affect the use of "subst". |
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|