mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jan 2017
Posts: 57
Babel fish
OP Offline
Babel fish
Joined: Jan 2017
Posts: 57
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".

Joined: Jan 2004
Posts: 2,127
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 2,127
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!

Joined: Jan 2017
Posts: 57
Babel fish
OP Offline
Babel fish
Joined: Jan 2017
Posts: 57
Sweet! That looks like a great idea! Thank you!


Link Copied to Clipboard