tglogo.png

Downloading File

Filename: $utf8
;$utf8 conversion for mIRC by Ford_Lawnmower irc.mindforge.org #USA-Chat
alias UTF8 {
  if ($1 < 255) { return $chr($1) }
  if ($1 >= 256) && ($1 < 2048) { return $+($chr($calc(192 + $div($1,64))),$chr($calc(128 + $mod($1,64)))) }
  if ($1 >= 2048) && ($1 < 65536) { return $+($chr($calc(224 + $div($1,4096))),$chr($calc(128 + $mod($div($1,64),64))),$chr($calc(128 + $mod($1,64)))) }
  if ($1 >= 65536) && ($1 < 2097152) {
    return $+($chr($calc(240 + $div($1,262144))),$chr($calc(128 + $mod($div($1,4096),64))),$chr($calc(128 + $mod($div($1,64),64))),$&
      $chr($calc(128 + $mod($1,64))))
  }
}
alias H2U { return $utf8($base($1,16,10)) }
alias -l div { return $int($calc($1 / $2)) }
alias -l mod { return $calc($1 % $2) }
;Examples of use: octatext will display the text you type with octagon letters and Flip will print the text upside-down. 
;Syntax /octatext some text here  -- /Flip some text here
Menu channel,status {
  .Text Tricks
  ..Fliptext:flip $?="Enter the text to be fliped"
  ..Octatext:Octatext $?="Enter the text for Octagon conversion"
}
alias octatext {
  var %octa $regsubex($1-,/([abcdefghijklmnopqrstuvwxyz])/g,$utf8($calc($asc($regml(\n)) + 9327)))
  %octa = $regsubex(%octa,/([ABCDEFGHIJKLMNOPQRSTUVWXYZ])/g,$utf8($calc($asc($regml(\n)) + 9333)))
  $iif($isid,return,$iif($active ischan,say,echo -a)) $regsubex(%octa,/([123456789])/g,$utf8($calc($asc($regml(\n)) + 10063)))
}
alias flip {
  var %flip, %end $len($1-)
  while (%end) {
    %flip = $+(%flip,$replace($mid($1-,%end,1),$chr(32),$chr(7)))
    dec %end
  }
  %flip = $replacex(%flip,a,$h2u(250),b,q,c,$h2u(254),d,p,e,$h2u(259),f,$h2u(25f),g,$h2u(253),h,$h2u(265),i,$h2u(26a),j,$h2u(27e),k,$h2u(29e),$&
    l,$h2u(131),m,$h2u(26f),n,u,o,o,p,d,q,b,r,$h2u(279),s,s,t,$h2u(287),u,n,v,$h2u(28c),w,$h2u(28d),y,$h2u(28e),.,$h2u(2d9),?,$h2u(bf),z,z,$chr(7),$chr(32))
  $iif($isid,return,$iif($active ischan,say,echo -a)) %flip
}

Related Files

by unclerami

Please note that on our website we use cookies necessary for the functioning of our website, cookies that optimize the performance. To learn more about our cookies, how we use them and their benefits, please read our Cookie Policy.
I Understand