|
Mozzie Beginner
Joined: 24 Nov 2006 Posts: 17
|
Posted: Mon Dec 04, 2006 5:38 pm
Test for lowest resist value |
I am trying to keep track of my targets various resistances to energies. These can come from race, protection spells or even potions. This part I am fine with, I have a number of triggers that change variables depending on what I have detected.
The part I am having difficulty with is determining which is the lowest variable to I can choose the correct element to attack with. I am using variables called @TFire @TCold @TElec and if they have a negative number they are weak to the element and if it is a positive number they can resist it.
Is there a function I can call to find the lowest variable without doing a nasty series of if then? |
|
|
|
Tech GURU
Joined: 18 Oct 2000 Posts: 2733 Location: Atlanta, USA
|
Posted: Mon Dec 04, 2006 5:55 pm |
Sounds like you want to look into the %min function.
Alternatively you could put the variables in a list, sort in ascending order (using the %sort function) and pick the first on the resulting list. |
|
_________________ Asati di tempari! |
|
|
|
Mozzie Beginner
Joined: 24 Nov 2006 Posts: 17
|
Posted: Mon Dec 04, 2006 7:05 pm |
Both look good at first glance, but as far as I can see they both would return the value, not the name of the variable.
|
|
|
|
|
|