mIRC Homepage
Posted By: xrn0id convert text - 16/02/03 05:14 AM
how can I Convert text? lke heres an example:

Right Click>Convert Text

open a pop up titled "Text To Convert:" and whatever I put into that text box, will be read, and the letters will be changed accordingly, and then the new message (the converted one) will be displayed. Does anybody know what im talking about? lol
Posted By: Cheech Re: convert text - 16/02/03 05:23 AM
you could set a %var to $$?="text to convert:" then use $replace to change what you want ? if thats not what yer lookin for can you be more specific ?
Posted By: xrn0id Re: convert text - 16/02/03 05:28 AM
set %temp $?="Convert Text:"
;replace a with 1, be with 2, c with 3... etc
convert %temp
echo %temp

so if i enterd abc; it would echo 123
Posted By: laz Re: convert text - 16/02/03 05:41 AM
I think this is what you want:

Code:
  
set %temp $replace($$?="Convert text",a,1,b,2,c,3)
Posted By: Cheech Re: convert text - 16/02/03 05:42 AM
not sure if this is what you want or not ? but this is what i was meaning
Code:
 
Menu Channel {
  Text Conversion
  .Convertor {
    set %ttc $$?="Convert Text:"
    if ( a isin %ttc ) { set %ttc $replace(%ttc,a,1) }
    if ( b isin %ttc ) { set %ttc $replace(%ttc,b,2) }
    if ( c isin %ttc ) { set %ttc $replace(%ttc,c,3) }
    say %ttc 
  }
}
 

if i want to be cool i would learn my abc's
would come out like this
if i w1nt to 2e 3ool i would le1rn my 123's
hope that helps
Posted By: xrn0id Re: convert text - 16/02/03 05:44 AM
yes thats exactally what i want, thanks
Posted By: Online Re: convert text - 16/02/03 05:45 AM
By the way, mircscripts.org has a few nice talkers, if you wanna try. I especially loved the 'drunk talker'.
Posted By: The_Game Re: convert text - 16/02/03 05:48 AM
I seen that talker. What exactly does that do? I was actually afraid to download it because I wasn't sure what it did. Could you explain?
Posted By: Cheech Re: convert text - 16/02/03 05:48 AM
ah i might have a look but i built my own was one of the first
things i scripted smile thx
one of these days when i figure out regex i could probably condense it quite a bit .. lol
Posted By: Online Re: convert text - 16/02/03 05:54 AM
Not too difficult, just paste the 'Drunk Talker' into mIRC remote and type /dr <text> in the channel... you'd love the result :tongue:. It doesn't use an on Input event, so your messages will not be interrupted at all.
Posted By: The_Game Re: convert text - 16/02/03 05:58 AM
Ok I will check it out. Its hilarious you say?
Posted By: Online Re: convert text - 16/02/03 05:58 AM
I love regex because it usually shortens code, and makes it faster. If you want to learn it you can start here. man.txt is also a great reference.
Posted By: Online Re: convert text - 16/02/03 06:04 AM
yea
Posted By: xrn0id Re: convert text - 16/02/03 06:29 AM
//xrn0id decode
Menu Channel {
tExT cRiPt
.EnCrIpT tExT {
set %ttc $$?="EnCrIpT tExT:"
if ( a isin %ttc ) {
set %ttc $replace(%ttc,a,%)
}
if ( b isin %ttc ) {
set %ttc $replace(%ttc,b,!)
}
if ( c isin %ttc ) {
set %ttc $replace(%ttc,c,&)
}
if ( d isin %ttc ) {
set %ttc $replace(%ttc,d,^)
}
if ( e isin %ttc ) {
set %ttc $replace(%ttc,e,@)
}
if ( f isin %ttc ) {
set %ttc $replace(%ttc,f,*)
}
if ( g isin %ttc ) {
set %ttc $replace(%ttc,g,f)
}
if ( h isin %ttc ) {
set %ttc $replace(%ttc,h,4)
}
if ( i isin %ttc ) {
set %ttc $replace(%ttc,i,u)
}
if ( j isin %ttc ) {
set %ttc $replace(%ttc,j,6)
}
if ( k isin %ttc ) {
set %ttc $replace(%ttc,k,2)
}
if ( l isin %ttc ) {
set %ttc $replace(%ttc,l,a)
}
if ( m isin %ttc ) {
set %ttc $replace(%ttc,m,3)
}
if ( n isin %ttc ) {
set %ttc $replace(%ttc,n,g)
}
if ( o isin %ttc ) {
set %ttc $replace(%ttc,o,u)
}
if ( p isin %ttc ) {
set %ttc $replace(%ttc,p,7)
}
if ( q isin %ttc ) {
set %ttc $replace(%ttc,q,1)
}
if ( r isin %ttc ) {
set %ttc $replace(%ttc,r,9)
}
if ( s isin %ttc ) {
set %ttc $replace(%ttc,s,4)
}
if ( t isin %ttc ) {
set %ttc $replace(%ttc,t,m)
}
if ( u isin %ttc ) {
set %ttc $replace(%ttc,u,8)
}
if ( v isin %ttc ) {
set %ttc $replace(%ttc,v,5)
}
if ( w isin %ttc ) {
set %ttc $replace(%ttc,w,z)
}
if ( x isin %ttc ) {
set %ttc $replace(%ttc,x,x)
}
if ( y isin %ttc ) {
set %ttc $replace(%ttc,y,w)
}
if ( z isin %ttc ) {
set %ttc $replace(%ttc,z,6)
}
say %ttc
unset %ttc
}
.DeCrIpT tExT {
set %ttc $$?="DeCrIpT tExT:"
if ( $chr(37) isin %ttc ) {
set %tcc $replace(%ttc,$chr(37),a)
}
if ( $chr(33) isin %tcc ) {
set %tcc $replace(%ttc,$chr(33),b)
}
if ( $chr(38) isin %tcc ) {
set %tcc $replace(%ttc,$chr(38),c)
}
say %ttc
unset %ttc
}


so why does that do this?

abc > %!&

%!& > %!& (donst cover to abc)
Posted By: Cheech Re: convert text - 16/02/03 06:36 AM
try just using %,!,& instead of the $chr
Posted By: xrn0id Re: convert text - 16/02/03 06:55 AM
that was my first try, and it did the same thing
Posted By: Hammer Re: convert text - 16/02/03 08:41 AM
You are also replacing some characters with characters that will, themselves, be replaced later. *tsk tsk tsk*
© mIRC Discussion Forums