I threw together two quick aliases for temperature conversion in mIRC. The one for going from Fahrenheit to Celsius works just fine, but going from Celsius to Fahrenheit gives me the error "* /echo: insufficient parameters (line 11, remote.ini)".
Here are the aliases.
;This one works
alias ftoc {
if ($1 isnum) {
echo $calc(($1 - 32) * 5 / 9)
}
}
;This one does not
alias ctof {
if ($1 isnum) {
echo $calc($1 * 9 / 5 + 32) ;This is the line that throws the error
}
}
Strangely enough, if I switch the "5" and "9" in the equation of the failing alias, it does work, though obviously doesn't give me the desired output. What is going on here? How should I write these so that they will work?
Syntax: /echo [color] [-cdeghiNtsaqlbfnmr] [color name] [#channel|[=]nick] <text>
The first (optional) argument of echo
is color
, which allows you to specify the color of the text (0-15). If the number you're trying to print is in that range, it will interpret it as the text color, causing it to think that your command is lacking the text
argument, causing the insufficient parameters
error.
To fix this you can provide a color
parameter, so it will interpret the following number as text, even if between 0 and 15. The only downside to this is that it will ignore the default color set, and use the one you provided in the command (alternatively you could provide one of the switches instead of a color).
echo 0 $calc(($1 - 32) * 5 / 9)
echo -a $calc(($1 - 32) * 5 / 9)