# Alittle math problem

## Recommended Posts

Hey guys, im making a littler calculator for Diablo Open BNET to calculate your mana regeneration and the equation uses brackets....but AU3 says syntax error....hes my code so far...there will be alot more...lol but i JUST started, i wanted to see if brackets worked...

\$max_mana = "1570000"
\$manaregen_percent = "15300"

\$MaxManaRegen = 25 * [[ 256 * \$max_mana / (25 * 120)] * (100 + \$manaregen_percent) / 100] / 256

MsgBox(36, "Max Mana Regen", "You MAX mana regen would be " & \$MaxManaRegen & ", With " & \$max_mana & " max mana, and " & \$manaregen_percent & " mana regen %")

Any ideas how to get around these brackets? or am i missing somthing. I copied the equation exact...

Crome

EDIT: sorry guys, lack of sleep has impaired my brain and eye sight, i could just turn the brackets into ().....this is a pointless post...please delete guys...

##### Share on other sites

\$MaxManaRegen = 25 * (( 256 * \$max_mana / (25 * 120)) * (100 + \$manaregen_percent) / 100) / 256

need round brackets not square (Although the results look a bit large to me)

square use for arrays i.e \$Array[10] = array with 10 elements

HardCopy

Edited by HardCopy

Contributions: UDF _DateYearFirstChildren are like Farts, you can just about stand your own.Why am I not a Vegetarian?...Well...my ancestors didn't fight & evolve to the Top of the food chain for me to survive on Salad

##### Share on other sites

didnt you see this:

EDIT: sorry guys, lack of sleep has impaired my brain and eye sight, i could just turn the brackets into ().....this is a pointless post...please delete guys...

My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll

##### Share on other sites

didnt you see this:

Obviously not, however my post was more relevant than yours

Contributions: UDF _DateYearFirstChildren are like Farts, you can just about stand your own.Why am I not a Vegetarian?...Well...my ancestors didn't fight & evolve to the Top of the food chain for me to survive on Salad

##### Share on other sites

Yea, I just learned in school that brackets can usually be replaced with parenthesis, since we're required to use TI-83 Texas Instrument Calculators.

Edited by layer

FootbaG

##### Share on other sites

Its all good guys, i might as well explain my reasoning.

If you have played Open Battle.net for Diablo II then your aware that it is a openly hacked environment (thats the difference between closed and open).

Anyways, to make a character worthy of dueling others, alot of math is involved....wellll heres the eqaution..

25 * [[ 256 * your_max_mana / (25 * 120)] * (100 + your_mana_regen%) / 100] / 256

What this equation gives you is the amount of mana you can regenerate every 1.5-2 seconds i believe. And i was just tired of having to figure that all out on paper when i have a nice GUI setting and the capabilities of creating a nice little proggy that could inturns help others with this same flaw of mine.

I stayed up all last night testing different values to input to the equation (whih is why im EXTREMELLY tired now...lol) and about 8:45 this morning i realized...wow, AutoIt is the east and best way to accomplish this without hassle...sooo....here i am

Crome

##### Share on other sites

Obviously not, however my post was more relevant than yours

and the pot said the kettel was black ...

My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll

## Create an account

Register a new account

×

• Wiki

• Back

• Git