Text Changer

Platform:  mIRC
Published  Apr 03, 2011
Updated  Apr 04, 2011
This is a script i worked on.

It cortains:

-Caps
-Hexify
-Leet
-Reverse
-Backwards
-Binary'
-Rainbow
on *:text:!text*:#:{
if ($2 == $null) { notice $nick Missing 1 parameter: | notice $nick Reverse, Backwards, Binary, Hexify, Leet, Morse, Rainbow }
if ($2 == morse) {
msg $chan $replace($3-,a,$+(.-,$chr(32)),b,$+(-...,$chr(32)),c,$+(-.-.,$chr(32)),d,$+(-..,$chr(32)),e,$+(.,$chr(32)),f,$+(..-.,$chr(32)),g,$+(--.,$chr(32)),h,$+(....,$chr(32)),i,$+(..,$chr(32)),j,$+(.---,$chr(32)),k,$+(-.-,$chr(32)),l,$+(.-..,$chr(32)),m,$+(--,$chr(32)),n,$+(-.,$chr(32)),o,$+(---,$chr(32)),p,$+(.--.,$chr(32)),q,$+(--.-,$chr(32)),r,$+(.-.,$chr(32)),s,$+(...,$chr(32)),t,$+(-,$chr(32)),u,$+(..-,$chr(32)),v,$+(...-,$chr(32)),x,$+(-..-,$chr(32)),z,$+(--..,$chr(32)),y,$+(-.--,$chr(32)),w,$+(.--,$chr(32))) }
if ($2 == leet) {
msg $chan $replace($3-,t,+,a,4,e,3,s,z,i,1,o,0,H,|-|,K,|<,A,@,M,|\/|) }
if ($2 == hexify) {
msg $chan $hex($3-).encode }
if ($2 == rainbow) {
msg $chan $rainbow( $+ $3- $+ ) %chars }
if ($2 == rainbow2) {
msg $chan $rainbow2( $+ $3- $+ ) }
if ($2 == Binary) {
msg $chan $binary( $+ $3- $+ ) }
if ($2 == UnBinary) {
msg $chan $binary( $+ $3- $+ ,b $+ ) }
if ($2 == reverse) {
msg $chan $reverset( $+ $3- $+ ) }
if ($2 == backwards) {
msg $chan $54 $53 $52 $51 $50 $49 $48 $47 $46 $45 $44 $43 $42 $41 $40 $39 $38 $37 $36 $35 $34 $33 $32 $31 $30 $29 $28 $27 $26 $25 $24 $23 $22 $21 $20 $19 $18 $17 $16 $15 $14 $13 $12 $11 $10 $9 $8 $7 $6 $5 $4 $3 }
}
#Alias# (Put this in alias)

