Input $Chr/$decode

By eyiezinc on Jun 24, 2013

maybe usefull for some people in encoding or chr their text

/*
------------------------------------------------------------------------------------------

Addons: Input chr/decode
Author: Lestat 

----------------------------------------------------------------
[Description]
----------------------------------------------------------------
maybe usefull for some user to $encode or use $chr 

-------------------------------------------------------------------------------------------
*/

menu channel,query {
  chr/decode input
  .$iif(%style = normal,$style(1)) Normal:.set %style normal
  .-
  .$iif(%style = sym,$style(1)) chr:.set %style sym
  .-
  .$iif(%style = decode,$style(1)) seperate decode:.set %style decode
  .-
  .$iif(%style = fullcode,$style(1)) Full decode:.set %style fullcode
}
On *:input:*: {
  if ($Left($1-,1) != /) && (!$ctrlenter) { msg $active $iif(%style = normal,$1-,$symx($1-)) | halt }
}
alias symx { 
  var %t = 1
  if (%style = fullcode) { return $+($!decode,$chr(40),$encode($1-,m),$chr(44),m,$chr(41)) | halt }
  while ($iif(%style = sym,$mid($1-,%t,1),$gettok($1-,%t,32))) || ($iif(%style = sym,$mid($1-,%t,1),$gettok($1-,%t,32)) != $null) {
    var %out = $iif(%style = sym,$+(%out,$+($!chr,$chr(40),$asc($mid($1-,%t,1)),$chr(41),$chr(44))),%out $+($!decode,$chr(40),$encode($gettok($1-,%t,32),m),$chr(44),m,$chr(41)))
    inc %t
  }
  return $iif(%style = sym,$+($,+,$chr(40),$left(%out,$calc($len(%out) - 1)),$chr(41)),%out)
}

Comments

Sign in to comment.
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.