mIRC Home    About    Download    Register    News    Help

Print Thread
#203330 12/08/08 06:57 AM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline OP
Hoopy frood
OP Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
I've been doing a bit of testing with this, and can't seem to find how to do it. I have messages that I want stored in an ini file, but some of the messages have colour codes in them. Right now the messages are stored in separate text files, and they handle colour codes with no problem.

Is it possible to store the messages in ini format and maintain the colour codes, or is there an alternative that I'm missing.

I'm trying to reduce the number of text files that have to be transferred/updated when I send a copy of the bot to one of the backups.

Joined: Jan 2004
Posts: 2,127
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 2,127
I've seen this issue come up before.
https://forums.mirc.com/ubbthreads.php?ubb=showflat&Number=176128
I'm afraid the only way you can safely put colorcodes into ini's is to either $encode them before writing, or do a search+replace to change them into values that can be written yet won't be appearing in the strings you'll be writing.

Joined: Jun 2008
Posts: 58
P
Babel fish
Offline
Babel fish
P
Joined: Jun 2008
Posts: 58
You don't actually have to use characters that won't appear in the string... and I guess thats not even possible, since text messages from other chatters are not calculable. (I suppose those messages are individually editable? :P)
But if you escape that escaping-character, too, there won't be any problems...
Code:
var %encode = $replacex($1-,&,&1,$chr(3),&2,$chr(15),&3)
var %decode = $replacex($1-,&3,$chr(15),&2,$chr(3),&1,&)

Last edited by Pivo; 12/08/08 12:56 PM.
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline OP
Hoopy frood
OP Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Thanks for the replies. Looks like I might go with $encode/$decode method, as the information is stored on a bot, and, currently, only two people have authorization to change the information.. The channel founder and myself, the bot 'runner'.


Link Copied to Clipboard