mIRC Home    About    Download    Register    News    Help

Print Thread
#163556 01/11/06 09:46 AM
Joined: Oct 2006
Posts: 342
L
learn3r Offline OP
Fjord artisan
OP Offline
Fjord artisan
L
Joined: Oct 2006
Posts: 342
;-----------;

on *:input:*: {
if ( $server ) && ( $left($1-,1) != / ) {
say 0,1¤0,4 $1- 0,1¤
halt
}
elseif ( !$server ) && ( $left($1-,1) != / ) {
echo You are not connected!!
halt
}
else {
if ( $active == Status Window ) { return
echo -a This is the status window!
halt
}
}
}

;---------;


Can anybody help me put this code:
$replace($nick,a,4A,b,14b,c,14c,d,14d,e,4E,f,14f,g,14g,h,14h,i,4I,j,14j,k,14k,l,14l,m,14m,n,14n,o,4O,p,14p,q,14q,r,14r,s,14s,t,14t,u,4U,v,14v,w,14w,x,14x,y,4Y,z,14Z)

in the code above...

i want when i type nick name it will change it
$1- anywhere on the message
not just on $1
is it possible?

#163557 01/11/06 10:06 AM
Joined: Oct 2006
Posts: 166
B
Vogon poet
Offline
Vogon poet
B
Joined: Oct 2006
Posts: 166
Code:
on *:input:#:{
if /* !iswm $$1 {
var %a = 1
while %a <= $numtok($1-,32) {
var %b = %b $iif($gettok($1-,%a,32) ison #,$+($chr(3),14,$v1,$chr(3)),$v1)
inc %a
}
msg $active %b
halt
}
}


Kind Regards, blink
#163558 01/11/06 10:29 AM
Joined: Oct 2006
Posts: 342
L
learn3r Offline OP
Fjord artisan
OP Offline
Fjord artisan
L
Joined: Oct 2006
Posts: 342
on *:input:#:{
if /* !iswm $$1 {
var %a = 1
while %a <= $numtok($1-,32) {
var %b = %b $iif($gettok($1-,%a,32) ison #,$+($chr(3),14,$v1,$chr(3),0),$v1)
inc %a
}
msg $active 0,1¤0,4 %b 0,1¤
halt
}
}


;--------------------;

where is the
$replace($nick,a,4A,b,14b,c,14c,d,14d,e,4E,f,14f,g,14g,h,14h,i,4I,j,14j,k,14k,l,14l,m,14m,n,14n,o,4O,p,14p,q,14q,r,14r,s,14s,t,14t,u,4U,v,14v,w,14w,x,14x,y,4Y,z,14Z)
??
isn't that possible? hehehe anyway thanks bro

#163559 01/11/06 02:31 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
What he gave you does what you need, except for the vowels. It's just a simpler method than using the replace that you see. $chr(3) is Ctrl-K. See the $iif for where the replace happens.

You can put a $replace around %b that will replace just the vowels and it should give you what you need. Make sure you reset the color to 14 after the character:

$replace(%b,a,14a04, .... etc)

That is untested, but it should work fine.


Invision Support
#Invision on irc.irchighway.net
#163560 01/11/06 02:51 PM
Joined: Oct 2006
Posts: 342
L
learn3r Offline OP
Fjord artisan
OP Offline
Fjord artisan
L
Joined: Oct 2006
Posts: 342
i get the chr an what u mean
what i mean is
is it possible that only the nick will be replaced?

#163561 01/11/06 04:26 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Well, I can't test it, but it looks like that is all that would be replaced. The $iif checks to see if the token ison the channel. If not, it doesn't change the color. If it is, then it changes the color.

If you mean just the part I mentioned about vowels, then the part where that should go is:
Code:
var %b = %b $iif($gettok($1-,%a,32) ison #,$+($chr(3),14,$replace($v1,a,14a04,e,14e04,i,14i04,o,14o04,u,14u04),$chr(3)),$v1)


Invision Support
#Invision on irc.irchighway.net
#163562 01/11/06 05:49 PM
Joined: Oct 2006
Posts: 342
L
learn3r Offline OP
Fjord artisan
OP Offline
Fjord artisan
L
Joined: Oct 2006
Posts: 342
based on ur code
i maked it
like this


Thanks... its working now
Code:
var %b = %b $iif($gettok($1-,%a,32) ison #,$+($chr(3),4,$replace($v1,a,4A,b,15b,c,15c,d,15d,e,4E,f,15f,g,15g,h,15h,i,4I,j,15j,k,15k,l,15l,m,15m,n,15n,o,4O,p,15p,q,15q,r,15r,s,15s,t,15t,u,4U,v,15v,w,15w,x,15x,y,4Y,z,15Z),$chr(3),0),$v1)

  

#163563 01/11/06 08:38 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Unless you want things to be capitalized, you don't need anything except the vowels done. Because all the consonants use the same color, you can just use what I put and just change the color...

Code:
var %b = %b $iif($gettok($1-,%a,32) ison #,$+([color:red]$chr(3),15[/color],$replace($v1,a,04a15,e,04e15,i,04i15,o,04o15,u,04u15),[color:blue]$chr(3)[/color]),$v1)


The red part sets it so the nick's color is 15. The blue part just resets the color to the original color after the nick is done. The replace part replaced the vowels with color 4, then resets to color 15 so that it can continue the rest of the nick in color 15.

What you have can make your lines REALLY long and you won't be able to have as much written on a single line because of it... you'd have color codes before every single letter in the nicks.


Invision Support
#Invision on irc.irchighway.net
#163564 02/11/06 12:50 AM
Joined: Oct 2006
Posts: 342
L
learn3r Offline OP
Fjord artisan
OP Offline
Fjord artisan
L
Joined: Oct 2006
Posts: 342
yes i want the $left and $right sections of the nicks would be capitalized...
and again i get the $chr(3)

#163565 02/11/06 01:31 AM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Ok, the only reason I mentioned the $chr(3) again was because you included all the letters in the replace, which isn't necessary.

As for capitalization... if you want it all on the one line, this should do it for you. It's long, but it works.

Code:
var %b = %b $iif($gettok($1-,1,32) ison #oldgames,$+($chr(3),15,$replace($+($upper($left($v1,1)),$mid($v1,2,$calc($len($v1) - 2)),$right($upper($v1),1)),a,04a15,e,04e15,i,04i15,o,04o15,u,04u15),$chr(3)),$v1)


If you want all the middle letters to be lowercase, regardless of how they have it formatted, then use this one:

Code:
var %b = %b $iif($gettok($1-,1,32) ison #oldgames,$+($chr(3),15,$replace($+($upper($left($v1,1)),$lower($mid($v1,2,$calc($len($v1) - 2))),$right($upper($v1),1)),a,04a15,e,04e15,i,04i15,o,04o15,u,04u15),$chr(3)),$v1)


Invision Support
#Invision on irc.irchighway.net
#163566 02/11/06 03:19 AM
Joined: Oct 2006
Posts: 342
L
learn3r Offline OP
Fjord artisan
OP Offline
Fjord artisan
L
Joined: Oct 2006
Posts: 342
Doesnt work for me

#163567 02/11/06 04:30 AM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
That is because I messed up and left a piece of test code in it...

Only first/last are uppercase:
Code:
var %b = %b $iif($gettok($1-,%a,32) ison #,$+($chr(3),15,$replacecs($+($upper($left($v1,1)),$lower($mid($v1,2,$calc($len($v1) - 2))),$right($upper($v1),1)),a,04a15,e,04e15,i,04i15,o,04o15,u,04u15,A,04A15,E,04E15,I,04I15,O,04O15,U,04U15),$chr(3)),$v1)


First/last are uppercase as well as any other characters that are uppercase in the original nick:
Code:
var %b = %b $iif($gettok($1-,%a,32) ison #,$+($chr(3),15,$replacecs($+($upper($left($v1,1)),$mid($v1,2,$calc($len($v1) - 2)),$right($upper($v1),1)),a,04a15,e,04e15,i,04i15,o,04o15,u,04u15,A,04A15,E,04E15,I,04I15,O,04O15,U,04U15),$chr(3)),$v1)


I also updated it so that it works for vowels at the beginning and end. Forgot about that before.


Invision Support
#Invision on irc.irchighway.net

Link Copied to Clipboard