mIRC Home    About    Download    Register    News    Help

Print Thread
Identifier question [RESOLVED] #179660 26/06/07 07:24 AM
Joined: Jan 2007
Posts: 31
P
piker Offline OP
Ameglian cow
OP Offline
Ameglian cow
P
Joined: Jan 2007
Posts: 31
how can I make an identifier like

$colour(04,this is my text in red)

Last edited by piker; 26/06/07 07:56 AM.
Re: Identifier question [Re: piker] #179661 26/06/07 07:40 AM
Joined: Jun 2007
Posts: 933
5
5618 Offline
Hoopy frood
Offline
Hoopy frood
5
Joined: Jun 2007
Posts: 933
Code:
alias colour {
  %x =  $+ $1 $2-
  return %x
}


//say $colour(04, see the result here)

(Note: I used $colour instead of $color on purpose since $color is already an identifier)

Edit: $color and $colour are interchangeable existing identifiers, but you can override one of them in this way, with the alias, while still keeping the other. You may choose another alias name too.

Last edited by 5618; 26/06/07 07:42 AM.
Re: Identifier question [Re: piker] #179662 26/06/07 07:40 AM
Joined: Jun 2006
Posts: 508
D
deegee Offline
Fjord artisan
Offline
Fjord artisan
D
Joined: Jun 2006
Posts: 508
Code:
alias coloured return $+(,$base($1,10,10,2),$$2-,)


You can't use $colour() as it is an inbuilt mIRC identifier ($color and $colour both).

Re: Identifier question [Re: deegee] #179663 26/06/07 07:42 AM
Joined: Jan 2007
Posts: 31
P
piker Offline OP
Ameglian cow
OP Offline
Ameglian cow
P
Joined: Jan 2007
Posts: 31
i tried that before and also tried //echo $isalias(colour)
this is why I kinda thought it was unexistant

Re: Identifier question [Re: piker] #179664 26/06/07 07:46 AM
Joined: Jun 2006
Posts: 508
D
deegee Offline
Fjord artisan
Offline
Fjord artisan
D
Joined: Jun 2006
Posts: 508
$isalias won't show it but it is the original spelling of $color().

//echo -ag $colour(12) = $color(12)

Re: Identifier question [Re: piker] #179666 26/06/07 07:55 AM
Joined: Jan 2007
Posts: 31
P
piker Offline OP
Ameglian cow
OP Offline
Ameglian cow
P
Joined: Jan 2007
Posts: 31
thanks guys for the replies I made this one based in both of your snippets for somebody who's after the same thing:

kol { return $+(,$1,$$2- ) }

Last edited by piker; 26/06/07 07:57 AM.
Re: Identifier question [Re: piker] #179680 26/06/07 02:07 PM
Joined: Oct 2005
Posts: 1,741
G
genius_at_work Offline
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
$isalias only shows aliases (commands that you have created). mIRC's internal commands and identifiers are excluded from $isalias searches.

-genius_at_work