$utf8 + upsidedown and octatext

By FordLawnmower on Aug 02, 2009

Image
This alias will convert the decimal number associated with a utf-8 image to the ascii combinations needed to display it in mIRC. I have no idea why this isn't already included in mIRC ;/
The modular division and binary math needed to do this conversion would require several pages to explain, so I'm not going to bore you with that. If someone would like to discuss the math involved here, please see me in irc.

To make sure utf8 is enabled on your mIRC - Do this first:
Go to Tools - Options - IRC - Messages
Make sure The 6 boxes at the bottom are checked.
Image
If you still are seeing ??? question marks, Right click the channel, on the treebar or the channel box at the bottom/top and click Font.
Under utf8 select Display & Encode.
Image

How to use this?

I included 3 basic aliases to demonstrate how to use $utf8
The first one will print your text upsidedown and backwards.
Syntax /flip text or $flip(text)
And the second will print the letters and numbers inside a octagon.
Syntax /Octatext text or $octatext(text)

New alias added /small
Syntax /small text or $small(text)

;$utf8 conversion for mIRC by Ford_Lawnmower irc.mindforge.org #USA-Chat
alias UTF81 {
  if ($1 < 161) { return $chr($1) }
  elseif ($len($base($1,10,2)) < 12) { return $+($chr($calc(192 + $div($1,64))),$chr($calc(128 + [ $1 % 64 ] ))) }
  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 ] ))) }
  elseif ($len($base($1,10,2)) < 22) {
    return $+($chr($calc(240 + $div($1,262144))),$chr($calc(128 + [ $div($1,4096) % 64 ] )),$chr($calc(128 + [ $div($1,64) % 64 ] )),$&
      $chr($calc(128 + [ $1 % 64 ] )))
  }
}
alias -l div { return $int($calc($1 / $2)) }
alias UTF8 {
  if ($version >= 7) return $chr($1)
  else {
    var %x $base($1,10,2),%y $len(%x)
    if ($1 < 161) { return $chr($1) }
    elseif (%y < 12) { return $+($shift(11000000,$left(%x,-6)),$shift(10000000,$right(%x,6))) }
    elseif (%y < 17) { return $+($shift(11100000,$left(%x,-12)),$shift(10000000,$mid(%x,-12,6)),$shift(10000000,$right(%x,6))) }
    elseif (%y < 22) {
      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)))
    }
  }
}
alias -l shift {
  if ($2) { return $chr($base($+($left($1,$+(-,$len($2))),$2),2,10)) }
  else { return $chr($base($1,2,10)) }
}
alias UrlEncode {
  return $regsubex($1-,/([^a-z0-9])/ig,$+(%,$base($UTF8($asc(\t)),10,16,2)))
}
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-,/([a-z])/g,$utf8($calc($asc($regml(\n)) + 9327)))
  %octa = $regsubex(%octa,/([A-Z])/g,$utf8($calc($asc($regml(\n)) + 9333)))
  $iif($isid,return,$iif($active ischan,say,echo -a)) $regsubex(%octa,/([1-9])/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,$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),$&
    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))
  $iif($isid,return,$iif($active ischan,say,echo -a)) %flip
}
alias small {
  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),$&
    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),$&
    t,$utf8(7451),u,$utf8(7452),v,$utf8(7456),w,$utf8(7457),x,$utf8(1093),y,$utf8(655),z,$utf8(7458))
  $iif($isid,return,$iif($active ischan,say,echo -a)) %small
}

Comments

Sign in to comment.
Jethro   -  Mar 07, 2011

I agree with jaytea about the fact that a script can further be adjusted to work with the latest versions, but some people either don't know how or bother to do so...and as a result, they take the latest builds as a culprit that their old scripts have stopped functioning. As for buggy issues, not necessarily a user will encounter them if his or her main purpose of using mIRC is to chat and monitor their chat rooms. Some self-conscious folks will think a client with bugs should be avoided at all costs. Nevertheless, against all odds, the latest version should work fairly well for those who give it a whirl.

 Respond  
FordLawnmower   -  Mar 07, 2011

I agree jaytea. I have this script working 100% with 7 in limited testing. Although I realize that $chr() in 7 makes this $utf8() alias unnecessary.

I think I've said this before, but if anyone has problems with one of my scripts working on mIRC 7.x, please let me know and I will take the time to edit the code and get it working.

 Respond  
