I found a useful function that can take any basic arithmetic expression and evaluate it.
Syntax is: doMath( expression, message_if_true )
Expression must be a valid math expression. You can use +-*/^ as well as ( ) as in normal math.
If message_if_true is true, it will display "<expression> = <evaluated expression>", otherwise it will return the result of the evaluation.
Function was found at Rosettacode.org
Requires LPeg. For convenience, I have attached the dll for windows users, which I found in the Lua For Windows installation.
No claim made for making these, I just added the math.pow function to the thing Hope it's of use to you.
A simple arithmetic function.
Re: A simple arithmetic function.
Forgot to say, drop the unzipped .dll in the mudlet install directory before you try to run this. If you have problems unzipping, use jeans with buttons Or go to the 7Zip webpage to get a very good zip utility. Free!
Re: A simple arithmetic function.
I highly discourage posting scripts that are useless without modifications to Mudlets installation.
If you want to make it useful, convert it to lrexlib. Otherwise it's useless for a lot for all Mac and Linux users.
If you want to make it useful, convert it to lrexlib. Otherwise it's useless for a lot for all Mac and Linux users.
Re: A simple arithmetic function.
I did find a simpler way of doing this that uses the Lua system itself. It's not as fast if you should be doing bulk calculations, but should be enough for alias use.