mIRC Home    About    Download    Register    News    Help

Print Thread
Replace Numbers with their Name #264111 29/10/18 03:48 AM
Joined: Jan 2017
Posts: 43
K
KubosKube Offline OP
Ameglian cow
OP Offline
Ameglian cow
K
Joined: Jan 2017
Posts: 43
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".

Re: Replace Numbers with their Name [Re: KubosKube] #264112 29/10/18 04:16 AM
Joined: Jan 2004
Posts: 1,187
maroon Offline
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 1,187
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!

Re: Replace Numbers with their Name [Re: maroon] #264118 29/10/18 04:27 PM
Joined: Jan 2017
Posts: 43
K
KubosKube Offline OP
Ameglian cow
OP Offline
Ameglian cow
K
Joined: Jan 2017
Posts: 43
Sweet! That looks like a great idea! Thank you!