mIRC Homepage
Posted By: danzigrules math script - 14/02/07 03:06 AM
I am looking for a script that users can use to input one number, then insert it into a formula and spit out the result.

Say they say !calc 16671 and then that would insert it into this formula:

72*3*(xxxxx)*79 + 72*2.5*(xxxxx)*106 + 72*2.5*(xxxxx)*116 + 72*1*(xxxxx)*324

That is just to much for a n00b like to me figure out with all the $1 $2 $3 etc

Thanks much
Posted By: landonsandor Re: math script - 14/02/07 03:25 AM
Well, using your example (untested):

try something like this in your alias section

/formulax //echo $calc(72*3* $1 *79 + 72*2.5* $1 *106 + 72*2.5* $1 *116 + 72*1* $1 *324)


The other thing you could try would be (if it was only one number to be inserted)

/formulax //echo $calc($1 * $1 * $1 * $1 * 72*3*79 + 72*2.5*106 + 72*2.5*116 + 72*1*324)


im sure there are other ways to do this, but this is just an example.
Posted By: danzigrules Re: math script - 14/02/07 06:49 AM
Thanks

Got it working with:

Code:
[/code]on *:text:!calc *:#:msg # Cost to buy Private Market out $comma($calc(72*3* $2 *79 + 72*2.5* $2 *106 + 72*2.5* $2 *116 + 72*1* $2 *324))
[code]




Thanks
Posted By: DJ_Sol Re: math script - 14/02/07 04:34 PM
What is this $comma identifier?

You know, I had hoped there was an identifier that put comma's in a number. You know, $comma(9000000) = 9,000,000. Searched throughout the help file, I had hoped this $comma thing was it when I saw this but I jsut got * /echo: insufficient parameters.
Posted By: Riamus2 Re: math script - 14/02/07 05:11 PM
To insert commas, use:

$bytes(N,b)

(where N is the number).

Example:
//echo -a $bytes(4353462436212,b)
Posted By: Mpdreamz Re: math script - 14/02/07 05:53 PM
$comma
Posted By: DJ_Sol Re: math script - 14/02/07 06:02 PM
Thanks!! Thats great!
© mIRC Discussion Forums