Sign in to follow this  
Followers 0
Crome_BAD

Alittle math problem

7 posts in this topic

#1 ·  Posted (edited)

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...

Edited by Crome_BAD

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

$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 this post


Link to post
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 this post


Link to post
Share on other sites

#5 ·  Posted (edited)

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 this post


Link to post
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 this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0