mIRC Home    About    Download    Register    News    Help

Print Thread
#101239 21/10/04 03:17 PM
C
clutz1572
clutz1572
C
hello again,

i have a question.
what would i have to do in order to create some sort of color system for my script??

what i mean is like a alias to have it so i don't have to have all these crtl+k codes everywhere if i want color... ( if i'm making sense) how would one go about somthing like this??

if anyone could assist?
thanks in advance

#101240 21/10/04 04:24 PM
A
alkahol1k
alkahol1k
A
in aliases.ini all you need is

colour1 { return 0 }
colour2 { return 1 }
etc... for each color

so if you did //echo $colour1 test on a black backround you would see test and on a white backround you would see //echo $colour2 test

depending on how many colors you want to use, you should make an alias representing each color.

#101241 22/10/04 04:31 AM
C
clutz1572
clutz1572
C
you mean something like this?

Code:
 c {
  if ($1 == 1) return 0
  if ($1 == 2) return 2
  if ($1 == 3) return 3
  if ($1 == 4) return 4
  if ($1 == 5) return 5
  if ($1 == 6) return 6
  if ($1 == 7) return 7
  if ($1 == 8) return 8
  if ($1 == 9) return 9
  if ($1 == 10) return 10
  if ($1 == 11) return 11
  if ($1 == 12) return 12
  if ($1 == 13) return 13
  if ($1 == 14) return 14
  if ($1 == 15) return 15
}
 


this kinda works, it gets the job done. but, not excatly what i was thinking of.... the way this is you have to space the alias and target to get the result. EG: $c 4 test would return test . can i improve this some, so that it maybe yet a bit shorter in the code strings(plus make it look neater) ?????

#101242 22/10/04 05:12 AM
A
astwit
astwit
A
c { return  $+ $1 }

$c(1)

something like this?

#101243 22/10/04 05:35 AM
C
clutz1572
clutz1572
C
that looks nice and clean. laugh

but how would i implement it? it looks pretty straight forward but tested it by itsel with no results. would i have to use it with what i had? 'cause it looks like it's a stand alone alias.

#101244 22/10/04 10:36 AM
D
Daedalus
Daedalus
D
I use this:
Code:
 
alias c1 return $+($chr(3),04,$1,$chr(15))
alias c2 return $+($chr(3),14,$1,$chr(15))
 

Then use the alias as:
Code:
 
msg $chan $c1(SomeText) $c2(SomeOtherText)
 

#101245 23/10/04 02:29 AM
Joined: Dec 2002
Posts: 270
N
Fjord artisan
Offline
Fjord artisan
N
Joined: Dec 2002
Posts: 270
For a more versatile alias you can do something like this:

alias c { return $+($chr(3),$1,$2,$chr(15)) }

Usage: $c(<ColorNum>,<Text>)

Where: ColorNum is a mIRC color value from 0-15(Press CTRL+K in mIRC for more info). Using Double Digits Is Recommended(00,01,02,etc).

Example: //echo -a $c(12,Hello) $c(04,There) $c(07,How Are You) $+ $c(03,?)

Outputs: Hello There How Are You?

#101246 24/10/04 02:59 AM
C
clutz1572
clutz1572
C
thanks everyone for the replies..... i guess theres either not many ways you could do this or there's not much call for it..... i've been searching for relavent subjects on many web boards and come up with little or nothing different than i already read or know........ frown

but just the same thanks to you all!

and special thanks to NightChillz, for his contribution on this. i feel that will work the best, for my needs.


Link Copied to Clipboard