alias binary {
if ($isid) {
if ($regex($1,/[^01]/)) {
if ($len($1) < 117) {
if (!$2) {
var %str = $1,%x = 1,%y
while (%x <= $len(%str)) {
%y = $+(%y,$base($asc($mid(%str,%x,1)),10,2,8))
inc %x
}
return %y
}
else echo $color(info) -a $!binary Invalid Parameter: $&
Text-to-Binary Conversion does not take a second parameter. | halt
}
else echo $color(info) -a $!binary Invalid Parameter: $&
String too long. Must be shorter than 117 characters.
}
else {
if ($2) {
if ($2 === b) {
if (!$regex($calc($len($1) / 8),/^\d+\.\d+$/)) {
var %str = $1,%x = 1,%y
while (%x <= $len(%str)) {
%y = $+(%y,$chr($iif($base($mid(%str,%x,8),2,10) == 32,160,$v1))))
inc %x 8
}
return %y
}
else echo $color(info) -a $!binary Invalid Parameter: $&
Malformed Binary. Must be divisible by 8. | halt
}
else echo $color(info) -a $!binary Invalid Parameter: $&
Binary-to-Text Conversion requires the "b" parameter. $&
$!binary(01010101, $+ $+($chr(3),04,b,$chr(3)) $+ ) | halt
}
else echo $color(info) -a $!binary Invalid Parameter: $&
Binary-to-Text Conversion requires the "b" parameter. $&
$!binary(01010101, $+ $+($chr(3),04,b,$chr(3)) $+ ) | halt
}
}
else echo $color(info) -a $!binary Invalid Usage: /binary - $!binary(T/B[,b]) | halt
}
##########################################################################################################################################
alias hex {
if ($1) {
if ($prop == encode) {
return $replacecs($1-,$chr(44),2C,$chr(40),28,$chr(41),29,$chr(36),24,$chr(37),25,$chr(125),7D,$chr(123),7B,$chr(32),20,!,21,",22,#,23,&,26,',27,*,2A,+,2B,-,2D,.,2E,/,2F,0,30,1,31,2,32,3,33,4,34,5,35,6,36,7,37,8,38,9,39,:,3A,;,3B,<,3C,=,3D,>,3E,?,3F,`,60,a,61,b,62,c,63,d,64,e,65,f,66,g,67,h,68,i,69,j,6A,k,6B,l,6C,m,6D,n,6E,o,6F,p,70,q,71,r,72,s,73,t,74,u,75,v,76,w,77,x,78,y,79,z,7A,$chr(124),7C,~,7E) $+ 00
}
if ($prop == decode) {
var %dec = $calc($len($1-) / 2)
var %dec. = $len($1-)
var %num = 2
while (%num =< %dec) {
set %txt $left($1-,%num) $+ $chr(1) $+ $right($1-,$calc(%dec. - %num))
inc %num 2
}
%num = 1
while (%num <= $numtok(%txt,1)) {
set %txt $replace($gettok(%txt,%num,32),2C,$chr(44),28,$chr(40),29,$chr(41),24,$chr(36),25,$chr(37),7D$chr(125),7B,$chr(123),20,$chr(32),21,!,22,",23,#,26,&,27,',2A,*,2B,+,2D,-,2E,.,2F,/,30,0,31,1,32,2,33,3,34,4,35,5,36,6,37,7,38,8,39,9,3A,:,3B,;,3C,<,3D,=,3E,>,3F,?,60,`,61,a,62,b,63,c,64,d,65e,66,f,67,g,68,h,69,i,6A,j,6B,k,6C,l,6D,m,6E,n,6F,o,70,p,71,q,72,r,73,s,74,t,75,u,76,v,77,w,78,x,79,y,7A,z,7C,$chr(124),7E,~)
inc %num 1
}
set %txt $remove(%txt, $chr(1))
return %txt
unset %txt
}
}
on *:load: {
set %alfa a b c d e f g h i j k l m n o p q r s t u v w x y z
set %morse .- -... -.-. -.. . ..-. --. .... .. .--- -.- .-.. -- -. --- .--. --.- .-. ... - ..- ...- .-- -..- -.-- --..
}
on *:unload: {
unset %alfa
unset %morse
}
#morse off
on *:input:*: {
if (/* !iswm $1-) {
say $replace($1-,a,$+(.-,$chr(32)),b,$+(-...,$chr(32)),c,$+(-.-.,$chr(32)),d,$+(-..,$chr(32)),e,$+(.,$chr(32)),f,$+(..-.,$chr(32)),g,$+(--.,$chr(32)),h,$+(....,$chr(32)),i,$+(..,$chr(32)),j,$+(.---,$chr(32)),k,$+(-.-,$chr(32)),l,$+(.-..,$chr(32)),m,$+(--,$chr(32)),n,$+(-.,$chr(32)),o,$+(---,$chr(32)),p,$+(.--.,$chr(32)),q,$+(--.-,$chr(32)),r,$+(.-.,$chr(32)),s,$+(...,$chr(32)),t,$+(-,$chr(32)),u,$+(..-,$chr(32)),v,$+(...-,$chr(32)),x,$+(-..-,$chr(32)),z,$+(--..,$chr(32)),y,$+(-.--,$chr(32)),w,$+(.--,$chr(32)))
halt
}
}
}
#morse end
alias morse {
var %t = 1, %y = $numtok($1-,32)
while (%t <= %y) {
set %translate $instok(%translate,$reptok($ [ $+ [ %t ] ],$gettok(%morse,$findtok(%morse,$ [ $+ [ %t ] ],32),32),$gettok(%alfa,$findtok(%morse,$ [ $+ [ %t ] ],32),32),32),%t,32)
inc %t
}
echo -ta %translate
unset %translate
}
##########################################################################################################################################

alias rainbow2 { var %colors = 4 7 8 3 2 6 | $iif($isid,return,msg $active) $regsubex($1-,/([^ ])/g,$+($chr(3),$base($gettok(%colors,$calc((\n -1) % $numtok(%colors,32) + 1),32),10,10,2),\t)) }
alias rainbow { return $regsubex($1-,/(.)/g,$+($chr(3),$iif($r(1,15) < 10,$+(0,$v1),$v1),\1)) }

#Some of the aliases i didn't make. so the credits go to the authors#

Comments

Sign in to comment.
troll   -  Apr 20, 2011
i like it,
 Respond  
SunnyD   -  Apr 04, 2011
Oh. Apologies Gummo. Didn't quite catch what you were getting at.
 Respond  
Gummo   -  Apr 04, 2011
mIRC's $chr merely associates the letters with their ASCII values, which is where you get \x30 (which is actually hex) and your \60 as octal. That doesn't contribute a lot to this. :(
 Respond  
Jethro   -  Apr 04, 2011
0 and 1 are equivalent to mIRC's $chr(48) and $chr(49) and octal characters \x30, \x31 and \60 and \61 respectively.
 Respond  
Gummo   -  Apr 04, 2011
He checks whether the first character is a 0 or a 1 to determine whether to convert to or from binary. To be honest, I'm not sure why you started talking about 0 and 1 being representative of anything. They're characters. :\
Unless, of course, it was just a misinterpretation.
 Respond  
SunnyD   -  Apr 03, 2011

Quote

It seems to me that you can't convert text to binary if it starts with a 0 or a 1. Perhaps you should try another method.


I was under the impression that he was converting text to binary. I don't see how decimal applies if this is the case.
 Respond  
Gummo   -  Apr 03, 2011
When dealing with characters, 0 and 1 are decimal 48 and 49 respectively, not 0 and 1.
 Respond  
SunnyD   -  Apr 03, 2011
You might be able to incorporate a regex algorithm to exclude and/or replace the '0' and '1' since they already represent their binary value. 0000 and 0001 respectively.
 Respond  
Gummo   -  Apr 03, 2011
It seems to me that you can't convert text to binary if it starts with a 0 or a 1. Perhaps you should try another method.
 Respond  
SunnyD   -  Apr 03, 2011
Ah more than meets the eye. I thought it was one of those poorly thought out and executed text changers. Nice snippet but from the recent comments, sounds like it needs a tuning.
 Respond  
_Dean_   -  Apr 03, 2011
hex alias is missing a close bracket
there is no $reverset alias
the $binary converstion on text event, will return

Quote


* /msg: insufficient parameters


the backwards option will only put backwards if the text use 54 toks, and it will not work
you can use regsubex to do it
 Respond  
IllogicTC   -  Apr 03, 2011
You are missing the closing bracket on Hex.
 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.