mIRC Home    About    Download    Register    News    Help

Print Thread
$chr #26277 27/05/03 01:40 AM
Joined: Dec 2002
Posts: 174
P
PHMinistries Offline OP
Vogon poet
OP Offline
Vogon poet
P
Joined: Dec 2002
Posts: 174
whats the $chr for |

im writing a script to ignore |

whats the $chr for | ?

Re: $chr #26278 27/05/03 01:50 AM
Joined: Dec 2002
Posts: 417
O
Othello Offline
Fjord artisan
Offline
Fjord artisan
O
Joined: Dec 2002
Posts: 417
thry this $chr(124)
now if you want to learn more about what stands for what in ascii check out http://www.asciitable.com/




Intelligence: It's better to ask a stupid question, then to prove it by not asking....
Re: $chr #26279 27/05/03 02:13 AM
Joined: Dec 2002
Posts: 1,527
_
_D3m0n_ Offline
Hoopy frood
Offline
Hoopy frood
_
Joined: Dec 2002
Posts: 1,527
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


D3m0nnet.com
Re: $chr #26280 27/05/03 02:24 AM
Joined: Jan 2003
Posts: 3,012
KingTomato Offline
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
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


-KingTomato
Re: $chr #26281 27/05/03 02:35 AM
Joined: Dec 2002
Posts: 1,527
_
_D3m0n_ Offline
Hoopy frood
Offline
Hoopy frood
_
Joined: Dec 2002
Posts: 1,527
damn thats nice i like that ty


D3m0nnet.com
Re: $chr #26282 27/05/03 04:03 AM
Joined: Jan 2003
Posts: 3,012
KingTomato Offline
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
lol--i liked it so much while i was writing it for them, i kept it myself--lmfao


-KingTomato
Re: $chr #26283 27/05/03 04:07 AM
Joined: Dec 2002
Posts: 1,527
_
_D3m0n_ Offline
Hoopy frood
Offline
Hoopy frood
_
Joined: Dec 2002
Posts: 1,527
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


D3m0nnet.com
Re: $chr #26284 27/05/03 04:12 AM
Joined: Jan 2003
Posts: 3,012
KingTomato Offline
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
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


-KingTomato
Re: $chr #26285 27/05/03 06:28 AM
Joined: Mar 2003
Posts: 272
C
c0ldfusi0n Offline
Fjord artisan
Offline
Fjord artisan
C
Joined: Mar 2003
Posts: 272
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.


- cF
Dedicated helper for rent.
Re: $chr #26286 27/05/03 07:32 AM
Joined: Jan 2003
Posts: 3,012
KingTomato Offline
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
umm...
/ascii <char> == $asc(<char>)
/chrs <char> == $chr(<char>)


-KingTomato
Re: $chr #26287 27/05/03 09:16 AM
Joined: Mar 2003
Posts: 272
C
c0ldfusi0n Offline
Fjord artisan
Offline
Fjord artisan
C
Joined: Mar 2003
Posts: 272
Thats the point, yes.


- cF
Dedicated helper for rent.
Re: $chr #26288 27/05/03 12:23 PM
Joined: Apr 2003
Posts: 414
Adrenalin Offline
Fjord artisan
Offline
Fjord artisan
Joined: Apr 2003
Posts: 414

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

Easy to use smile


mIRC Chm Help 6.16.0.3 Full Anchored!
Re: $chr #26289 27/05/03 12:35 PM
Joined: Apr 2003
Posts: 414
Adrenalin Offline
Fjord artisan
Offline
Fjord artisan
Joined: Apr 2003
Posts: 414
//echo $asc(|) work fine .. But for $ % ( ) .. other not work ..
Put in the var .. And asc it ..


mIRC Chm Help 6.16.0.3 Full Anchored!
Re: $chr #26290 27/05/03 11:46 PM
Joined: Apr 2003
Posts: 426
neophyte Offline
Fjord artisan
Offline
Fjord artisan
Joined: Apr 2003
Posts: 426
alias gchr {
var %chr = $1
echo -a $asc(%chr)
}

use that and you won't need to worry about setting any variables.


--------
mIRC - fun for all the family (except grandma and grandpa)