mIRC Home    About    Download    Register    News    Help

Print Thread
math script #170757 14/02/07 03:06 AM
Joined: Dec 2006
Posts: 46
D
danzigrules Offline OP
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Dec 2006
Posts: 46
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

Re: math script [Re: danzigrules] #170764 14/02/07 03:25 AM
Joined: Dec 2002
Posts: 1,527
L
landonsandor Offline
Hoopy frood
Offline
Hoopy frood
L
Joined: Dec 2002
Posts: 1,527
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.


Those who fail history are doomed to repeat it
Re: math script [Re: landonsandor] #170772 14/02/07 06:49 AM
Joined: Dec 2006
Posts: 46
D
danzigrules Offline OP
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Dec 2006
Posts: 46
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

Last edited by danzigrules; 14/02/07 06:57 AM.
Re: math script [Re: danzigrules] #170785 14/02/07 04:34 PM
Joined: Jan 2007
Posts: 1,156
D
DJ_Sol Offline
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2007
Posts: 1,156
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.

Re: math script [Re: DJ_Sol] #170787 14/02/07 05:11 PM
Joined: Oct 2004
Posts: 8,330
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
To insert commas, use:

$bytes(N,b)

(where N is the number).

Example:
//echo -a $bytes(4353462436212,b)


Invision Support
#Invision on irc.irchighway.net
Re: math script [Re: DJ_Sol] #170792 14/02/07 05:53 PM
Joined: Apr 2004
Posts: 759
M
Mpdreamz Offline
Hoopy frood
Offline
Hoopy frood
M
Joined: Apr 2004
Posts: 759


$maybe
Re: math script [Re: Riamus2] #170793 14/02/07 06:02 PM
Joined: Jan 2007
Posts: 1,156
D
DJ_Sol Offline
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2007
Posts: 1,156
Thanks!! Thats great!