Page 6 of 12
Posted: Mon Jun 21, 2004 1:51 am
by di28889
Ok, workaround, changed casts left code to this:
Code:
${Int[${Math.Calc[${Me.CurrentMana}/${If[!${Me.Gem[1].ID},1,${Me.Gem[1].Mana}]}]}]}
Basically, if there is no spell gem there, it will instead display current mana..
does not work with spell such as (sham) conversions (cann 4)
Posted: Mon Jun 21, 2004 12:39 pm
by SirCodeAlot
Okay - yeah - I see the problem. Basically math rule... repeat after me kids:
0 divded by anything equals.... ZERO

... very good class.
Now anything divided by 0 is.... UNDEFINED... excellent.
I will just have it look to see if the mana is 0 and if it is I will just have it either display nothing or put a zero there or something. I think it is a bit redundant to put the mana there, again, as it is already right on the compass window.
I'll have a new release up by the end of the night.
Posted: Mon Jun 21, 2004 2:17 pm
by bob_the_builder
0 divded by anything equals.... ONE...
Is this sarcasm? or some new type of 2+2=5 math?
0 divided by X = 0
Bob_doesn't_understand
Posted: Mon Jun 21, 2004 3:47 pm
by loadingpleasewait
Ok, how about this..
Code: Select all
${If[!${Me.Gem[1].ID},,${If[${Me.Gem[1].Mana}<=1,${Int[${Math.Calc[${Me.CurrentMana}/${Me.Gem[1].Mana}]}]},]}]}
Not at home to test, but technically, this should work. It shouldnt display anything if no gem is there, or the spells mana is less than or equal to 0.
Posted: Mon Jun 21, 2004 4:46 pm
by SukMage
Will have to try it when I get home... Before the latest math upgrade, it displayed 0 if the spell's mana was less than or equal to zero and I believe nothing if the gem was empty.
Posted: Mon Jun 21, 2004 4:55 pm
by SirCodeAlot
This has been updated as of 4:54PM EST on June 21, 2004 to fix the spam problem when no spell was loaded in the spell bar. Just a simple divide by zero problem due to Lax's smarter math module (or maybe the other one was smarter and handled the error?). Anyways, check the first post for details.
Posted: Mon Jun 21, 2004 6:49 pm
by SukMage
if spell cost = 0 there is no green text however it still spams on it
Divide by zero in calculation
Same with the no gem loaded spams but no pretty green text.
Posted: Mon Jun 21, 2004 7:55 pm
by SirCodeAlot
Yes, the damn thing is still broken - yet I have no clue how because it worked fine when I tested it and now it isn't working at all. Will have it done in a sec.
Grr.
Posted: Mon Jun 21, 2004 8:01 pm
by loadingpleasewait
Welp, my attempt to fix it did not work.. HOWEVER Lax explains a way to fix it here..
http://macroquest2.com/phpBB2/viewtopic.php?t=7921
Posted: Tue Jun 22, 2004 1:57 am
by loadingpleasewait
Ok, pain in the butt, but this works..
Code: Select all
${Math.Calc[${If[${Me.Gem[1].Mana}==0,0,${If[!${Me.Gem[1].ID},0,${Me.CurrentMana}]}]}/${If[${Me.Gem[1].Mana}==0,1,${If[!${Me.Gem[1].ID},1,${Me.Gem[1].Mana}]}]}].Int}
the code calculates the inside ${}'s first.. if you can get a shorter way to work, let me know.. :)
Posted: Tue Jun 22, 2004 7:42 am
by SirCodeAlot
Alrighty, it should be fixed now. I basically followed the link that loadingpleasewait gave me and evaluated the denominator in an if statement. It seems to me like it shouldn't work... But it does so I am just gonna leave it.
Check the first post for the download.
Posted: Tue Jun 22, 2004 3:43 pm
by Drumstix42
loadingpleasewait wrote:Ok, pain in the butt, but this works..
Code: Select all
${Math.Calc[${If[${Me.Gem[1].Mana}==0,0,${If[!${Me.Gem[1].ID},0,${Me.CurrentMana}]}]}/${If[${Me.Gem[1].Mana}==0,1,${If[!${Me.Gem[1].ID},1,${Me.Gem[1].Mana}]}]}].Int}
the code calculates the inside ${}'s first.. if you can get a shorter way to work, let me know.. :)
Check in this forum, lax posted a fix, simpler than that.
Posted: Tue Jun 22, 2004 4:50 pm
by SirCodeAlot
Yeah - I basically used what Lax said to. The one in my version is a lot shorter, and it works. If it doesn't - post here and I will fix it.
Posted: Tue Jun 22, 2004 6:49 pm
by Abrasive
I have been using this UI for a long time now and have posted fixes when things have changed. I am now trying to use the MQ2DPS window but it is crashing the UI and reverting back to default.
In reading through posts, It seems that I am not the only one having this problem.
Anyone else using this UI and the MQ2DPS window without problems or has anyone found a reason or solution yet?
Posted: Tue Jun 22, 2004 9:46 pm
by SirCodeAlot
I'll take a look in to it - I have been having the same problems with the MQ2Timer plugin. It seems that it doesn't like foreign windows. I will see what I can dig-up.