@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.