jaytea   -  Mar 07, 2011

everything that was possible to code in mIRC 6.35 is still possible now with 7.x versions. Unicode/UTF-8 related scripts will probably require adjustment; for most of these scripts (such as this one) the adjustments will be routine and basic, a few may require deeper and more comprehensive knowledge of the topics involved. we should not be opposed to the idea of learning new concepts, especially those that are relevant outside the realm of mIRC.

 Respond  
Jethro   -  Mar 06, 2011

Nice new addition, Ford. :p

Cheiron wrote:

2... some of the scripting i use is not working on the new 7+if the old scripts you have don't work with the latest version, how do you expect them to work when you make a transition from 6.35 to a 7+ version in the future?

I quote a passage Khaled has written from mirc.com:> While it may seem that mIRC v6.35 handles codepages correctly, there are a large number of situations where it cannot do so due to a lack of context, just like in the channels list window, and many users have reported issues, such as corrupted text and incorrect encodings, over the years. It would not be possible to add codepage support to mIRC v7.1 without leading to the same issues that were present in all previous versions of mIRC.You might find yourself stuck with 6.35 for good... Just food for thought.

 Respond  
FordLawnmower   -  Mar 06, 2011

Added alias /small to use some little characters I sorted in some unicode charts.
Example: ѕᴍᴀʟʟ ѕᴍᴀʟʟ ѕᴍᴀʟʟ

 Respond  
Cheiron   -  Feb 05, 2011

1... 6.35 is stable and bug free
2... some of the scripting i use is not working on the new 7+

3... like many other mirc users.. i'm waiting for kaled to get the bugs sorted with 7+ so we can make a clean switch over.

 Respond  
Jethro   -  Feb 04, 2011

If this was an easy request, Ford would have fulfilled it for you. :P Why are you sticking to the older version when the 7+ version is better and fully unicode capable?

 Respond  
Cheiron   -  Feb 04, 2011

got it in one Jethro_ . apologies for not quite making clear what i wanted. :)
it would have to support mirc 6.35 though.

 Respond  
Jethro   -  Jan 31, 2011

It seems to me Cheiron wants a script kicker to detect reversed and upsidedown text.

 Respond  
Gummo   -  Jan 31, 2011

Converting the text in the reverse order, you mean. Probably easier to understand that way.

 Respond  
Cheiron   -  Jan 22, 2011

no.. kinda like an anti script for user typing in it..
if mirc sees one of those 2 being used.. either the upside down and back to front code or the bubbles one.. it will kick the user (bit like a caps kicker or a colour kicker or a bold kicker) .. that sort of thing.

 Respond  
FordLawnmower   -  Jan 22, 2011

Not sure what you mean Cheiron? Please explain.
*Updated so the text tricks work on mIRC 7.

 Respond  
Cheiron   -  Jan 22, 2011

i have an interesting side project based on this if you are interested Ford..
you have done a script that will "make" the text appear.. but how about an anti script so if it see's it.. it will kick the user ??

 Respond  
neuron   -  Jul 31, 2010

For montague's posted code to work in mIRC 7.1, change it to...

/alias ud say $utfdecode($regsubex($replacex($regsubex($lower($1-),/(.)/g,$mid(\A,-\n,1)),a,C9 90,b,q,c,C9 94,d,p,e,C7 9D,f,C9 9F,g,C6 83,h,C9 A5,i,C4 B1,j,C9 BE,k,CA 9E,l,CA 83,m,C9 AF,n,u,p,d,q,b,r,C9 B9,t,CA 87,u,n,v,CA 8C,w,CA 8D,y,CA 8E),/([A-F\d]{2}) ([A-F\d]{2})/g,$chr($base(\1,16,10)) $+ $chr($base(\2,16,10))))

Then, in mIRC, alt+o (or Tools, Options), Other, Lock... Untick Decode (at the right). Hit OK.

Else, you will have to recode the thing. And notice the 4th ")" at the end of the code; it is needed.

 Respond  
Jethro   -  Jan 23, 2010

A little off-topic here, but I read that the current version of mirc is still not fully capable of rendering utf8, at least not 100%. According to Khaled, the next version will be 100% unicode ready...which I think it's going to be a good news.

 Respond  
FordLawnmower   -  Jan 22, 2010

