mIRC Home    About    Download    Register    News    Help

Print Thread
#134842 05/11/05 02:20 PM
Joined: Sep 2005
Posts: 53
C
Babel fish
OP Offline
Babel fish
C
Joined: Sep 2005
Posts: 53
Im tired of making every Upper case letters one color and lower case another! How do I make acros, or make all upper case letters in my script one color and lower case another?

#134843 05/11/05 08:02 PM
Joined: Aug 2005
Posts: 1,052
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
use $replacecs

this is a script i got.... to use my colors every i choose...

note i used a seperate %var for each of them instead of var %whatever = blah , %other = blah , %next = blah so i can edit the colors later

Code:

on 1:input:#lost:{  
  var %o = 15,1o
  var %i = 4,1i
  var %n = 15,1n
  var %c = 4,1c
  var %h = 15,1h
  var %l = 4,1l
  var %a = 4,1a
  var %s = 15,1s
  var %b = 4,1b
  var %d = 15,1d
  var %e = 4,1e
  var %f = 15,1f
  var %g = 4,1g
  var %h = 15,1h
  var %j = 4,1j
  var %k = 15,1k
  var %m = 4,1m
  var %p = 15,1p
  var %q = 4,1q
  var %r = 15,1r
  var %t = 4,1t
  var %u = 15,1u
  var %v = 4,1v
  var %w = 15,1w
  var %x = 4,1x
  var %y = 15,1y
  var %z = 4,1z
  var %aa = 7,1A
  var %bb = 8,1B
  var %cc = 7,1C
  var %dd = 8,1D
  var %ee = 7,1E
  var %ff = 8,1F
  var %gg = 7,1G
  var %hh = 8,1H
  var %ii = 7,1I
  var %jj = 8,1J
  var %kk = 7,1K
  var %ll = 8,1L
  var %mm = 7,1M
  var %nn = 8,1N
  var %oo = 7,1O
  var %pp = 8,1P
  var %qq = 7,1Q
  var %rr = 8,1R
  var %ss = 7,1S
  var %tt = 8,1T
  var %uu = 7,1U
  var %vv = 8,1V
  var %ww = 7,1W
  var %xx = 8,1X
  var %yy = 7,1Y
  var %zz = 8,1Z
  if ($1 ison #) { msg # $+([[,$replacecs($1,a,%a,b,%b,c,%c,d,%d,e,%e,f,%f,g,%g,h,%h,i,%i,j,%j,k,%k,l,%l,m,%m,n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w,%w,x,%x,y,%y,z,%z,A,%aa,B,%bb,C,%cc,D,%dd,E,%ee,F,%ff,G,%gg,H,%hh,I,%ii,J,%jj,K,%kk,L,%ll,M,%mm,N,%nn,O,%oo,P,%pp,Q,%qq,R,%rr,S,%ss,T,%tt,U,%uu,V,%vv,W,%ww,X,%xx,Y,%yy,Z,%zz) $2- | /halt }
  elseif ($left($1,1) != /) || ($ctrlenter) {
    echo -t $target 8,1[15 $+ $me $+ 8,1] $1- 
    .raw privmsg $active : $+ $1-
    halt
  }
}



as you can see I use my var's to create the color and later use it in the $replacecs script like if a isin $1 then replace with %a which is a colored var. im sure you get the point

theres many ways you can do this other then the var way but I wanted my 4,1 (4 comma 1) etc.. without create $chr event


Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
#134844 06/11/05 06:55 AM
Joined: Oct 2005
Posts: 35
C
Ameglian cow
Offline
Ameglian cow
C
Joined: Oct 2005
Posts: 35
man... I understand why I didnt take my timeand make that script...


#indierpgs @ magicstar.net Your indie-rpg fix. Online.
#134845 06/11/05 04:56 PM
Joined: Apr 2003
Posts: 701
K
Hoopy frood
Offline
Hoopy frood
K
Joined: Apr 2003
Posts: 701
Code:
alias uccolorize {
  var %r,%q = $regsub($1-,/([A-Z]+(?: +[A-Z]+)*)/g,4\1,%r)  $regsub(%r,/([a-z]+(?: +[a-z]+)*)/g,15\1,%r) 
  if ($isid) return %r
  else msg $active $1-
}


This will make all upper case letters be in color 4 and all lower case letters in color 15. You need to replace that by a \1 in the correct color, with a ctrl-o at the end to prevent the next characters from being colored too. Note that this script will not (way less anyways) put color codes around each and every letter even if it's already the right color.

It can have strange results if you combine this with text that already has colors or other codes in it.

If you want to convert output of scripts, put that like $uccolorize(Output To Change)
If you want to have the sext you're going to say to a channel converted, use /uccolorize this is what I want to say, but NOw in CoLoR.

In the last case, you might want to go for a shorter alias name, or use an on INPUT event trigger to do it for you...


Link Copied to Clipboard