egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Outputting color codes in a dictionary type script

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
cimeran
Voice


Joined: 04 Mar 2011
Posts: 9

PostPosted: Thu Mar 10, 2011 5:50 pm    Post subject: Outputting color codes in a dictionary type script Reply with quote

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
View user's profile Send private message
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Thu Mar 10, 2011 6:13 pm    Post subject: Reply with quote

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
View user's profile Send private message
cimeran
Voice


Joined: 04 Mar 2011
Posts: 9

PostPosted: Thu Mar 10, 2011 11:17 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
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


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber