So, this is just a little snippet where, if you type !ascii (symbol) it will give you the ASCII value of that symbol. And, if you !char (number) it will give you the symbol for the given value.
I used the /goto command because I fail at /while's ;x
the purpose for making it is because I use $gettok a lot, and I have to devise the $chr(?) thing.
on *:text:!ascii*:#:{
if (!$2) { msg # Nothing doesn't have an ASCII value, $nick $+ . }
elseif ($len( $2 ) > 1) { msg # I can only find the ASCII of one symbol at a time, not $len( $2 ) symbols. }
else {
:asciistart
inc %ascii#
set %symbol $chr( %ascii# )
if (%symbol == $2) { msg # The ASCII of the symbol " $+ $2 $+ " is %ascii# | unset %ascii# , unset %symbol | halt }
if (%symbol != $2) { goto asciistart }
}
}
on *:text:!char*:#:{
if (!$2) { msg # I can't give you the ASCII result of nothing }
elseif ($2 !isnum) { msg # Give me a number. }
else { msg # $chr( $2 ) }
}