Convert Characters to ASC codes

By G13AoUsTiS on Mar 16, 2008

A Very Simple Thing. I Will update it to work with more thatn one words
Trigger:
/convert

you can edit it to work on a bot.

ENJOY!

alias tchrt {
  var %y = $len($1-)
  var %x = 1 
  set %chr $left($1,1)
  while %y {
    set %chr %chr $left($remove($1,$left($1,%x)),1) 
    inc %x
    dec %y
  }
}

alias chrise {
  var %y = 1
  var %x = $numtok(%chr,32)
  while %x {
    set %asc %asc "4 $+ $gettok(%chr,%y,32) $+ ":2 $asc($gettok(%chr,%y,32))
    inc %y
    dec %x
  }
  echo -a %asc
  unset %chr 
  unset %asc
}

alias convert { tchrt $1- | chrise }

Comments

Sign in to comment.
G13AoUsTiS   -  Mar 18, 2008

thanks mountaindew:)

 Respond  
guest598594   -  Mar 17, 2008

$asc(,) == 44

$chr(44) == ,

useful for like $chr(32) = space or $chr(160) = hardspace

also, in gettok, you need a delimeter

$gettok(string.with.delimeters.of.period,2,46) with

46 is $asc(.) which is seperating the string

 Respond  
Eugenio   -  Mar 17, 2008

LMAO Napa you just confused me even more...........what is the ascii number of a character ?!?

 Respond  
napa182   -  Mar 17, 2008

ASC is the the ascii number of a character

 Respond  
DemonicDerek666   -  Mar 17, 2008

can you exsplain to me what ASC code is?

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.