Math problems

by Thorgal

Back to Mechanic's Corner.

Thorgal2004-11-24 15:32:20
1974h, 2899m, 10p ex- #show @currenthealth

1974

1974h, 2899m, 10p ex- #show @maxhealth

2631

1974h, 2899m, 10p ex- #math transmute @maxhealth-@currenthealth
#show @transmute

-1974

1974h, 2899m, 10p ex-

Does anyone know what I'm doing wrong here?
Rhysus2004-11-24 15:38:51
Try placing brackets around the @maxhealth-@currenthealth
Dumihru2004-11-24 16:00:42
Or try:

#var transmute %eval(@maxhealth-@currenthealth)
Thorgal2004-11-24 16:04:29
Bleh, I found the problem, the variable @maxhealth had two spaces after the number, so it didn't get recognized as a numeric value sad.gif. Fixed it!
Ioryk2004-11-24 18:18:46
I have lost a ton of herbs testing triggers with dodgy maths functions. My advice is keep it as simple as possible and good luck.
Thorgal2004-11-24 19:20:10
Oh I never use math functions for curing, just used this for calculating the amount of mana to transmute smile.gif.
Geb2004-11-27 16:50:42
QUOTE (Thorgal @ Nov 24 2004, 08:20 PM)
Oh I never use math functions for curing, just used this for calculating the amount of mana to transmute smile.gif.


In Achaea, my monk would test my transmute alias before every attack I conducted. It would take into account settings made depending on what other class I was fighting, my present mana compared to max mana, and my present health compared to max health. An example of it is:

if @slow=0 {#if @PHealth<=@THealth {%if(@Pmana>@Hmana1,transmute 1000,%if(@Pmana>@Hmana2,transmute 500))};%if(@PHealth<=@THealth1,stannumb);#if @Pmana<=@Hmana2 {#loop 3 {#sa *** DRAIN FOR SOME MANA ASAP!!! ***}}}

I did work with using the #math function at one time, but I found that I actually kept up with my healing without using up my mana quickly using this method. It is easily configurable via various aliases to work well against sapping and non-sapping classes. I doubt knights have a mana draining ability here, but the echo command could still be good to let the knight know when he needs to use numb, sipping, and attack hindrance abilities to allow him to regenerate his mana back to a safe level.