mIRC Home    About    Download    Register    News    Help

Print Thread
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.
Joined: Jun 2007
Posts: 933
5
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.
Joined: Jun 2006
Posts: 508
D
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).

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

Joined: Jun 2006
Posts: 508
D
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)

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.
Joined: Oct 2005
Posts: 1,741
G
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


Link Copied to Clipboard