This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

ASCII Convertion

Help for those learning Tcl or writing their own scripts.
Post Reply
d
dokueki
Voice
Posts: 31
Joined: Sat Apr 28, 2007 8:42 am
Location: Bat Yam, Israel
Contact:

ASCII Convertion

Post by dokueki »

I got a little question, how do I convert from text to ASCII?
Meaning, i want to show the ascii 9 in the end of a certain message.
In mIRCScript, it's $asc(9) or $chr(9), and I need to find the Tcl equivalent. Thanks in advance!
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

Check out the "scan" and "format" commands. They should be able to perform those tasks, and more.
NML_375
d
dokueki
Voice
Posts: 31
Joined: Sat Apr 28, 2007 8:42 am
Location: Bat Yam, Israel
Contact:

Post by dokueki »

EDIT: Alright, got it :D But it strips the character I need :<
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

Strips? huh?
NML_375
d
dokueki
Voice
Posts: 31
Joined: Sat Apr 28, 2007 8:42 am
Location: Bat Yam, Israel
Contact:

Post by dokueki »

It just... Doesn't let it appear in the message :P I mean, the ASCII character 9 is a blank character, but it triggers a script in mIRCSCript, and well, when I put it in my Eggbot, it doesn't trigger that script for other people when it needs to, which got me to the conclusion that it doesn't make it appear in the message, I'm guessing because it's either an irregular character or because 'tis a blank character. :p
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

If it's always ascii -9, you could try something like this (or however the message should be constructed, \x09 will be replaced with the specified character):

Code: Select all

puthelp "PRIVMSG yournick :blah \x09 bleh"
NML_375
User avatar
CrazyCat
Revered One
Posts: 1304
Joined: Sun Jan 13, 2002 8:00 pm
Location: France
Contact:

Post by CrazyCat »

it's the tab char, can't you try to match \t ?
User avatar
rosc2112
Revered One
Posts: 1454
Joined: Sun Feb 19, 2006 8:36 pm
Location: Northeast Pennsylvania

Post by rosc2112 »

Read here about backslash substitution:
http://www.tcl.tk/man/tcl8.4/TclCmd/Tcl.htm#M15
Post Reply