@Gummo Good point about the elseif. It took me over 3 months, off and on, messing with mIRC's utf8 charcter combinations to finally find a way to script the bit shifting properly. I never even noticed I left a block of if's like that.
I don't see how $base could help this script. Please explain if you see something I'm missing.

 Respond  
montague   -  Jan 22, 2010

Jethro_ was rite.. i just post it in hier, so that evryone could use it and have fun with it..

 Respond  
Jethro   -  Jan 21, 2010

Ford, I don't think Montague's made it, the alias was a source from swiftirc.net. The link to that topic can be found here:http://forum.swiftirc.net/viewtopic.php?t=18021&sid=59230b36edfb6091020c949be72faedd

Dated back to 2008

 Respond  
Gummo   -  Jan 20, 2010

Nice script, though elseif would remove some conditionals in the first alias.
montague's code there uses an interesting method of reversing the text with the inner-most $regsubex, uses $replacex to swap the letters with hex codes representing the upside-down letters (spaced to make later regex accurate easily) and the outside regsubex simply converts those values to the correct pairs of characters with $base.
$base would probably have made your script easier, FordLawnmower.

 Respond  
talib   -  Jan 20, 2010

its really great work !!
can you write codes to write like this ---> моtнегְfΰcкег

sorry its lil offensive word but thats what I found !!! i copied from somewhere !!!
thank you for your good work !!!

 Respond  
FordLawnmower   -  Oct 31, 2009

Thanks darah :)

 Respond  
darah   -  Oct 31, 2009

thanks nice posting

 Respond  
FordLawnmower   -  Oct 17, 2009

Those bouncing cats are going to make me insane P:
This alias is for utf8 conversion montague. The upsidedown is just One example of it's use.
Cool alias though :) It shows the power of nested regsubex.
Did you make this alias?
If so, could you take a moment to explain it here?
If not I can explain it in my next post.
It took me quite a while to wrap my head around how it works.
Got a headache now ;/

 Respond  
montague   -  Oct 17, 2009

For an upside down text u could do it like this too:

/alias ud say $regsubex($replacex($regsubex($lower($1-),/(.)/g,$mid(\A,-\n,1)),a,C9 90,b,q,c,C9 94,d,p,e,C7 9D,f,C9 9F,g,C6 83,h,C9 A5,i,C4 B1,j,C9 BE,k,CA 9E,l,CA 83,m,C9 AF,n,u,p,d,q,b,r,C9 B9,t,CA 87,u,n,v,CA 8C,w,CA 8D,y,CA 8E),/([A-F\d]{2}) ([A-F\d]{2})/g,$chr($base(\1,16,10)) $+ $chr($base(\2,16,10)))

u could start it with /ud

 Respond  
Cheiron   -  Sep 14, 2009

as a crazy thought ... you got any more updates planned on this at all to add to it so we can have some more really whacky effects .. or maybe a combination of the octo and the flip intogether.. so it sort of did a random selection of them both in the sentance / word

 Respond  
FordLawnmower   -  Aug 30, 2009

Yea nublet, it usually means that the font that contains that language has not been loaded. The cube means unknown character.
You can usually fix this by adding all the languages.
For XP go here -->> http://support.microsoft.com/kb/177561 <-- and scroll down to xp instructions.
For Vista go here -->> http://windowshelp.microsoft.com/Windows/en-US/help/52e368fa-bd32-4749-955e-331f9130889f1033.mspx
I hope this helps nublet :)

 Respond  
nublet   -  Aug 30, 2009

Hey Ford once again love the work. I however have been having this issue for sometime not just with this script but other text characters in mirc. Where all i see is a box when i do the flipped text it is fine but with the octatext all i can see are boxes. Any ideas on what could be causing this ?

 Respond  
FordLawnmower   -  Aug 09, 2009

Thanks }{exer :)

 Respond  
}{exer   -  Aug 09, 2009

Very good Work !
Its a giant thing with over 200.000 Signs for Show.
Chinese, Arabic all is now easy to bring up on Screen :))
I like it.
Thank you

 Respond  
FordLawnmower   -  Aug 08, 2009

Nope I didn't know that Gummo. Thanks for the info :) When I finally found a formula that would generate the characters correctly everytime, I quickly made the script without the mod alias. I added the mod alias later to remove some repetition, but I would have never guessed that mIRC had modulus function. Useful information :)

 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.