mIRC Homepage
Posted By: PHMinistries $chr - 27/05/03 01:40 AM
whats the $chr for |

im writing a script to ignore |

whats the $chr for | ?
Posted By: Othello Re: $chr - 27/05/03 01:50 AM
thry this $chr(124)
now if you want to learn more about what stands for what in ascii check out http://www.asciitable.com/
Posted By: _D3m0n_ Re: $chr - 27/05/03 02:13 AM
to find out $chr numbers u can also type //echo -a $asc(LETTER)

it should give u a numeric output of the key u put in the ( )
example //echo -a $asc(|) returns 124

just figured id help u find out how to find them numbers out easier for future reference
Posted By: KingTomato Re: $chr - 27/05/03 02:24 AM
alias asciitable {
/window @ascii
/aline $color(info) @ascii Ascii: $chr(9) Value:
/aline $color(info) @ascii $str(-, 25)
/set -u0 %ascii 0
while (%ascii <= 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:
}

paste in remotes, and simply type /asciitable
Posted By: _D3m0n_ Re: $chr - 27/05/03 02:35 AM
damn thats nice i like that ty
Posted By: KingTomato Re: $chr - 27/05/03 04:03 AM
lol--i liked it so much while i was writing it for them, i kept it myself--lmfao
Posted By: _D3m0n_ Re: $chr - 27/05/03 04:07 AM
hey its nice to find $chr numbers quickly and i like it better than my suggestion ..... if u dont mind id like to use it just for me to run scripts tests ..... it wouldnt ever end up in a released script if it did id give u full credit on it
Posted By: KingTomato Re: $chr - 27/05/03 04:12 AM
heh--go for it >:D Afterall, thats what its written for, for people to use--not look at grin well, amybe to look at too, but only 0% [||---] 100% much
Posted By: c0ldfusi0n Re: $chr - 27/05/03 06:28 AM
Code:
/Chrs {
  if ($1 == list) || ($1 == $null) {
    var %chr = 1
    window @Chr 1 50 120 700
    while (%chr &lt;= 255) { echo $iif($pair(%chr),4,11)) @chr %chr is $chr(%chr) | inc %chr }
  }
  if ($1 isnum) &amp;&amp; ($1 &lt;= 255) {
    echo -a * The ASCII code for " $+ $1 $+ " is $chr($1)
  }
}
/Ascii {
  if ($1 == list) || ($1 == $null) {
    var %asc = 1
    window @asc 1 50 120 700
    while (%asc &lt;= 255) { .echo $iif($pair($asc($chr(%asc))),7,11)) @Asc $chr(%asc) is $asc($chr(%asc)) | inc %asc }
  }
  if ($1 !isnum) &amp;&amp; ($asc($1)) {
    echo -a * ASCII $1 returns $asc($1)
  }
}
pair {
  if ($gettok($calc($1 / 2),2,46) == 5) { return $false }
  else { return $true }
}


Syntax:
/chrs list - lists all $chr
/ascii list - lists all $asc
/ascii <chr> - converts <char> into ascii number
/chrs <ascii> - convers <ascii> into character

Not that KT's wasn't good, but i just though i'd share my own version of it. You can get single characters with it, which is very useful. That goes in aliases, of course.
Posted By: KingTomato Re: $chr - 27/05/03 07:32 AM
umm...
/ascii <char> == $asc(<char>)
/chrs <char> == $chr(<char>)
Posted By: c0ldfusi0n Re: $chr - 27/05/03 09:16 AM
Thats the point, yes.
Posted By: Adrenalin Re: $chr - 27/05/03 12:23 PM

//set -u60 %Temp |
//echo -a $asc(%Temp)

Easy to use smile
Posted By: Adrenalin Re: $chr - 27/05/03 12:35 PM
//echo $asc(|) work fine .. But for $ % ( ) .. other not work ..
Put in the var .. And asc it ..
Posted By: neophyte Re: $chr - 27/05/03 11:46 PM
alias gchr {
var %chr = $1
echo -a $asc(%chr)
}

use that and you won't need to worry about setting any variables.
© mIRC Discussion Forums