mIRC Homepage
Posted By: Hindsight Tokenized version of - 18/06/03 02:24 PM
Im trying to get a tokenized version of $chan($chan).mode but all i get is the spaced version ie: +mnrstlk 1337 leetstuff... I havent been able to separtate it by commas like id like or anything for that matter. Any ideas?
Posted By: codemastr Re: Tokenized version of - 18/06/03 03:26 PM
What?
Posted By: pheonix Re: Tokenized version of - 18/06/03 03:29 PM
he wants a tokenized version of the modes, like
untokenized +mn
tokenized $1 = +, $2 = m, $3 = n << example
but that cant be done without seperateing the modes 1st coz ya cant tokenize +mn
i think thats what he wants he wants anyway smile
Posted By: SladeKraven Re: Tokenized version of - 18/06/03 03:45 PM
I thought he meant;
+mn $+ , 1337, leetstuff.
Posted By: codemastr Re: Tokenized version of - 18/06/03 03:46 PM
Umm well thats not tokens, and he specifically mentioned commas so I doubt thats what he meant.
Posted By: pheonix Re: Tokenized version of - 18/06/03 03:57 PM
i know but he also mentioned tokenize...
Posted By: Hindsight Re: Tokenized version of - 18/06/03 04:11 PM
ya i was thinking like +mnrstlk,1337,leetstuff
Posted By: codemastr Re: Tokenized version of - 18/06/03 04:25 PM
Well I don't know why the way $chan($chan).mode returns it is not good enough, but just use $replace:

$replace($chan($chan).mode,$chr(32),$chr(44))
Posted By: Hindsight Re: Tokenized version of - 18/06/03 04:36 PM
Thanks heh. I didnt know the $chr for space smirk
Posted By: codemastr Re: Tokenized version of - 18/06/03 04:47 PM
Well thats why you need to be like the cool people and have the ASCII table memorized!
Posted By: pheonix Re: Tokenized version of - 18/06/03 05:24 PM
or you can type //echo -a $asc(alt+0160)
Posted By: codemastr Re: Tokenized version of - 18/06/03 05:42 PM
Thats a bad way to do it. You assume everyone uses fixedsys. Thats not the case. Only ASCII characters from 0 through 127 have standard representations. Any character above 127 is an implementation specific character so you can not be guaranteed that it is a space-like character. And btw, why would you type $asc(alt+0160)? If you knew to type alt+0160, then you already know the number of the character, 160.
Posted By: pheonix Re: Tokenized version of - 18/06/03 05:46 PM
cos i didnt know that had anything to do with asci i thought that was just the key for that character =\
Posted By: Hindsight Re: Tokenized version of - 18/06/03 06:08 PM
Ive been trying to find a table for some time. heh you have a link?
Posted By: pheonix Re: Tokenized version of - 18/06/03 06:10 PM
start menu > run > charmap
Posted By: Hindsight Re: Tokenized version of - 18/06/03 06:12 PM
the only problem ive had with that, is it doesnt show the number:/
Posted By: codemastr Re: Tokenized version of - 18/06/03 06:17 PM
www.asciitable.com
Posted By: Hindsight Re: Tokenized version of - 18/06/03 06:19 PM
weeee thanks
Posted By: KingTomato Re: Tokenized version of - 18/06/03 07:42 PM
Charmap does show the number, on the bottom left U+00<number> Though it is in Hex, you can use calc to convert if your not farmiliar. Do view>>scientific, then click the "hex" radio on the left, type the value, then click decimal. >:D
Posted By: codemastr Re: Tokenized version of - 18/06/03 07:43 PM
I think it only shows that in XP and possibly 2k. I don't recall seeing that in 9x.
Posted By: KingTomato Re: Tokenized version of - 18/06/03 07:45 PM
Give, me a sec *boots up old 98se post* i'll tell you in a sec >:D
Posted By: codemastr Re: Tokenized version of - 18/06/03 07:47 PM
I'd check on my WinME machine but apparently MS decided charmap shouldn't be included by default with WinME frown
Posted By: KingTomato Re: Tokenized version of - 18/06/03 07:53 PM
Well, your kinda right. In 98se it shows the keystroke (if listed on the keyboard) and if its not, then shows ascii. If you really want a one for mirc though, I posted one about a coule weeks back that ppl seemed to enjoy.
Code:

/asciitable {
  /window @ascii
  /aline $color(info) @ascii Ascii: $chr(9) Value:
  /aline $color(info) @ascii $str(-, 25)
  /set -u0 %ascii 0
  while (%ascii &lt;= 255) {
    /unset %info
    if (%ascii == 0) /set -u0 %info $+($,NULL)
    else if (%ascii == 2) /set -u0 %info BOLD (Ctrl+B)
    else if (%ascii == 3) /set -u0 %info 12C4OL8OR (Ctrl+K)
    else if (%ascii == 13) /set -u0 %info Enter/Return
    else if (%ascii == 15) /set -u0 %info PLAIN (Ctrl+O)
    else if (%ascii == 22) /set -u0 %info REVERSE (Ctrl+R)
    else if (%ascii == 27) /set -u0 %info Escape
    else if (%ascii == 31) /set -u0 %info UNDERLINE (Ctrl+U)
    else if (%ascii == 32) /set -u0 %info (Space)
    else if (%ascii == 160) /set -u0 %info (Hard Space)
    /aline $color(info) @ascii %ascii $chr(9) $+($chr(%ascii),) $chr(9) %info
    /inc -u0 %ascii
  }
  /aline $color(info) @ascii $str(-, 25)
  /aline $color(info) @ascii Ascii: $chr(9) Value:  
}
© mIRC Discussion Forums