MATH TLO idea

PumpThump

Member
Joined
Jan 28, 2011
Messages
603
Reaction score
1
Points
18
Age
36
Is it possible to have an addition to the Math TLO? Here's what I'm thinking...

${Math.Max[#A, #B]} and the value would return the higher of either A and B?

And possibly the flipside...

${Math.Min[#A, #B]} where it would return the lower of either A and B?
 

htw

Developer
Joined
Aug 27, 2006
Messages
13,081
Reaction score
240
Points
63
Location
Albuquerque, NM

Max: ${If[$Math.Calc[A>=B]},A,B]}
Min: ${If[Math.Calc[A<b]},a,b]}
<b]},a,b]} <b]},a,b]}
< B]},A,B]}<b]},a,b}


</b]},a,b}></b]},a,b]}></b]},a,b]}
 
Last edited:

Xeniaz

MQ2 Guru
Joined
Dec 7, 2006
Messages
424
Reaction score
3
Points
18
I'm pretty sure I added that to the compile already about two years back now.
 

PumpThump

Member
Joined
Jan 28, 2011
Messages
603
Reaction score
1
Points
18
Age
36
Interesting...

So, what ${If[$Math.Calc[A>=B]},A,B]} is doing is saying that "If A is greater than or equal to B, then return A. Otherwise return B."

And what ${If[Math.Calc[A < B]},A,B]} is doing is saying that "If A is less than B, then return A. Otherwise return B."

Just want to make sure I understand the meaning behind the syntax.
 

Xeniaz

MQ2 Guru
Joined
Dec 7, 2006
Messages
424
Reaction score
3
Points
18
Code:
${Math.Min[1 2 3]}
returns 1

Min Max and Average is available as part of the Math TLO
The same is also available in the Group TLO to return the ID of the group member that has the least or most hps. Average returns the average health of the group.
 

PumpThump

Member
Joined
Jan 28, 2011
Messages
603
Reaction score
1
Points
18
Age
36
Code:
${Math.Min[1 2 3]}
returns 1

Min Max and Average is available as part of the Math TLO
The same is also available in the Group TLO to return the ID of the group member that has the least or most hps. Average returns the average health of the group.
Excellent, that's even better than what I was looking for!