mIRC Home    About    Download    Register    News    Help

Topic Options
#264111 - 29/10/18 03:48 AM Replace Numbers with their Name
KubosKube Offline
Ameglian cow

Registered: 31/01/17
Posts: 42
Loc: Central US
Pretty straight-forward, I want to replace numbers with words. I have a script that reads out numbers, but the output always looks inorganic and somewhat confusing, like this:
Code:
You rolled 4 6-sided dice! |  6 2 8 1 3


I want it to look more natural, like this:
Code:
You rolled four six-sided dice! |  6 2 8 1 3


Is there a built-in feature like this? Or has someone else made a script for that purpose? I searched on Google, but they couldn't find anything for "mirc replace numbers with their names", or "mirc replace numbers with words".

Top
#264112 - 29/10/18 04:16 AM Re: Replace Numbers with their Name [Re: KubosKube]
maroon Offline
Hoopy frood

Registered: 12/01/04
Posts: 966
for a small range of numbers, it's simple to use $gettok to list them.

Code:
//var %a 4 | echo -a you rolled $gettok(one two three four five six,%a,32) 6-sided sice!

Top
#264118 - 29/10/18 04:27 PM Re: Replace Numbers with their Name [Re: maroon]
KubosKube Offline
Ameglian cow

Registered: 31/01/17
Posts: 42
Loc: Central US
Sweet! That looks like a great idea! Thank you!

Top