Calculate has encountered a '

Help section from before the user variable changes that broke all macros

Moderator: MacroQuest Developers

Jelly
decaying skeleton
decaying skeleton
Posts: 4
Joined: Fri Oct 11, 2002 5:43 pm

Calculate has encountered a '

Post by Jelly » Fri Oct 11, 2002 5:45 pm

Greetings!

Small problem, and I'm wondering if it's a bug. Every now and then, my otherwise fully working macro will spit out this error and stop functioning:

Calculate has encountered a '

I thought I saw a posting about this, but after searching I can't seem to find one. Is this a known issue? I would think it indicates a /varcalc problem. I only have two varcalcs:

/target myself
/varset MyLevel $target(level)
/varcalc MinLevel $MyLevel-4
/varcalc MaxLevel $MyLevel-1

and, looking at the /echos that I have coming after them, they're working fine. Any ideas?

Thanks!

Catt
a lesser mummy
a lesser mummy
Posts: 76
Joined: Mon Sep 16, 2002 2:49 am

Post by Catt » Fri Oct 11, 2002 11:48 pm

you have #define(d) MyLevel, MinLevel, and MaxLevel, correct?

Jelly
decaying skeleton
decaying skeleton
Posts: 4
Joined: Fri Oct 11, 2002 5:43 pm

Post by Jelly » Sat Oct 12, 2002 6:21 pm

Yes. They are #defined as follows:

#define MyLevel v10
#define MinLevel v11
#define MaxLevel v12


As I said, the macro works fine... Occasionally, for no apparent reason, and at different points in the macro, it produces that error.

User avatar
L124RD
Site Admin
Site Admin
Posts: 1343
Joined: Fri Jun 14, 2002 12:15 am
Location: Cyberspace
Contact:

Post by L124RD » Sun Oct 13, 2002 7:05 pm

Salutations,
what version of MQ is this? I remember a while back there was a bug which would only insert one #define into each line...

Jelly
decaying skeleton
decaying skeleton
Posts: 4
Joined: Fri Oct 11, 2002 5:43 pm

Post by Jelly » Sun Oct 13, 2002 9:31 pm

Latest version (9/5/2002)

Even if it would only permit one per line, I'm fairly sure it's working... After the initial calc and before the macro starts running, it /echo's the values in all three variables to me.

User avatar
L124RD
Site Admin
Site Admin
Posts: 1343
Joined: Fri Jun 14, 2002 12:15 am
Location: Cyberspace
Contact:

Post by L124RD » Sun Oct 13, 2002 11:13 pm

Salutations,
so, if you do

Code: Select all

/filter name add Calculate
you wouldn't know you where getting this error? ie all math n' stuff works?

Jelly
decaying skeleton
decaying skeleton
Posts: 4
Joined: Fri Oct 11, 2002 5:43 pm

Post by Jelly » Mon Oct 14, 2002 12:09 pm

ok... I couldn't completely understand what you were asking, but I think your question was are my /alert commands and other stuff based on the /varcalc's working... The answer is yes.

In fact, I find that it usually barfs at a point where the script should be doing absolutely no math at all. For instance, it uses the calculated values to add /alerts. It then alerts, /faces, runs, checks for other PCs in a radius and attacks... It has dumped out this error message at this point many times...

The trouble is, it dumps out this message at other times too which makes it very difficult to figure out if it's my code or a bug.

lifewolf
a ghoul
a ghoul
Posts: 143
Joined: Fri Oct 18, 2002 6:29 pm

Post by lifewolf » Sat Oct 26, 2002 8:12 pm

Trying to figure out how much my druid MStone abuses lastnight left me too lazy to go find windows calculator..

I stoned to about 15%, CH'd myself yeilding 1478hp for 400 mana
Given a MStone converts 60 to 20 (3 to 1) HP to mana, that 400 mana CH without specializaiton or mana preservation cost me 1200 hp

So lastnight, using MQ to see what my mana per cycle rate on this was, i typed

/echo Mana per Cycle is: $calc((1478-1200)/3)

And got the same error.

/echo $calc(1478-1200)
.. Works
/echo $calc(278/3)
.. Works

It seems to be the parenthesis in this example that pops that error in..
/sigh

User avatar
Fippy
a snow griffon
a snow griffon
Posts: 499
Joined: Tue Jul 16, 2002 10:42 am

Post by Fippy » Sun Oct 27, 2002 3:44 am

i think you will find you need to do.

Code: Select all

/echo Mana per Cycle is: $calc($calc(1478-1200)/3) 
to get it to work

neither /varcalc or $calc support paranthesis in the calculation.

Fippy