Ford

utf8 edit

Mar 7th, 2011
354
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.88 KB | None | 0 0
  1. ;$utf8 conversion for mIRC by Ford_Lawnmower irc.mindforge.org #USA-Chat
  2. alias UTF81 {
  3. if ($1 < 161) { return $chr($1) }
  4. elseif ($len($base($1,10,2)) < 12) { return $+($chr($calc(192 + $div($1,64))),$chr($calc(128 + [ $1 % 64 ] ))) }
  5. elseif ($len($base($1,10,2)) < 17) { return $+($chr($calc(224 + $div($1,4096))),$chr($calc(128 + [ $div($1,64) % 64 ] )),$chr($calc(128 + [ $1 % 64 ] ))) }
  6. elseif ($len($base($1,10,2)) < 22) {
  7. return $+($chr($calc(240 + $div($1,262144))),$chr($calc(128 + [ $div($1,4096) % 64 ] )),$chr($calc(128 + [ $div($1,64) % 64 ] )),$&
  8. $chr($calc(128 + [ $1 % 64 ] )))
  9. }
  10. }
  11. alias -l div { return $int($calc($1 / $2)) }
  12. alias UTF8 {
  13. if ($version >= 7) return $chr($1)
  14. else {
  15. var %x $base($1,10,2),%y $len(%x)
  16. if ($1 < 161) { return $chr($1) }
  17. elseif (%y < 12) { return $+($shift(11000000,$left(%x,-6)),$shift(10000000,$right(%x,6))) }
  18. elseif (%y < 17) { return $+($shift(11100000,$left(%x,-12)),$shift(10000000,$mid(%x,-12,6)),$shift(10000000,$right(%x,6))) }
  19. elseif (%y < 22) {
  20. return $+($shift(11110000,$left(%x,-18)),$shift(10000000,$mid(%x,$iif(%y < 18,$+(-,%y),-18),6)),$shift(10000000,$mid(%x,-12,6)),$shift(10000000,$right(%x,6)))
  21. }
  22. }
  23. }
  24. alias -l shift {
  25. if ($2) { return $chr($base($+($left($1,$+(-,$len($2))),$2),2,10)) }
  26. else { return $chr($base($1,2,10)) }
  27. }
  28. alias UrlEncode {
  29. return $regsubex($1-,/([^a-z0-9])/ig,$+(%,$base($UTF8($asc(\t)),10,16,2)))
  30. }
  31. Menu channel,status {
  32. .Text Tricks
  33. ..Fliptext:flip $?="Enter the text to be fliped"
  34. ..Octatext:Octatext $?="Enter the text for Octagon conversion"
  35. }
  36. alias octatext {
  37. var %octa $regsubex($1-,/([a-z])/g,$utf8($calc($asc($regml(\n)) + 9327)))
  38. %octa = $regsubex(%octa,/([A-Z])/g,$utf8($calc($asc($regml(\n)) + 9333)))
  39. $iif($isid,return,$iif($active ischan,say,echo -a)) $regsubex(%octa,/([1-9])/g,$utf8($calc($asc($regml(\n)) + 10063)))
  40. }
  41. alias flip {
  42. var %flip, %end $len($1-)
  43. while (%end) {
  44. %flip = $+(%flip,$replace($mid($1-,%end,1),$chr(32),$chr(7)))
  45. dec %end
  46. }
  47. %flip = $replacex(%flip,a,$utf8(592),b,q,c,$utf8(596),d,p,e,$utf8(601),f,$utf8(607),g,$utf8(595),h,$utf8(613),i,$utf8(618),j,$utf8(638),k,$utf8(670),$&
  48. l,$utf8(305),m,$utf8(623),n,u,o,o,p,d,q,b,r,$utf8(633),s,s,t,$utf8(647),u,n,v,$utf8(652),w,$utf8(653),y,$utf8(654),.,$utf8(729),?,$utf8(191),z,z,$chr(7),$chr(32))
  49. $iif($isid,return,$iif($active ischan,say,echo -a)) %flip
  50. }
  51. alias small {
  52. var %small = $replacex($1-,a,$utf8(7424),b,$utf8(665),c,$utf8(7428),d,$utf8(7429),e,$utf8(7431),f,$utf8(1171),g,$utf8(610),h,$utf8(668),i,$utf8(1110),$&
  53. j,$utf8(7434),k,$utf8(7435),l,$utf8(671),m,$utf8(7437),n,$utf8(628),o,$utf8(7439),p,$utf8(7448),q,$utf8(587),r,$utf8(640),s,$utf8(1109),$&
  54. t,$utf8(7451),u,$utf8(7452),v,$utf8(7456),w,$utf8(7457),x,$utf8(1093),y,$utf8(655),z,$utf8(7458))
  55. $iif($isid,return,$iif($active ischan,say,echo -a)) %small
  56. }
Advertisement
Add Comment
Please, Sign In to add comment